[3.7] closes bpo-25041: Document AF_PACKET socket address format. (GH-9207)
(cherry picked from commit 731ff68eeef58babdf2b32dc9a73b141760c2be9)
Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index f40bd89..eeade2e 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -1881,7 +1881,7 @@
const char *interfaceName;
int protoNumber;
int hatype = 0;
- int pkttype = 0;
+ int pkttype = PACKET_HOST;
Py_buffer haddr = {NULL, NULL};
if (!PyTuple_Check(args)) {
@@ -1912,7 +1912,7 @@
if (protoNumber < 0 || protoNumber > 0xffff) {
PyErr_SetString(
PyExc_OverflowError,
- "getsockaddrarg: protoNumber must be 0-65535.");
+ "getsockaddrarg: proto must be 0-65535.");
PyBuffer_Release(&haddr);
return 0;
}
@@ -2925,7 +2925,7 @@
\n\
Bind the socket to a local address. For IP sockets, the address is a\n\
pair (host, port); the host must refer to the local host. For raw packet\n\
-sockets the address is a tuple (ifname, proto [,pkttype [,hatype]])");
+sockets the address is a tuple (ifname, proto [,pkttype [,hatype [,addr]]])");
/* s.close() method.