2.2.14pre3 Masquerade Fix

Joseph Gooch (mrwizard@psu.edu)
Sun, 31 Oct 1999 17:52:10 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_0002_01BF23C8.A84EA160
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

This patch applies against 2.2.14pre3. It should fix ip masquerading.

Enjoy,
Joseph Gooch
------=_NextPart_000_0002_01BF23C8.A84EA160
Content-Type: application/octet-stream;
name="masq-pre3fix.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="masq-pre3fix.patch"

diff -ruN linux-2.2.14pre3-vanilla/net/ipv4/ip_forward.c =
linux-2.2.14pre3-masqfix/net/ipv4/ip_forward.c=0A=
--- linux-2.2.14pre3-vanilla/net/ipv4/ip_forward.c Sun Oct 31 17:39:17 =
1999=0A=
+++ linux-2.2.14pre3-masqfix/net/ipv4/ip_forward.c Sun Oct 31 17:46:10 =
1999=0A=
@@ -176,8 +176,7 @@=0A=
(icmph->type=3D=3DICMP_TIME_EXCEEDED))=0A=
{=0A=
#endif=0A=
- u32 maddr =3D rt->rt_src;=0A=
- fw_res =3D ip_fw_masq_icmp(&skb, maddr);=0A=
+ fw_res =3D ip_fw_masquerade(&skb, 0);=0A=
if (fw_res < 0) {=0A=
kfree_skb(skb);=0A=
return -1;=0A=
@@ -219,15 +218,11 @@=0A=
*/=0A=
if (!(IPCB(skb)->flags&IPSKB_MASQUERADED) &&=0A=
(fw_res=3D=3DFW_MASQUERADE || rt->rt_flags&RTCF_MASQ)) {=0A=
- u32 maddr;=0A=
+ u32 maddr =3D 0;=0A=
=0A=
#ifdef CONFIG_IP_ROUTE_NAT=0A=
maddr =3D (rt->rt_flags&RTCF_MASQ) ? rt->rt_src_map : 0;=0A=
-=0A=
- if (maddr =3D=3D 0)=0A=
#endif=0A=
- maddr =3D rt->rt_src;=0A=
-=0A=
if (ip_fw_masquerade(&skb, maddr) < 0) {=0A=
kfree_skb(skb);=0A=
return -1;=0A=
diff -ruN linux-2.2.14pre3-vanilla/net/ipv4/ip_masq.c =
linux-2.2.14pre3-masqfix/net/ipv4/ip_masq.c=0A=
--- linux-2.2.14pre3-vanilla/net/ipv4/ip_masq.c Sun Oct 31 17:39:17 1999=0A=
+++ linux-2.2.14pre3-masqfix/net/ipv4/ip_masq.c Sun Oct 31 17:47:06 1999=0A=
@@ -1152,6 +1152,7 @@=0A=
=0A=
if (ip_route_output(&rt, iph->daddr, 0, RT_TOS(iph->tos)|RTO_CONN, =
skb_dev?skb_dev->ifindex:0)) {=0A=
/* Fallback on old method */=0A=
+ /* This really shouldn't happen... */=0A=
maddr =3D inet_select_addr(skb_dev, skb_rt->rt_gateway, =
RT_SCOPE_UNIVERSE);=0A=
} else {=0A=
/* Route lookup succeeded */=0A=

------=_NextPart_000_0002_01BF23C8.A84EA160--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/