summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2016-05-25 15:54:21 +0000
committertuexen <tuexen@FreeBSD.org>2016-05-25 15:54:21 +0000
commit0bb4927e0cd15615ab53329a9f0e8403ab38e5fd (patch)
tree44c77cc0da617bfefb1776aa311e77551a3828c8
parent1b6bea5af7a2f9cfe3b236490851d8df4e27098d (diff)
downloadFreeBSD-src-0bb4927e0cd15615ab53329a9f0e8403ab38e5fd.zip
FreeBSD-src-0bb4927e0cd15615ab53329a9f0e8403ab38e5fd.tar.gz
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
-rw-r--r--sys/netinet/raw_ip.c5
1 files changed, 4 insertions, 1 deletions
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 <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, 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);
}
OpenPOWER on IntegriCloud