Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 May 2016 13:48:26 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r300679 - head/sys/netinet
Message-ID:  <201605251348.u4PDmQdA040104@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Wed May 25 13:48:26 2016
New Revision: 300679
URL: https://svnweb.freebsd.org/changeset/base/300679

Log:
  Count packets as not being delivered only if they are neither
  processed by a kernel handler nor by a raw socket.
  
  MFC after:	1 week

Modified:
  head/sys/netinet/raw_ip.c

Modified: head/sys/netinet/raw_ip.c
==============================================================================
--- head/sys/netinet/raw_ip.c	Wed May 25 13:09:06 2016	(r300678)
+++ head/sys/netinet/raw_ip.c	Wed May 25 13:48:26 2016	(r300679)
@@ -132,6 +132,8 @@ int (*ip_rsvp_vif)(struct socket *, stru
 void (*ip_rsvp_force_done)(struct socket *);
 #endif /* INET */
 
+extern	struct protosw inetsw[];
+
 u_long	rip_sendspace = 9216;
 SYSCTL_ULONG(_net_inet_raw, OID_AUTO, maxdgram, CTLFLAG_RW,
     &rip_sendspace, 0, "Maximum outgoing raw IP datagram size");
@@ -411,9 +413,11 @@ rip_input(struct mbuf **mp, int *offp, i
 			IPSTAT_INC(ips_delivered);
 		INP_RUNLOCK(last);
 	} else {
+		if (inetsw[ip_protox[ip->ip_p]].pr_input == rip_input) {
+			IPSTAT_INC(ips_noproto);
+			IPSTAT_DEC(ips_delivered);
+		}
 		m_freem(m);
-		IPSTAT_INC(ips_noproto);
-		IPSTAT_DEC(ips_delivered);
 	}
 	return (IPPROTO_DONE);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605251348.u4PDmQdA040104>