Both python 2 and 3 are missing some setsockopt values, for example in the code below:
They all come from /usr/include/netinet/in.h, but IP_MULTICAST_LOOP=11 is still in python, but IP_ADD_MEMBERSHIP=12 isn't.
Additionally, IPPROTO_DIVERT is also missing, so I have to use:
> import socket
> sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
> sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_VIF, 1)
> sock.setsockopt(socket.IPPROTO_IP, socket.IP_RSVP_ON, 1)
> sock.setsockopt(socket.IPPROTO_IP, socket.IP_PORTRANGE, 1)
> sock.setsockopt(socket.IPPROTO_IP, socket.IP_RECVIF, 1)
#define IP_MULTICAST_LOOP 11
#define IP_ADD_MEMBERSHIP 12
IPPROTO_DIVERT is not in.
but is this still relevant?
(In reply to w.schwarzenfeld from comment #1)
Yes, this can never become irrelevant. All network values from /usr/include/netinet/in.h need to be reflected in python (all versions).
The only reason this hasn't come up much is that there is not not much software that does low-level network operations. Or, porters might just patch in ad-hoc values because it is much easier.
But in the ideal world they should all be defined in python.
(#define IPPROTO_DIVERT 258 is also there)
Closing this PR, since it specifically only mentions lang/python34 which expired today.
Valid for all versions of python.