summaryrefslogtreecommitdiffstats
path: root/sys/net/if_lagg.c
diff options
context:
space:
mode:
authormelifaro <melifaro@FreeBSD.org>2014-01-18 23:24:51 +0000
committermelifaro <melifaro@FreeBSD.org>2014-01-18 23:24:51 +0000
commit881c9e28bfecd7527db2dc2584a7ab19e733c821 (patch)
tree27eae7c12b15b514ef9982e2268330a4e599db09 /sys/net/if_lagg.c
parent978dfbc51760372d61ca97fcdc575a28649eba4d (diff)
downloadFreeBSD-src-881c9e28bfecd7527db2dc2584a7ab19e733c821.zip
FreeBSD-src-881c9e28bfecd7527db2dc2584a7ab19e733c821.tar.gz
Simplify filling sockaddr_dl structure for if_resolvemulti()
callback providers. link_init_sdl() function can be used to fill most of the parameters. Use caller stack instead of allocation / freing memory for each request. Do not drop support for extra-long (probably non-existing) link-layer protocols by introducing link_alloc_sdl() (used by if_resolvemulti() callback) and link_free_sdl() (used by caller). Since this change breaks KBI, MFC requires slightly different approach (link_init_sdl() auto-allocating buffer if necessary to handle cases with unmodified if_resolvemulti() callers). MFC after: 2 weeks
Diffstat (limited to 'sys/net/if_lagg.c')
-rw-r--r--sys/net/if_lagg.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index beae0b6..c900064 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -1214,12 +1214,8 @@ lagg_ether_cmdmulti(struct lagg_port *lp, int set)
LAGG_WLOCK_ASSERT(sc);
- bzero((char *)&sdl, sizeof(sdl));
- sdl.sdl_len = sizeof(sdl);
- sdl.sdl_family = AF_LINK;
- sdl.sdl_type = IFT_ETHER;
+ link_init_sdl(ifp, (struct sockaddr *)&sdl, IFT_ETHER);
sdl.sdl_alen = ETHER_ADDR_LEN;
- sdl.sdl_index = ifp->if_index;
if (set) {
TAILQ_FOREACH(ifma, &scifp->if_multiaddrs, ifma_link) {
OpenPOWER on IntegriCloud