patch-2.2.18 linux/net/ipv4/fib_rules.c

Next file: linux/net/ipv4/icmp.c
Previous file: linux/net/ipv4/devinet.c
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/net/ipv4/fib_rules.c linux/net/ipv4/fib_rules.c
@@ -5,7 +5,7 @@
  *
  *		IPv4 Forwarding Information Base: policy rules.
  *
- * Version:	$Id: fib_rules.c,v 1.9 1999/03/25 10:04:23 davem Exp $
+ * Version:	$Id: fib_rules.c,v 1.9.2.1 2000/10/06 10:34:16 davem Exp $
  *
  * Authors:	Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
  *
@@ -224,7 +224,7 @@
 
 		if (addrtype == RTN_NAT) {
 			/* Packet is from  translated source; remember it */
-			saddr = (saddr&~r->r_srcmask)|r->r_srcmap;
+			saddr = r->r_srcmask ? (saddr&~r->r_srcmask)|r->r_srcmap : r->r_srcmap;
 			*flags |= RTCF_SNAT;
 		} else if (addrtype == RTN_LOCAL || r->r_srcmap == 0) {
 			/* Packet is from masqueraded source; remember it */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)