masq-local.patch

Stefan Metzmacher stefan.metzmacher@metzemix.de
Thu, 25 Oct 2001 10:31:45 +0200


--=====================_14366918==_
Content-Type: text/plain; charset="us-ascii"

Hello!

I have a patch for masquerading local packets in the same way forwarded packets are masqueraded. I tested it for 5 or 6 month without problems.

masq-local.patch:
----snipp----
diff -urN linux-2.4.10/net/ipv4/netfilter/ipt_MASQUERADE.c linux-2.4.10-masq/net/ipv4/netfilter/ipt_MASQUERADE.c
--- linux-2.4.10/net/ipv4/netfilter/ipt_MASQUERADE.c        Thu Oct 25 08:40:51 2001
+++ linux-2.4.10-masq/net/ipv4/netfilter/ipt_MASQUERADE.c        Thu Oct 25 08:42:02 2001
@@ -73,11 +73,6 @@
        IP_NF_ASSERT(hooknum == NF_IP_POST_ROUTING);
-       /* FIXME: For the moment, don't do local packets, breaks
-          testsuite for 2.3.49 --RR */
-       if ((*pskb)->sk)
-               return NF_ACCEPT;
-
        ct = ip_conntrack_get(*pskb, &ctinfo);
        IP_NF_ASSERT(ct && (ctinfo == IP_CT_NEW
                                  || ctinfo == IP_CT_RELATED));
----snapp----

Use the attached files because of the tabs!!


MfG
Stefan Metzmacher

stefan.metzmacher@metzemix.de
--=====================_14366918==_
Content-Type: application/octet-stream; name="masq-local.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="masq-local.patch"

ZGlmZiAtdXJOIGxpbnV4LTIuNC4xMC9uZXQvaXB2NC9uZXRmaWx0ZXIvaXB0X01BU1FVRVJBREUu
YyBsaW51eC0yLjQuMTAtbWFzcS9uZXQvaXB2NC9uZXRmaWx0ZXIvaXB0X01BU1FVRVJBREUuYwot
LS0gbGludXgtMi40LjEwL25ldC9pcHY0L25ldGZpbHRlci9pcHRfTUFTUVVFUkFERS5jICAgICAg
ICBUaHUgT2N0IDI1IDA4OjQwOjUxIDIwMDEKKysrIGxpbnV4LTIuNC4xMC1tYXNxL25ldC9pcHY0
L25ldGZpbHRlci9pcHRfTUFTUVVFUkFERS5jICAgICAgICBUaHUgT2N0IDI1IDA4OjQyOjAyIDIw
MDEKQEAgLTczLDExICs3Myw2IEBACgoJSVBfTkZfQVNTRVJUKGhvb2tudW0gPT0gTkZfSVBfUE9T
VF9ST1VUSU5HKTsKCi0JLyogRklYTUU6IEZvciB0aGUgbW9tZW50LCBkb24ndCBkbyBsb2NhbCBw
YWNrZXRzLCBicmVha3MKLQkgICB0ZXN0c3VpdGUgZm9yIDIuMy40OSAtLVJSICovCi0JaWYgKCgq
cHNrYiktPnNrKQotCQlyZXR1cm4gTkZfQUNDRVBUOwotCgljdCA9IGlwX2Nvbm50cmFja19nZXQo
KnBza2IsICZjdGluZm8pOwoJSVBfTkZfQVNTRVJUKGN0ICYmIChjdGluZm8gPT0gSVBfQ1RfTkVX
CgkJCQkgIHx8IGN0aW5mbyA9PSBJUF9DVF9SRUxBVEVEKSk7Cg==
--=====================_14366918==_
Content-Type: application/octet-stream; name="masq-local.patch.help"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="masq-local.patch.help"

QXV0aG9yOiBTdGVmYW4gTWV0em1hY2hlciA8c3RlZmFuLm1ldHptYWNoZXJAbWV0emVtaXguZGU+
ClN0YXR1czogUXVpdGUgc3RhYmxlLCBJIHVzZWQgaXQgZm9yIG1vbnRoISBGaW5lISEhCgpUaGlz
IGFsbG93cyBsb2NhbCBwYWNrZXRzIHRvIGJlIG1hc3F1ZXJhZGUuCgo=
--=====================_14366918==_--