Skip to content
Snippets Groups Projects
Commit 34ebc4e1 authored by Ondřej Zajíček's avatar Ondřej Zajíček
Browse files

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.
parent 937ebf25
No related branches found
No related tags found
No related merge requests found
Pipeline #107368 failed
......@@ -190,6 +190,10 @@ static inline void
sockaddr_fill_dl(struct sockaddr_dl *sa, struct iface *ifa)
{
uint len = OFFSETOF(struct sockaddr_dl, sdl_data);
/* Workaround for FreeBSD 13.0 */
len = MAX(len, sizeof(struct sockaddr));
memset(sa, 0, len);
sa->sdl_len = len;
sa->sdl_family = AF_LINK;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment