homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tamentis
Recipients gpolo, niallo, tamentis
Date 2014年12月29日.02:29:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1419820159.27.0.311177712639.issue3372@psf.upfronthosting.co.za>
In-reply-to
Content
This is still an issue as of OpenBSD 5.6. Here is an updated patch for the latest 2.7 branch:
diff -r 88de50c1696b Modules/socketmodule.c
--- a/Modules/socketmodule.c Sun Dec 28 18:51:25 2014 +0200
+++ b/Modules/socketmodule.c Sun Dec 28 21:24:41 2014 -0500
@@ -1881,24 +1881,29 @@
 {
 int level;
 int optname;
 int res;
 char *buf;
 int buflen;
 int flag;
 
 if (PyArg_ParseTuple(args, "iii:setsockopt",
 &level, &optname, &flag)) {
 buf = (char *) &flag;
 buflen = sizeof flag;
+ /* Multi cast options take shorter arguments */
+ if (optname == IP_MULTICAST_TTL
+ || optname == IP_MULTICAST_LOOP)
+ buflen = sizeof(u_char);
+ buf = (char *) &flag;
 }
 else {
 PyErr_Clear();
 if (!PyArg_ParseTuple(args, "iis#:setsockopt",
 &level, &optname, &buf, &buflen))
 return NULL;
 }
 res = setsockopt(s->sock_fd, level, optname, (void *)buf, buflen);
 if (res < 0)
 return s->errorhandler();
 Py_INCREF(Py_None);
 return Py_None;
History
Date User Action Args
2014年12月29日 02:29:19tamentissetrecipients: + tamentis, gpolo, niallo
2014年12月29日 02:29:19tamentissetmessageid: <1419820159.27.0.311177712639.issue3372@psf.upfronthosting.co.za>
2014年12月29日 02:29:19tamentislinkissue3372 messages
2014年12月29日 02:29:17tamentiscreate

AltStyle によって変換されたページ (->オリジナル) /