You can pass 0 instead of IPROTO_UDP as the socket protocol, because UDP is the default datagram protocol for the Internet. 8/
-
Show this thread
-
Port 0 is invalid. Upon creation, a UDP socket has the local address 0.0.0.0:0 and remote address 0.0.0.0:0. (Likewise with IPv6). 9/
1 reply 0 retweets 0 likesShow this thread -
getsockname(2) gives the local address and getpeername(2) gives the remote address. UDP sockets are unbounded and unremoted on creation. 10/
1 reply 0 retweets 0 likesShow this thread -
You can bind to a particular local address and port using bind(2), but you can only bind once. 11/
2 replies 0 retweets 0 likesShow this thread -
The address must be the address of any network interface, or the any address (0.0.0.0, ::) to say you are OK with whatever interface. 12/
2 replies 0 retweets 0 likesShow this thread -
Replying to @sortiecat
Something I learned recently: the ANY address is greedy. It will even match interfaces coming up *after* your socket is bound.
2 replies 0 retweets 1 like -
Replying to @laurentbercot @sortiecat
Um, that's kinda the whole point, & why software that refuses to bind 0.0.0.0, but insists on enumerating IFs & binding each, is so broken.
1 reply 0 retweets 2 likes -
Such software is unusable on DHCP (or in the distant past, on dialup). I actually had to patch out the idiocy in lots of sw back then.
2 replies 0 retweets 1 like -
Replying to @RichFelker @laurentbercot
I don't have so much experience with such software, a bit surprised, it's not portable/trivial to iterate addresses while 0.0.0.0 just works
1 reply 0 retweets 1 like -
Replying to @sortiecat @laurentbercot
This is software (and esp 1990s software). Why do anything the portable/trivial way when you have have 1000
#ifdefs?2 replies 0 retweets 0 likes
IIRC BIND was one of the big offenders.
-
-
Replying to @RichFelker @sortiecat
If only it were the only way in which BIND was a big offender.
0 replies 0 retweets 2 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.