BSD: Workaround for direct routes on FreeBSD 13.0
FreeBSD 13.0 added some safechecks for syscalls, rejecting sockaddrs that are too small, later versions loosen up the check.
This commit is contained in:
parent
937ebf2536
commit
34ebc4e1ba
1 changed files with 4 additions and 0 deletions
|
@ -190,6 +190,10 @@ static inline void
|
||||||
sockaddr_fill_dl(struct sockaddr_dl *sa, struct iface *ifa)
|
sockaddr_fill_dl(struct sockaddr_dl *sa, struct iface *ifa)
|
||||||
{
|
{
|
||||||
uint len = OFFSETOF(struct sockaddr_dl, sdl_data);
|
uint len = OFFSETOF(struct sockaddr_dl, sdl_data);
|
||||||
|
|
||||||
|
/* Workaround for FreeBSD 13.0 */
|
||||||
|
len = MAX(len, sizeof(struct sockaddr));
|
||||||
|
|
||||||
memset(sa, 0, len);
|
memset(sa, 0, len);
|
||||||
sa->sdl_len = len;
|
sa->sdl_len = len;
|
||||||
sa->sdl_family = AF_LINK;
|
sa->sdl_family = AF_LINK;
|
||||||
|
|
Loading…
Reference in a new issue