diff options
author | wollman <wollman@FreeBSD.org> | 1995-07-10 16:16:00 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1995-07-10 16:16:00 +0000 |
commit | 8be4be0de5edce5018b3ae0a68eb64def700233e (patch) | |
tree | cfbb7673033dd6a669d3722b51967f5ac6dbfef8 | |
parent | c0e94734e2b051cf70c06a120c3d727c31237bcb (diff) | |
download | FreeBSD-src-8be4be0de5edce5018b3ae0a68eb64def700233e.zip FreeBSD-src-8be4be0de5edce5018b3ae0a68eb64def700233e.tar.gz |
ICMP messages received from broken hosts which reply to multicast packets
were mistakenly delivered, rather than getting thrown out, which caused
substantial lossage.
Submitted by: Bill Fenner <fenner@parc.xerox.com>
-rw-r--r-- | sys/netinet/ip_icmp.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index d7b4a11..4b203f5 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94 - * $Id: ip_icmp.c,v 1.6 1995/03/16 18:14:54 bde Exp $ + * $Id: ip_icmp.c,v 1.7 1995/05/30 08:09:42 rgrimes Exp $ */ #include <sys/param.h> @@ -220,13 +220,14 @@ icmp_input(m, hlen) m->m_data -= hlen; #ifdef ICMPPRINTFS - /* - * Message type specific processing. - */ if (icmpprintfs) printf("icmp_input, type %d code %d\n", icp->icmp_type, icp->icmp_code); #endif + + /* + * Message type specific processing. + */ if (icp->icmp_type > ICMP_MAXTYPE) goto raw; icmpstat.icps_inhist[icp->icmp_type]++; @@ -291,6 +292,9 @@ icmp_input(m, hlen) goto freeit; } NTOHS(icp->icmp_ip.ip_len); + /* Discard ICMP's in response to multicast packets */ + if (IN_MULTICAST(ntohl(icp->icmp_ip.ip_dst.s_addr))) + goto badcode; #ifdef ICMPPRINTFS if (icmpprintfs) printf("deliver to protocol %d\n", icp->icmp_ip.ip_p); |