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
This commit is contained in:
tuexen 2016-05-25 15:54:21 +00:00
parent 1b6bea5af7
commit 0bb4927e0c

View File

@ -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);
}