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

Re: [msmtp-users] Proxy support patch



grarpamp wrote:
> >> 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.

You can. The OS chooses an available port for you in that case.


> Then there are raw sockets.
If you want to implement your own TCP stack on top of raw sockets, you
could do that...