From 0bb4927e0cd15615ab53329a9f0e8403ab38e5fd Mon Sep 17 00:00:00 2001 From: tuexen Date: Wed, 25 May 2016 15:54:21 +0000 Subject: 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(-) (limited to 'sys/netinet/raw_ip.c') diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 74a9d9a..59540a5 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); } -- cgit v1.1