From owner-svn-src-head@FreeBSD.ORG Tue Jun 12 12:44:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECCF1106564A; Tue, 12 Jun 2012 12:44:17 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8E748FC08; Tue, 12 Jun 2012 12:44:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5CCiHNH053942; Tue, 12 Jun 2012 12:44:17 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5CCiH4i053940; Tue, 12 Jun 2012 12:44:17 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201206121244.q5CCiH4i053940@svn.freebsd.org> From: Randall Stewart Date: Tue, 12 Jun 2012 12:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236955 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 12 Jun 2012 12:44:18 -0000 Author: rrs Date: Tue Jun 12 12:44:17 2012 New Revision: 236955 URL: http://svn.freebsd.org/changeset/base/236955 Log: Note to self. Have morning coffee *before* committing things. There is no mac_addr in the mbuf for BSD.. cheat like we are supposed to and use the csum field since our friend the gif tunnel itself will never use offload. Modified: head/sys/net/if_gif.c Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Tue Jun 12 12:40:15 2012 (r236954) +++ head/sys/net/if_gif.c Tue Jun 12 12:44:17 2012 (r236955) @@ -388,7 +388,8 @@ keep_going: /* Now pull back the af in packet that * was saved in the address location. */ - bcopy(m->m_pkthdr.src_mac_addr, &af, sizeof(af)); + af = m->m_pkthdr.csum_data; + if (ifp->if_bridge) af = AF_LINK; @@ -503,10 +504,11 @@ gif_output(ifp, m, dst, ro) dst->sa_family = af; } af = dst->sa_family; - /* Now save the af in the inbound pkt mac - * address location. + /* Now save the af in the inbound pkt csum + * data, this is a cheat since really + * gif tunnels don't do offload. */ - bcopy(&af, m->m_pkthdr.src_mac_addr, sizeof(af)); + m->m_pkthdr.csum_data = af; if (!(ifp->if_flags & IFF_UP) || sc->gif_psrc == NULL || sc->gif_pdst == NULL) { m_freem(m);