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:
Michael Tuexen 2016-05-25 15:54:21 +00:00
parent e60dd0e86a
commit 6d7270a580
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=300687

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