patch-1.3.34 linux/net/ipv4/icmp.c
Next file: linux/net/ipv4/ipmr.c
Previous file: linux/mm/swap.c
Back to the patch index
Back to the overall index
- Lines: 42
- Date:
Thu Oct 12 15:42:49 1995
- Orig file:
v1.3.33/linux/net/ipv4/icmp.c
- Orig date:
Wed Oct 4 14:14:35 1995
diff -u --recursive --new-file v1.3.33/linux/net/ipv4/icmp.c linux/net/ipv4/icmp.c
@@ -15,6 +15,7 @@
*
* Fixes:
* Mike Shaver : RFC1122 checks.
+ * Alan Cox : Multicast ping reply as self.
*
*
*
@@ -455,7 +456,11 @@
ip_rt_add((RTF_DYNAMIC | RTF_MODIFIED | RTF_GATEWAY),
ip, 0, icmph->un.gateway, dev,0, 0, 0);
#endif
- break;
+ /*
+ * As per RFC recommendations now handle it as
+ * a host redirect.
+ */
+
case ICMP_REDIR_HOST:
/*
* Add better route to host.
@@ -632,7 +637,7 @@
* Parse the ICMP message
*/
- if (daddr!=dev->pa_addr && ip_chk_addr(daddr) == IS_BROADCAST)
+ if (daddr!=dev->pa_addr && ip_chk_addr(daddr) != IS_MYADDR)
{
/*
* RFC 1122: 3.2.2.6 An ICMP_ECHO to broadcast MAY be silently ignored (we don't as it is used
@@ -645,6 +650,11 @@
kfree_skb(skb, FREE_READ);
return(0);
}
+ /*
+ * Reply the multicast/broadcast using a legal
+ * interface - in this case the device we got
+ * it from.
+ */
daddr=dev->pa_addr;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this