Skip to contentSkip to conversation

IP_MULTICAST_IF getsockopt man part

DISCUSSION Jiri Pirko 3 participants 4 messages May 4, 2012 – May 6, 2015 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

Hi.

<quote>
IP_MULTICAST_IF (since Linux 1.2)
Set the local device for a multicast socket. Argument is an ip_mreqn or ip_mreq structure similar to IP_ADD_MEMBERSHIP.
</quote>

That is not true. Setsockopt recognizes only ip_mreqn and in_addr. I made patch which makes it recognize ip_mreq as well. So that would be probably ok.
http://patchwork.ozlabs.org/patch/156815/

On the other hand, getsockopt works only with in_addr. That I think is good behaviour but manpages here needs to be corrected in this way (read part needs to be added here)

Thanks!

Jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#1 lore raw
Quoted 9 lines · Jiri Pirko

Hi.

<quote>
IP_MULTICAST_IF (since Linux 1.2)
                     Set the local device for a multicast socket. Argument is an ip_mreqn or ip_mreq structure similar to IP_ADD_MEMBERSHIP. </quote>

Quoted 8 lines

That is not true. Setsockopt recognizes only ip_mreqn and in_addr. I made patch which makes it recognize ip_mreq as well. So that would be probably ok.
http://patchwork.ozlabs.org/patch/156815/

On the other hand, getsockopt works only with in_addr. That I think is good behaviour but manpages here needs to be corrected in this way (read part needs to be added here)

Jirka,

I'm having trouble to understand what you mean. Perhaps it would be simplest if you showed your proposed replacement text for the text quoted above.

Thanks,

Michael

Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/
author
#3 lore raw
In reply to a message not in the archive
Quoted 19 lines · Sat, May 05, 2012 at 01:57:35PM CEST, mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@publi…
Quoted 9 lines · Jiri Pirko

Hi.

<quote>
IP_MULTICAST_IF (since Linux 1.2)
                     Set the local device for a multicast socket. Argument is an ip_mreqn or ip_mreq structure similar to IP_ADD_MEMBERSHIP. </quote>

Quoted 8 lines

That is not true. Setsockopt recognizes only ip_mreqn and in_addr. I made patch which makes it recognize ip_mreq as well. So that would be probably ok.
http://patchwork.ozlabs.org/patch/156815/

On the other hand, getsockopt works only with in_addr. That I think is good behaviour but manpages here needs to be corrected in this way (read part needs to be added here)

Quoted 5 lines

Jirka,

I'm having trouble to understand what you mean. Perhaps it would be simplest if you showed your proposed replacement text for the text quoted above.

<orig>
IP_MULTICAST_IF (since Linux 1.2)
Set the local device for a multicast socket. Argument is an ip_mreqn or ip_mreq structure similar to IP_ADD_MEMBERSHIP. </orig>
<new>
IP_MULTICAST_IF (since Linux 1.2)
Set or read the local device for a multicast socket. Argument for set is an ip_mreqn or ip_mreq or addr_in structure. Argument for read is an addr_in structure.
</new>

Jirka

Quoted 11 lines

Thanks,

Michael

Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
In reply to a message not in the archive

[CC += Magnus, who made a related reported soon after yours.]

Jiri,

Quoted 26 lines · Jiri Pirko
Quoted 19 lines · Sat, May 05, 2012 at 01:57:35PM CEST, mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@publi…
Quoted 9 lines · Jiri Pirko

Hi.

<quote>
IP_MULTICAST_IF (since Linux 1.2)
Set the local device for a multicast socket. Argument is an ip_mreqn or ip_mreq structure similar to IP_ADD_MEMBERSHIP.
</quote>

Quoted 8 lines

That is not true. Setsockopt recognizes only ip_mreqn and in_addr. I made patch which makes it recognize ip_mreq as well. So that would be probably ok.
http://patchwork.ozlabs.org/patch/156815/

On the other hand, getsockopt works only with in_addr. That I think is good behaviour but manpages here needs to be corrected in this way (read part needs to be added here)

Quoted 5 lines

Jirka,

I'm having trouble to understand what you mean. Perhaps it would be simplest if you showed your proposed replacement text for the text quoted above.

Quoted 11 lines

<orig>
IP_MULTICAST_IF (since Linux 1.2)
Set the local device for a multicast socket. Argument is an ip_mreqn or ip_mreq structure similar to IP_ADD_MEMBERSHIP. </orig>
<new>
IP_MULTICAST_IF (since Linux 1.2)
Set or read the local device for a multicast socket. Argument for set is an ip_mreqn or ip_mreq or addr_in structure. Argument for read is an addr_in structure.
</new>

Long after the fact: I've amended the man page text to read:

IP_MULTICAST_IF (since Linux 1.2)
Set the local device for a multicast socket. The argu‐ ment 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.

Cheers,

Michael

Signature · 7 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html