Benjamin Peterson added the comment:
Application code should pass the correct length of value.
--
resolution: - wont fix
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23127
Bertrand Janin added the comment:
Good point, I updated the diff with a better cast to avoid endianness issues
(tested on MIPS64) and added an OpenBSD #ifdef, is that more acceptable?
diff -r 88de50c1696b Modules/socketmodule.c
--- a/Modules/socketmodule.cSun Dec 28 18:51:25 2014 +0200
+++
Bertrand Janin added the comment:
I don't really need it in my own software, I was trying to use
https://github.com/SoCo/SoCo/ and couldn't get it working on OpenBSD. I'm sure
this is a portability problem on a number of library using Multicast. Do you
see something wrong with the patch?
Benjamin Peterson added the comment:
We don't really have a precedent for adjusting the size automatically when
integers are passed to setsockopt. Anyway, your patch will be wrong for
big-endian systems.
--
___
Python tracker rep...@bugs.python.org
New submission from Bertrand Janin:
Since I can't re-open issue 3372, I'm opening a new issue. socket.setsockopt()
still sets an optlen of '4' in the setsockopt() system call for options
IP_MULTICAST_TTL and IP_MULTICAST_LOOP. On OpenBSD, this causes the kernel to
hit an error condition and
Benjamin Peterson added the comment:
Just use the extended signature of the setsockopt:
mysocket.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL,
struct.pack(B, desired_ttl))
--
nosy: +benjamin.peterson
___
Python tracker