Add sanity check for return of sotoinpcb() and intotcpcb()
[unix-history] / sys / netinet / ip_icmp.c
index 496fb92..1085bb7 100644 (file)
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  *     from: @(#)ip_icmp.c     7.15 (Berkeley) 4/20/91
  * SUCH DAMAGE.
  *
  *     from: @(#)ip_icmp.c     7.15 (Berkeley) 4/20/91
- *     $Id: ip_icmp.c,v 1.5 1993/11/25 01:35:07 wollman Exp $
+ *     $Id: ip_icmp.c,v 1.6 1993/12/19 00:52:42 wollman Exp $
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -156,6 +156,11 @@ icmp_error(n, type, code, dest, mtu)
                icmpstat.icps_oldicmp++;
                goto freeit;
        }
                icmpstat.icps_oldicmp++;
                goto freeit;
        }
+#ifdef MULTICAST
+       /* Don't send error in response to a multicast or broadcast packet */
+       if(n->m_flags & (M_MCAST | M_BCAST))
+               goto freeit;
+#endif
 
        /*
         * First, formulate icmp message
 
        /*
         * First, formulate icmp message