diff options
author | melifaro <melifaro@FreeBSD.org> | 2014-01-18 23:24:51 +0000 |
---|---|---|
committer | melifaro <melifaro@FreeBSD.org> | 2014-01-18 23:24:51 +0000 |
commit | 881c9e28bfecd7527db2dc2584a7ab19e733c821 (patch) | |
tree | 27eae7c12b15b514ef9982e2268330a4e599db09 /sys/net/if_dl.h | |
parent | 978dfbc51760372d61ca97fcdc575a28649eba4d (diff) | |
download | FreeBSD-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_dl.h')
-rw-r--r-- | sys/net/if_dl.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/net/if_dl.h b/sys/net/if_dl.h index 64f4b56..8b4e007 100644 --- a/sys/net/if_dl.h +++ b/sys/net/if_dl.h @@ -69,6 +69,12 @@ struct sockaddr_dl { #define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen)) #define LLINDEX(s) ((s)->sdl_index) + +struct ifnet; +struct sockaddr_dl *link_alloc_sdl(size_t, int); +void link_free_sdl(struct sockaddr *sa); +struct sockaddr_dl *link_init_sdl(struct ifnet *, struct sockaddr *, u_char); + #ifndef _KERNEL #include <sys/cdefs.h> |