mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-02 13:03:33 +00:00
ipa: Fix the compilation of ipaccess-find on FreeBSD
FreeBSD does not offer the SO_BINDTODEVICE option. The closest thing is the IP_RECVIF option and this is used here now.
This commit is contained in:
committed by
Holger Hans Peter Freyther
parent
b9f45987b3
commit
10bad1031e
@@ -41,8 +41,13 @@ static int udp_sock(const char *ifname)
|
|||||||
return fd;
|
return fd;
|
||||||
|
|
||||||
if (ifname) {
|
if (ifname) {
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
rc = setsockopt(fd, SOL_SOCKET, IP_RECVIF, ifname,
|
||||||
|
strlen(ifname));
|
||||||
|
#else
|
||||||
rc = setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, ifname,
|
rc = setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, ifname,
|
||||||
strlen(ifname));
|
strlen(ifname));
|
||||||
|
#endif
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user