[issue28545] socket.bind to AF_PACKET should use passed interface name

Martin Turon report at bugs.python.org
Thu Oct 27 14:43:42 EDT 2016


Martin Turon added the comment:

Just for clarity, the high level bug is that when binding to an interface using AF_PACKET, transmissions work, but receive does not:

    sock = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, ETH_P_IEEE802154)
    sock.bind(("monitor0", ETH_P_IEEE802154))

    sock.send(test_frame)   # transmission works fine
    pkt = sock.recv(127)    # never receives, though C test works fine

The same test written in C that calls ioctl(sockfd, SIOCGIFNAME, &ifr) to lookup ifindex for bind from ifname="monitor0" works fine.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28545>
_______________________________________


More information about the Python-bugs-list mailing list