Jukka Väisänen <vai...@vaizki.fi> added the comment:

Going to SO_REUSEPORT will fix the security issue and emitting a deprecation 
warning for default value invocation will catch the eyes of some maintainers 
but it will not prevent what caused me to catch this issue in the first place - 
starting two processes (with same UID) accidentally listening on the same UDP 
port (in my case it was port 5060 as a default SIP port).

Since there already is a reuse_port parameter to create_datagram_endpoint(), I 
assume the proposal is to set default value for reuse_addresss=False and 
reuse_port=True? But if reuse_address is explicitly set to True, are we going 
to just set SO_REUSEPORT instead and always leave SO_REUSEADDR unset? This 
would leave the reuse_address parameter completely useless and still allow 
accidental port reuse.

What if I really do want SO_REUSEADDR? Ok I can create a socket separately, 
call setsockopt() on it and pass it as the sock parameter to 
create_datagram_endpoint(). 

Maybe I'm not fully grasping the proposal.. or maybe we should just deprecate 
reuse_port from both create_datagram_endpoint() and create_server() + 
reuse_addr from create_datagram_endpoint()? 

This would leave the TCP create_server() with the reuse_addr parameter, 
defaulting reasonably to True. To use TCP/UDP SO_REUSEPORT or UDP SO_REUSEADDR, 
the docs would tell you to bake your own socket with socket.socket(). Those few 
(like me) who really need the functionality can survive without all-in-one 
convenience functions on asyncio.loop

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37228>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to