Date: Thu, 26 May 2016 14:33:08 -0700 From: Gleb Smirnoff <glebius@FreeBSD.org> To: Michael Tuexen <tuexen@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300679 - head/sys/netinet Message-ID: <20160526213308.GJ58287@FreeBSD.org> In-Reply-To: <201605251348.u4PDmQdA040104@repo.freebsd.org> References: <201605251348.u4PDmQdA040104@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Michael, On Wed, May 25, 2016 at 01:48:26PM +0000, Michael Tuexen wrote: M> Author: tuexen M> Date: Wed May 25 13:48:26 2016 M> New Revision: 300679 M> URL: https://svnweb.freebsd.org/changeset/base/300679 M> M> Log: M> Count packets as not being delivered only if they are neither M> processed by a kernel handler nor by a raw socket. M> M> MFC after: 1 week M> M> Modified: M> head/sys/netinet/raw_ip.c M> M> Modified: head/sys/netinet/raw_ip.c M> ============================================================================== M> --- head/sys/netinet/raw_ip.c Wed May 25 13:09:06 2016 (r300678) M> +++ head/sys/netinet/raw_ip.c Wed May 25 13:48:26 2016 (r300679) M> @@ -132,6 +132,8 @@ int (*ip_rsvp_vif)(struct socket *, stru M> void (*ip_rsvp_force_done)(struct socket *); M> #endif /* INET */ M> M> +extern struct protosw inetsw[]; M> + M> u_long rip_sendspace = 9216; M> SYSCTL_ULONG(_net_inet_raw, OID_AUTO, maxdgram, CTLFLAG_RW, M> &rip_sendspace, 0, "Maximum outgoing raw IP datagram size"); M> @@ -411,9 +413,11 @@ rip_input(struct mbuf **mp, int *offp, i M> IPSTAT_INC(ips_delivered); M> INP_RUNLOCK(last); M> } else { M> + if (inetsw[ip_protox[ip->ip_p]].pr_input == rip_input) { M> + IPSTAT_INC(ips_noproto); M> + IPSTAT_DEC(ips_delivered); M> + } M> m_freem(m); M> - IPSTAT_INC(ips_noproto); M> - IPSTAT_DEC(ips_delivered); M> } M> return (IPPROTO_DONE); M> } How could it happen at this place that inetsw[ip_protox[ip->ip_p]].pr_input != rip_input? Another question. Can we get rid of ugly IPSTAT_DEC()? Since pr_input is an integer, we could return error up to ip_input() that would indicate non-delivery. -- Totus tuus, Glebius.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160526213308.GJ58287>