I have a program that is supposed to listen to the same port on both IPv4 and IPv6 sockets. In the past, what it did, was basically: create new socket for IPv6, set option IPV6_V6ONLY to off, bind, listen; then create a new socket for IPv4, and also bind and listen. The first bind is either to a specific port, or to port 0 to let the system assign a port. The second bind uses the port that the first one used (i.e. what the system assigned).

With the latest kernel, this still works if listening to localhost ([::1]/127.0.0.1) only, but not when listening to [::]/0.0.0.0. In that case, the second bind gets a different port number assigned to it. Moreover, the second bind system call returns 1, which it is not supposed to do according to the manual. Bind is supposed to return 0 on success and -1 on error.

What is going on?  Is this a kernel bug, or is this the future?

Kernel is 6.0.16-300.fc37.x86_64, i.e. the latest Fedora 37 kernel.

--
Sjoerd Mullender
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to