Author: tuexen
Date: Wed May 25 15:54:21 2016
New Revision: 300687
URL: https://svnweb.freebsd.org/changeset/base/300687

Log:
  Send an ICMP packet indicating destination unreachable/protocol
  unreachable if we don't handle the packet in the kernel and not
  in userspace.
  
  MFC after:    1 week

Modified:
  head/sys/netinet/raw_ip.c

Modified: head/sys/netinet/raw_ip.c
==============================================================================
--- head/sys/netinet/raw_ip.c   Wed May 25 15:49:29 2016        (r300686)
+++ head/sys/netinet/raw_ip.c   Wed May 25 15:54:21 2016        (r300687)
@@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$");
 #include <netinet/ip.h>
 #include <netinet/ip_var.h>
 #include <netinet/ip_mroute.h>
+#include <netinet/ip_icmp.h>
 
 #ifdef IPSEC
 #include <netipsec/ipsec.h>
@@ -416,8 +417,10 @@ rip_input(struct mbuf **mp, int *offp, i
                if (inetsw[ip_protox[ip->ip_p]].pr_input == rip_input) {
                        IPSTAT_INC(ips_noproto);
                        IPSTAT_DEC(ips_delivered);
+                       icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PROTOCOL, 0, 
0);
+               } else {
+                       m_freem(m);
                }
-               m_freem(m);
        }
        return (IPPROTO_DONE);
 }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to