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: bind() for netlink sockets
Type: Stage:
Components: Extension Modules Versions: Python 2.4
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: loewis, metsala
Priority: normal Keywords: patch

Created on 2005-12-15 09:23 by metsala, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
nl-bind-patch.txt metsala, 2005-12-15 09:23 Patch for bind for netlink sockets
Messages (2)
msg49203 - (view) Author: Timo Metsala (metsala) Date: 2005-12-15 09:23
Support for netlink sockets in Linux (AF_NETLINK)
doesn't currently include bind()ing to a local address.
The attached patch adds this functionality (local
address of a netlink socket consists of process id
and/or group bitmask).

Example use:

def get_bound_nl_sock(netlink_family):
    net_fd = socket.socket(socket.AF_NETLINK,
                           socket.SOCK_RAW,           
     
                           netlink_family)
        
    net_fd.bind((os.getpid(),0))
    return net_fd

Patch made against Python 2.4.2, tested in Linux
2.4.20-8 (Red Hat 9)
msg49204 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-01-14 18:29
Logged In: YES 
user_id=21627

This is outdated now, as #1103116 was applied.
History
Date User Action Args
2022-04-11 14:56:14adminsetgithub: 42695
2005-12-15 09:23:41metsalacreate