diff options
| author | Archie Cobbs <archie@FreeBSD.org> | 2002-02-12 18:21:20 +0000 |
|---|---|---|
| committer | Archie Cobbs <archie@FreeBSD.org> | 2002-02-12 18:21:20 +0000 |
| commit | 01a88179621a331bff3ce7d0b16d95f66c7295e2 (patch) | |
| tree | 65d1c783cfcd9caf77abd6d7a9f55fdeec641506 /sys/netgraph | |
| parent | f71172135ec7783b6d2ff0590fd1ea02444a62c3 (diff) | |
Notes
Diffstat (limited to 'sys/netgraph')
| -rw-r--r-- | sys/netgraph/ng_ether.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c index abd5b1ba0a34..845b3a488f19 100644 --- a/sys/netgraph/ng_ether.c +++ b/sys/netgraph/ng_ether.c @@ -75,6 +75,7 @@ struct private { 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 */ }; typedef struct private *priv_p; @@ -319,6 +320,7 @@ ng_ether_attach(struct ifnet *ifp) 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) { @@ -470,6 +472,10 @@ ng_ether_newhook(node_p node, hook_p hook, const char *name) 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; @@ -685,9 +691,10 @@ ng_ether_disconnect(hook_p hook) { const priv_p priv = hook->node->private; - 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 |
