Skip to content
Snippets Groups Projects
Commit b5ac520c authored by Adam Wujek's avatar Adam Wujek
Browse files

[BUG: #62] time-unix/unix-socket: bind socket to the interface


Signed-off-by: default avatarAdam Wujek <dev_public@wujek.eu>
parent 4d2c1841
No related branches found
No related tags found
No related merge requests found
......@@ -477,6 +477,13 @@ static int unix_open_ch_udp(struct pp_instance *ppi, char *ifname, int chtype)
&temp, sizeof(int)) < 0)
goto err_out;
/* Bind socket to a specific interface, otherwise a socket gets messages
* from all interfaces */
context = "setsockopt(SO_BINDTODEVICE)";
if (setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE,
(void *)&ifr, sizeof(ifr)) < 0)
goto err_out;
ppi->ch[chtype].fd = sock;
return 0;
......
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