diff options
author | ru <ru@FreeBSD.org> | 2005-11-08 09:03:06 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2005-11-08 09:03:06 +0000 |
commit | 9349a52f4187301776450d07f77fbf8af30d7c87 (patch) | |
tree | 29070e34424e47ed331d77558b6a009d5589c4f4 /sys/netgraph/ng_eiface.c | |
parent | 1098b18801da5a20782d6f8dd6303e51e5c95308 (diff) | |
download | FreeBSD-src-9349a52f4187301776450d07f77fbf8af30d7c87.zip FreeBSD-src-9349a52f4187301776450d07f77fbf8af30d7c87.tar.gz |
Simplify setting the link-level address.
Diffstat (limited to 'sys/netgraph/ng_eiface.c')
-rw-r--r-- | sys/netgraph/ng_eiface.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/sys/netgraph/ng_eiface.c b/sys/netgraph/ng_eiface.c index 6a21cba..f834d30 100644 --- a/sys/netgraph/ng_eiface.c +++ b/sys/netgraph/ng_eiface.c @@ -40,7 +40,6 @@ #include <sys/syslog.h> #include <net/if.h> -#include <net/if_dl.h> #include <net/if_types.h> #include <net/netisr.h> @@ -418,27 +417,12 @@ ng_eiface_rcvmsg(node_p node, item_p item, hook_p lasthook) case NGM_EIFACE_SET: { - struct ether_addr *eaddr; - struct ifaddr *ifa; - struct sockaddr_dl *sdl; - - if (msg->header.arglen != sizeof(struct ether_addr)) { + if (msg->header.arglen != ETHER_ADDR_LEN) { error = EINVAL; break; } - eaddr = (struct ether_addr *)(msg->data); - bcopy(eaddr, IFP2ENADDR(priv->ifp), - ETHER_ADDR_LEN); - - /* And put it in the ifaddr list */ - TAILQ_FOREACH(ifa, &(ifp->if_addrhead), ifa_link) { - sdl = (struct sockaddr_dl *)ifa->ifa_addr; - if (sdl->sdl_type == IFT_ETHER) { - bcopy(IFP2ENADDR(ifp), - LLADDR(sdl), ifp->if_addrlen); - break; - } - } + error = if_setlladdr(priv->ifp, + (u_char *)msg->data, ETHER_ADDR_LEN); break; } |