diff options
author | glebius <glebius@FreeBSD.org> | 2005-02-12 19:19:29 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2005-02-12 19:19:29 +0000 |
commit | 774bd8c9a36fca52da8a71c0f82f88d7b1919d4b (patch) | |
tree | 6941f77cc8bee5e8f1b9bb26d48e600c7c437ea6 /sys/netgraph | |
parent | 0ff684beada0f9fecf69fab544a6cdf88a78366e (diff) | |
download | FreeBSD-src-774bd8c9a36fca52da8a71c0f82f88d7b1919d4b.zip FreeBSD-src-774bd8c9a36fca52da8a71c0f82f88d7b1919d4b.tar.gz |
- bzero sockaddr_dl
- use constant instead of number
Suggested by: ru
Diffstat (limited to 'sys/netgraph')
-rw-r--r-- | sys/netgraph/ng_ether.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c index cfa0976..30acdfa 100644 --- a/sys/netgraph/ng_ether.c +++ b/sys/netgraph/ng_ether.c @@ -516,12 +516,10 @@ ng_ether_rcvmsg(node_p node, item_p item, hook_p lasthook) error = EINVAL; break; } + bzero(&sa_dl, sizeof(struct sockaddr_dl)); sa_dl.sdl_len = sizeof(struct sockaddr_dl); sa_dl.sdl_family = AF_LINK; - sa_dl.sdl_index = 0; - sa_dl.sdl_nlen = 0; - sa_dl.sdl_alen = 6; - sa_dl.sdl_slen = 0; + sa_dl.sdl_alen = ETHER_ADDR_LEN; bcopy((void *)msg->data, LLADDR(&sa_dl), ETHER_ADDR_LEN); error = if_addmulti(priv->ifp, @@ -536,12 +534,10 @@ ng_ether_rcvmsg(node_p node, item_p item, hook_p lasthook) error = EINVAL; break; } + bzero(&sa_dl, sizeof(struct sockaddr_dl)); sa_dl.sdl_len = sizeof(struct sockaddr_dl); sa_dl.sdl_family = AF_LINK; - sa_dl.sdl_index = 0; - sa_dl.sdl_nlen = 0; - sa_dl.sdl_alen = 6; - sa_dl.sdl_slen = 0; + sa_dl.sdl_alen = ETHER_ADDR_LEN; bcopy((void *)msg->data, LLADDR(&sa_dl), ETHER_ADDR_LEN); error = if_delmulti(priv->ifp, |