View | Details | Raw Unified | Return to bug 24512
Collapse All | Expand All

(-)sys/netinet/ip_input.c (-1 / +12 lines)
Lines 124-129 Link Here
124
	&ip_keepfaith,	0,
124
	&ip_keepfaith,	0,
125
	"Enable packet capture for FAITH IPv4->IPv6 translater daemon");
125
	"Enable packet capture for FAITH IPv4->IPv6 translater daemon");
126
126
127
int	ip_sent_unreach = 1;
128
SYSCTL_INT(_net_inet_ip, OID_AUTO, sent_unreach, CTLFLAG_RW, &ip_sent_unreach, 
129
	0, "Sent ICMP unreach when packet not for us rx, and forwarding disabled");
130
127
#ifdef DIAGNOSTIC
131
#ifdef DIAGNOSTIC
128
static int	ipprintfs = 0;
132
static int	ipprintfs = 0;
129
#endif
133
#endif
Lines 575-581 Link Here
575
	 */
579
	 */
576
	if (ipforwarding == 0) {
580
	if (ipforwarding == 0) {
577
		ipstat.ips_cantforward++;
581
		ipstat.ips_cantforward++;
578
		m_freem(m);
582
		/*
583
		 * If we receive a packet not for us, and forwarding disabled
584
		 * sent a ICMP host unreachable back to the source.
585
		 */
586
		if (ip_sent_unreach != 0)
587
			icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0);
588
		else
589
			m_freem(m);
579
	} else
590
	} else
580
		ip_forward(m, 0);
591
		ip_forward(m, 0);
581
#ifdef IPFIREWALL_FORWARD
592
#ifdef IPFIREWALL_FORWARD

Return to bug 24512