Date: Fri, 19 Sep 2014 05:43:38 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271853 - head/sys/net Message-ID: <201409190543.s8J5hclw007112@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Fri Sep 19 05:43:38 2014 New Revision: 271853 URL: http://svnweb.freebsd.org/changeset/base/271853 Log: Increase errors, not queue drops, in cases the module is supplied with a bad packet or if mbuf allocation failes. Modified: head/sys/net/if_gre.c Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Fri Sep 19 05:23:47 2014 (r271852) +++ head/sys/net/if_gre.c Fri Sep 19 05:43:38 2014 (r271853) @@ -361,7 +361,7 @@ gre_output(struct ifnet *ifp, struct mbu * be encapsulated. */ if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) { - _IF_DROP(&ifp->if_snd); + ifp->if_oerrors++; m_freem(m); error = EINVAL; /* is there better errno? */ goto end; @@ -390,7 +390,7 @@ gre_output(struct ifnet *ifp, struct mbu if ((m->m_data - msiz) < m->m_pktdat) { m0 = m_gethdr(M_NOWAIT, MT_DATA); if (m0 == NULL) { - _IF_DROP(&ifp->if_snd); + ifp->if_oerrors++; m_freem(m); error = ENOBUFS; goto end; @@ -415,7 +415,7 @@ gre_output(struct ifnet *ifp, struct mbu memcpy((caddr_t)(ip + 1), &mob_h, (unsigned)msiz); ip->ip_len = htons(ntohs(ip->ip_len) + msiz); } else { /* AF_INET */ - _IF_DROP(&ifp->if_snd); + ifp->if_oerrors++; m_freem(m); error = EINVAL; goto end; @@ -440,7 +440,7 @@ gre_output(struct ifnet *ifp, struct mbu break; #endif default: - _IF_DROP(&ifp->if_snd); + ifp->if_oerrors++; m_freem(m); error = EAFNOSUPPORT; goto end; @@ -452,14 +452,14 @@ gre_output(struct ifnet *ifp, struct mbu hdrlen += sizeof(uint32_t); M_PREPEND(m, hdrlen, M_NOWAIT); } else { - _IF_DROP(&ifp->if_snd); + ifp->if_oerrors++; m_freem(m); error = EINVAL; goto end; } if (m == NULL) { /* mbuf allocation failed */ - _IF_DROP(&ifp->if_snd); + ifp->if_oerrors++; error = ENOBUFS; goto end; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409190543.s8J5hclw007112>