From 6d7270a580f08fe7ee9d17c1282d24e4393e4997 Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Wed, 25 May 2016 15:54:21 +0000 Subject: [PATCH] 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 --- sys/netinet/raw_ip.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 74a9d9a33a1d..59540a50c361 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef IPSEC #include @@ -416,8 +417,10 @@ rip_input(struct mbuf **mp, int *offp, int proto) 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); }