mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 14:34:22 +00:00
ldpd: add support for FreeBSD IP_BINDANY
Add yet another way to setsockopt a socket to listen to a foreign address. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
f6913418f3
commit
1ef00571f8
@ -268,9 +268,18 @@ sock_set_bindany(int fd, int enable)
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
|
#elif defined(IP_BINDANY)
|
||||||
|
frr_elevate_privs(&ldpd_privs) {
|
||||||
|
if (setsockopt(fd, IPPROTO_IP, IP_BINDANY, &enable, sizeof(int))
|
||||||
|
< 0) {
|
||||||
|
log_warn("%s: error setting IP_BINDANY", __func__);
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
log_warnx("%s: missing SO_BINDANY and IP_FREEBIND, unable to bind "
|
log_warnx(
|
||||||
"to a nonlocal IP address", __func__);
|
"%s: missing SO_BINDANY, IP_FREEBIND and IP_BINDANY, unable to bind to a nonlocal IP address",
|
||||||
|
__func__);
|
||||||
return (-1);
|
return (-1);
|
||||||
#endif /* HAVE_SO_BINDANY */
|
#endif /* HAVE_SO_BINDANY */
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user