linux-user: netlink: Add emulation of IP_MULTICAST_IF
authorHelge Deller <deller@gmx.de>
Sun, 19 Jan 2025 04:26:10 +0000 (05:26 +0100)
committerHelge Deller <deller@gmx.de>
Fri, 24 Jan 2025 12:58:40 +0000 (13:58 +0100)
commitf65464ce6d00fdec726dbd9f8c8c543c3feb2924
treeb7c4ff30f6c39ba6de03242eb83b5d75d7fd0dd5
parent017fc6620f2513c1d0217289c48be4c51e0167a7
linux-user: netlink: Add emulation of IP_MULTICAST_IF

Add IP_MULTICAST_IF and share the code with IP_ADD_MEMBERSHIP / IP_DROP_MEMBERSHIP.
Sharing the code makes sense, because the manpage of ip(7) says:

IP_MULTICAST_IF (since Linux 1.2)
      Set the local device for a multicast socket.  The argument
      for setsockopt(2) is an ip_mreqn or (since Linux 3.5)
      ip_mreq structure similar to IP_ADD_MEMBERSHIP, or an
      in_addr structure.  (The kernel determines which structure
      is being passed based on the size passed in optlen.)  For
      getsockopt(2), the argument is an in_addr structure.

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
linux-user/syscall.c