From archie@dellroad.org  Sun Feb  3 11:15:17 2002
Return-Path: <archie@dellroad.org>
Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26])
	by hub.freebsd.org (Postfix) with ESMTP id EF4FE37B400
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  3 Feb 2002 11:15:15 -0800 (PST)
Received: from arch20m.dellroad.org (arch20m.dellroad.org [10.1.1.20])
	by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id LAA53780;
	Sun, 3 Feb 2002 11:03:06 -0800 (PST)
Received: (from archie@localhost)
	by arch20m.dellroad.org (8.11.6/8.11.6) id g13J34L02548;
	Sun, 3 Feb 2002 11:03:04 -0800 (PST)
	(envelope-from archie)
Message-Id: <200202031903.g13J34L02548@arch20m.dellroad.org>
Date: Sun, 3 Feb 2002 11:03:04 -0800 (PST)
From: Archie Cobbs <archie@dellroad.org>
To: freebsd-gnats-submit@FreeBSD.org, michaelb@thus.net
Subject: Better patch

>Number:         34590
>Category:       kern
>Synopsis:       Better patch
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 03 11:20:00 PST 2002
>Closed-Date:    Mon Feb 4 14:13:14 PST 2002
>Last-Modified:  Thu Oct 07 18:25:26 GMT 2004
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 Oops, the previous patch was completely bogus. Try this
 one instead. Note: this is a patch against -current; the
 -stable patch is similar.

[********** this was supposed to be for kern/31586 ************]
[********** this was supposed to be for kern/31586 ************]

	http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/31586

[********** this was supposed to be for kern/31586 ************]
[********** this was supposed to be for kern/31586 ************]
 
 -Archie
 
 __________________________________________________________________________
 Archie Cobbs     *     Packet Design     *     http://www.packetdesign.com
 
 Index: sys/netgraph/ng_ether.c
 ===================================================================
 RCS file: /home/ncvs/src/sys/netgraph/ng_ether.c,v
 retrieving revision 1.21
 diff -u -r1.21 ng_ether.c
 --- sys/netgraph/ng_ether.c	10 Dec 2001 08:09:47 -0000	1.21
 +++ sys/netgraph/ng_ether.c	3 Feb 2002 19:00:48 -0000
 @@ -75,6 +75,7 @@
  	u_char		lowerOrphan;	/* whether lower is lower or orphan */
  	u_char		autoSrcAddr;	/* always overwrite source address */
  	u_char		promisc;	/* promiscuous mode enabled */
 +	u_long		hwassist;	/* hardware checksum capabilities */
  	u_int		flags;		/* flags e.g. really die */
  };
  typedef struct private *priv_p;
 @@ -317,6 +318,7 @@
  	priv->ifp = ifp;
  	IFP2NG(ifp) = node;
  	priv->autoSrcAddr = 1;
 +	priv->hwassist = ifp->if_hwassist;
  
  	/* Try to give the node the same name as the interface */
  	if (ng_name_node(node, name) != 0) {
 @@ -468,6 +470,10 @@
  	if (*hookptr != NULL)
  		return (EISCONN);
  
 +	/* Disable hardware checksums while 'upper' hook is connected */
 +	if (hookptr == &priv->upper)
 +		priv->ifp->if_hwassist = 0;
 +
  	/* OK */
  	*hookptr = hook;
  	priv->lowerOrphan = orphan;
 @@ -715,9 +721,10 @@
  {
  	const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook));
  
 -	if (hook == priv->upper)
 +	if (hook == priv->upper) {
  		priv->upper = NULL;
 -	else if (hook == priv->lower) {
 +		priv->ifp->if_hwassist = priv->hwassist;  /* restore h/w csum */
 +	} else if (hook == priv->lower) {
  		priv->lower = NULL;
  		priv->lowerOrphan = 0;
  	} else
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: keramida 
State-Changed-When: Mon Feb 4 14:13:14 PST 2002 
State-Changed-Why:  
Misfiled PR.  This seems to be a followup to an existing PR, but I 
can't find which PR that could be.  Can you please post again, paying 
attention to add to the beginning of your "Subject:" header a 
reference to the PR you'r replying to?  Examples of valid references 
could be: 

Re: kern/23456: My subject goes here 
Re: docs/19359: Here is the fix. 


http://www.FreeBSD.org/cgi/query-pr.cgi?pr=34590 
>Unformatted:
