New submission from Martin Turon:

When binding to AF_PACKET linux kernel sockets, the interface name is not 
passed in when given -- it is always "".  This causes problems, for example, 
receiving packets to a "monitor0" interface doesn't work.

diff -r a6548e230ed6 Modules/socketmodule.c
--- a/Modules/socketmodule.c    Thu Oct 27 19:33:22 2016 +0300
+++ b/Modules/socketmodule.c    Thu Oct 27 11:13:12 2016 -0700
@@ -1344,6 +1344,7 @@
     {
         struct sockaddr_ll *a = (struct sockaddr_ll *)addr;
         char *ifname = "";
+        // ^^ ifname should be set to interface name passed in via sockaddr.
         struct ifreq ifr;
         /* need to look up interface name give index */
         if (a->sll_ifindex) {

----------
messages: 279558
nosy: mturon
priority: normal
severity: normal
status: open
title: socket.bind to AF_PACKET should use passed interface name

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28545>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to