From owner-svn-src-all@freebsd.org Wed Oct 7 13:10:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4C589D1FB6; Wed, 7 Oct 2015 13:10:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 AEBD39E6; Wed, 7 Oct 2015 13:10:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t97DAQJ4023228; Wed, 7 Oct 2015 13:10:26 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t97DAQ97023227; Wed, 7 Oct 2015 13:10:26 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201510071310.t97DAQ97023227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 7 Oct 2015 13:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288991 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Oct 2015 13:10:28 -0000 Author: glebius Date: Wed Oct 7 13:10:26 2015 New Revision: 288991 URL: https://svnweb.freebsd.org/changeset/base/288991 Log: Fix regression from r287779, that bite me. If we call m_pullup() unconditionally, we end up with an mbuf chain of two mbufs, which later in in_arpreply() is rewritten from ARP request to ARP reply and is sent out. Looks like igb(4) (at least mine, and at least at my network) fails on such mbuf chain, so ARP reply doesn't go out wire. Thus, make the m_pullup() call conditional, as it is everywhere. Of course, the bug in igb(?) should be investigated, but better first fix the head. And unconditional m_pullup() was suboptimal, anyway. Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Wed Oct 7 12:40:00 2015 (r288990) +++ head/sys/netinet/if_ether.c Wed Oct 7 13:10:26 2015 (r288991) @@ -531,12 +531,15 @@ arpintr(struct mbuf *m) ar = mtod(m, struct arphdr *); /* Check if length is sufficient */ - if ((m = m_pullup(m, arphdr_len(ar))) == NULL) { - ARP_LOG(LOG_NOTICE, "short packet received on %s\n", - if_name(ifp)); - return; + if (m->m_len < arphdr_len(ar)) { + m = m_pullup(m, arphdr_len(ar)); + if (m == NULL) { + ARP_LOG(LOG_NOTICE, "short packet received on %s\n", + if_name(ifp)); + return; + } + ar = mtod(m, struct arphdr *); } - ar = mtod(m, struct arphdr *); hlen = 0; layer = "";