patch-2.0.34 linux/net/ipv4/ip_masq.c

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

diff -u --recursive --new-file v2.0.33/linux/net/ipv4/ip_masq.c linux/net/ipv4/ip_masq.c
@@ -762,13 +762,16 @@
                 ip_masq_set_expire(ms,0);
                 
                 /*
-                 *	If sysctl !=0 and no pkt has been received yet
-                 *	in this tunnel and routing iface address has changed...
-                 *	 "You are welcome, diald".
+                 *	If sysctl & 3 and either
+		 *        no pkt has been received yet
+		 *      or
+		 *        sysctl & 4
+                 *	in this tunnel ...
+                 *	 "You are welcome, diald, ipppd, pppd-3.3...".
                  */
-                if ( sysctl_ip_dynaddr && ms->flags & IP_MASQ_F_NO_REPLY && dev->pa_addr != ms->maddr) {
+                if ( (sysctl_ip_dynaddr & 3) && (ms->flags & IP_MASQ_F_NO_REPLY || sysctl_ip_dynaddr & 4) && dev->pa_addr != ms->maddr) {
                         unsigned long flags;
-                        if (sysctl_ip_dynaddr > 1) {
+                        if (sysctl_ip_dynaddr & 2) {
                                 printk(KERN_INFO "ip_fw_masquerade(): change maddr from %s",
                                        in_ntoa(ms->maddr));
                                 printk(" to %s\n", in_ntoa(dev->pa_addr));
@@ -971,11 +974,14 @@
 		/* Rewrite source address */
                 
                 /*
-                 *	If sysctl !=0 and no pkt has been received yet
-                 *	in this tunnel and routing iface address has changed...
-                 *	 "You are welcome, diald".
+                 *	If sysctl & 3 and either
+		 *        no pkt has been received yet
+		 *      or
+		 *        sysctl & 4
+                 *	in this tunnel ...
+                 *	 "You are welcome, diald, ipppd, pppd-3.3...".
                  */
-                if ( sysctl_ip_dynaddr && ms->flags & IP_MASQ_F_NO_REPLY && dev->pa_addr != ms->maddr) {
+                if ( (sysctl_ip_dynaddr & 3) && (ms->flags & IP_MASQ_F_NO_REPLY || sysctl_ip_dynaddr & 4) && dev->pa_addr != ms->maddr) {
                         unsigned long flags;
 #ifdef DEBUG_CONFIG_IP_MASQUERADE
                         printk(KERN_INFO "ip_fw_masq_icmp(): change masq.addr %s",

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov