summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2005-11-11 16:04:59 +0000
committerru <ru@FreeBSD.org>2005-11-11 16:04:59 +0000
commitf70f525b491a7d4a0a4f60eb7d69095f6f6e12e4 (patch)
treec961eb29eda0888de8f7fedb7d3eb12e58d687d3 /sys/netgraph
parentf82904627463e2f13912d433c5855e8bc112a3f3 (diff)
downloadFreeBSD-src-f70f525b491a7d4a0a4f60eb7d69095f6f6e12e4.zip
FreeBSD-src-f70f525b491a7d4a0a4f60eb7d69095f6f6e12e4.tar.gz
- Store pointer to the link-level address right in "struct ifnet"
rather than in ifindex_table[]; all (except one) accesses are through ifp anyway. IF_LLADDR() works faster, and all (except one) ifaddr_byindex() users were converted to use ifp->if_addr. - Stop storing a (pointer to) Ethernet address in "struct arpcom", and drop the IFP2ENADDR() macro; all users have been converted to use IF_LLADDR() instead.
Diffstat (limited to 'sys/netgraph')
-rw-r--r--sys/netgraph/ng_ether.c4
-rw-r--r--sys/netgraph/ng_fec.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c
index 484f2a9..51e40c2 100644
--- a/sys/netgraph/ng_ether.c
+++ b/sys/netgraph/ng_ether.c
@@ -461,7 +461,7 @@ ng_ether_rcvmsg(node_p node, item_p item, hook_p lasthook)
error = ENOMEM;
break;
}
- bcopy(IFP2ENADDR(priv->ifp),
+ bcopy(IF_LLADDR(priv->ifp),
resp->data, ETHER_ADDR_LEN);
break;
case NGM_ETHER_SET_ENADDR:
@@ -624,7 +624,7 @@ ng_ether_rcv_lower(node_p node, struct mbuf *m)
return (ENOBUFS);
/* Overwrite source MAC address */
- bcopy(IFP2ENADDR(ifp),
+ bcopy(IF_LLADDR(ifp),
mtod(m, struct ether_header *)->ether_shost,
ETHER_ADDR_LEN);
}
diff --git a/sys/netgraph/ng_fec.c b/sys/netgraph/ng_fec.c
index 85e2f77..fb5657c 100644
--- a/sys/netgraph/ng_fec.c
+++ b/sys/netgraph/ng_fec.c
@@ -102,8 +102,8 @@
#include <sys/queue.h>
#include <net/if.h>
+#include <net/if_dl.h>
#include <net/if_types.h>
-#include <net/if_arp.h>
#include <net/if_media.h>
#include <net/bpf.h>
#include <net/ethernet.h>
@@ -411,18 +411,18 @@ ng_fec_addport(struct ng_fec_private *priv, char *iface)
* by extension, all the other ports in the bundle).
*/
if (b->fec_ifcnt == 0)
- if_setlladdr(ifp, IFP2ENADDR(bifp), ETHER_ADDR_LEN);
+ if_setlladdr(ifp, IF_LLADDR(bifp), ETHER_ADDR_LEN);
b->fec_btype = FEC_BTYPE_MAC;
new->fec_idx = b->fec_ifcnt;
b->fec_ifcnt++;
/* Save the real MAC address. */
- bcopy(IFP2ENADDR(bifp),
+ bcopy(IF_LLADDR(bifp),
(char *)&new->fec_mac, ETHER_ADDR_LEN);
/* Set up phony MAC address. */
- if_setlladdr(bifp, IFP2ENADDR(ifp), ETHER_ADDR_LEN);
+ if_setlladdr(bifp, IF_LLADDR(ifp), ETHER_ADDR_LEN);
/* Save original input vector */
new->fec_if_input = bifp->if_input;
@@ -1143,7 +1143,7 @@ ng_fec_constructor(node_p node)
log(LOG_WARNING, "%s: can't acquire netgraph name\n", ifname);
/* Attach the interface */
- ether_ifattach(ifp, IFP2ENADDR(priv->ifp));
+ ether_ifattach(ifp, IF_LLADDR(priv->ifp));
callout_handle_init(&priv->fec_ch);
/* Override output method with our own */
OpenPOWER on IntegriCloud