diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-07-13 16:33:16 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-07-13 16:54:23 +0200 |
commit | 37d204a120a49c83775f1b3a5deab1446398760d (patch) | |
tree | 87f48640487fa866f977452ae1f790195594664e /src | |
parent | bc43a62f4128348b52af50ae75c84ba772c17e29 (diff) |
socket: Add new OSMO_SOCK_F_NO_MCAST_ALL option
Using this option at socket creation, the caller can request disabling
the IP_MULTICAST_ALL socket option.
Change-Id: I5ab5de45c0b64ceb3636ea98245a23defa24ffd4
Diffstat (limited to 'src')
-rw-r--r-- | src/socket.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/socket.c b/src/socket.c index c7d081c3..ca50b6f4 100644 --- a/src/socket.c +++ b/src/socket.c @@ -132,6 +132,16 @@ static int osmo_sock_init_tail(int fd, uint16_t type, unsigned int flags) } } + if (flags & OSMO_SOCK_F_NO_MCAST_ALL) { + rc = osmo_sock_mcast_all_set(fd, false); + if (rc < 0) { + LOGP(DLGLOBAL, LOGL_ERROR, "unable to disable receive of all multicast: %s\n", + strerror(errno)); + /* do not abort here, as this is just an + * optional additional optimization that only + * exists on Linux only */ + } + } return 0; } |