[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [msmtp-users] Proxy support patch



>> http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml
>
> Zero really is reserved, as mentioned on that list, and has been
> assigned some special meaning under certain circumstances, so it really
> is not valid for SMTP (or any other typical network service). It's ok
> to disallow it. See man 3 socket: you cannot create a socket using port
> 0.

I tend to forget such things without verbose mention in POSIX, FreeBSD,
or Linux docs, particularly older bind pages, but find some references.
I think you can manually set sin_port zero in the sockaddr struct.
Then there are raw sockets.
The programming behaviour on systems appears to be a historically
useful bastardization of the actually available on the wire 16 bit
portrange of 0 through 65535. Anyways.

http://man7.org/linux/man-pages/man2/socket.2.html
http://man7.org/linux/man-pages/man2/bind.2.html
http://man7.org/linux/man-pages/man3/bindresvport.3.html
http://man7.org/linux/man-pages/man7/ip.7.html

http://www.freebsd.org/cgi/man.cgi?query=socket&sektion=2
http://www.freebsd.org/cgi/man.cgi?query=bind&sektion=2
http://www.freebsd.org/cgi/man.cgi?query=bindresvport&sektion=3
http://www.freebsd.org/cgi/man.cgi?query=ip&sektion=4

http://msdn.microsoft.com/en-us/library/windows/desktop/ms737550.aspx