From owner-svn-src-head@FreeBSD.ORG Fri Sep 19 05:43:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAA07A80; Fri, 19 Sep 2014 05:43:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB412B08; Fri, 19 Sep 2014 05:43:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8J5hcmB007113; Fri, 19 Sep 2014 05:43:38 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8J5hclw007112; Fri, 19 Sep 2014 05:43:38 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409190543.s8J5hclw007112@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 19 Sep 2014 05:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271853 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Sep 2014 05:43:39 -0000 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; }