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.

classification
Title: AF_NETLINK sockets basic support
Type: Stage:
Components: Extension Modules Versions: Python 2.4
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: drphil, loewis
Priority: normal Keywords: patch

Created on 2005-01-15 22:23 by drphil, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
netlink_patch.diff drphil, 2006-01-14 17:05 netlink patch
Messages (4)
msg47554 - (view) Author: Philippe Biondi (drphil) Date: 2005-01-15 22:23
This patch adds everything needed to manipulate NETLINK
addresses so that it is possible to use NETLINK sockets.

Nothing is done in the patch for autoconf stuff, even
if the following should do the trick :

--- configure.in.ori    2005-01-10 17:09:32.000000000 +0100
+++ configure.in        2005-01-06 18:53:18.000000000 +0100
@@ -967,7 +967,7 @@
 sys/audioio.h sys/bsdtty.h sys/file.h sys/loadavg.h
sys/lock.h sys/mkdev.h \
 sys/modem.h \
 sys/param.h sys/poll.h sys/select.h sys/socket.h
sys/time.h sys/times.h \
-sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
+sys/un.h linux/netlink.h sys/utsname.h sys/wait.h
pty.h libutil.h \
 sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
 bluetooth/bluetooth.h)
 AC_HEADER_DIRENT
--- pyconfig.h.ori      2005-01-10 17:11:11.000000000 +0100
+++ pyconfig.h  2005-01-06 19:27:33.000000000 +0100
@@ -559,6 +559,9 @@
 /* Define to 1 if you have the <sys/un.h> header file. */
 #define HAVE_SYS_UN_H 1

+/* Define to 1 if you have the <linux/netlink.h>
header file. */
+#define HAVE_LINUX_NETLINK_H 1
+
 /* Define to 1 if you have the <sys/utsname.h> header
file. */
 #define HAVE_SYS_UTSNAME_H 1
msg47555 - (view) Author: Philippe Biondi (drphil) Date: 2005-01-16 00:28
Logged In: YES 
user_id=340305

This additionnal patch give a more correct use of
PyArg_ParseTuple

--- socketmodule.c.ori     2005-01-15 23:55:47.000000000 +0100
+++ socketmodule.c      2005-01-16 01:25:54.000000000 +0100
@@ -1106,7 +1106,7 @@
                                args->ob_type->tp_name);
                        return 0;
                }
-               if (!PyArg_ParseTuple(args, "II", &pid,
&groups))
+               if (!PyArg_ParseTuple(args,
"II:getsockaddrarg", &pid, &groups))
                        return 0;
                addr->nl_family = AF_NETLINK;
                addr->nl_pid = pid;
msg47556 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-01-12 06:23
Logged In: YES 
user_id=21627

There's no uploaded file!  You have to check the
checkbox labeled "Check to Upload & Attach File"
when you upload a file. In addition, even if you
*did* check this checkbox, a bug in SourceForge
prevents attaching a file when *creating* an issue.

Please try again.

(This is a SourceForge annoyance that we can do
nothing about. :-( )
msg47557 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-01-14 18:13
Logged In: YES 
user_id=21627

Thanks for the patch. Committed as 42046.
History
Date User Action Args
2022-04-11 14:56:09adminsetgithub: 41447
2005-01-15 22:23:27drphilcreate