Details
- Reviewers
tuexen melifaro - Group Reviewers
transport - Commits
- rGf96603b56f0f: tcp, udp: Permit binding with AF_UNSPEC if the address is INADDR_ANY
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Hmm. What about the corresponding case for IPv6 sockets? ttcp would still fail, since it also provides a sin_len of 0. I was expecting some fallout...
Do you know of any applications that depend on that? ttcp is IPv4-only.
sin_len is a funny case. bind(2), connect(2) and sendto(2) also have a socklen parameter. Our getsockaddr(), which is responsible for copying in sockaddrs from user memory, overwrites the sa_len with the length provided in that parameter. So the sin_len provided by userspace is effectively ignored, for better or worse.
No, I don't. Just prefer consistency, But if you prefer to add a special case only for IPv4, I'm fine.
sin_len is a funny case. bind(2), connect(2) and sendto(2) also have a socklen parameter. Our getsockaddr(), which is responsible for copying in sockaddrs from user memory, overwrites the sa_len with the length provided in that parameter. So the sin_len provided by userspace is effectively ignored, for better or worse.
Ahh, OK. I missed that. Then I'm fine.
Well, this way we are more consistent with other kernels. :)
Linux and OpenBSD are strict about checking sa_family == AF_INET6 so I think it is reasonable to do the same.
Hi Mark,
I'd personally like the approach D29519 . Is it desirable to have a dedicated sysctl variable to flag the compatible mode? The default value could be set to true.
I'm not sure. This is really a quite minor modification to D29519, I'd personally prefer not to add yet another sysctl for it. Maybe we should make this behaviour conditional on COMPAT_FREEBSD13 instead.