windows - Recieving broadcast UDP in a specific interface in python -
i using following snippet listen incoming broadcast udp packets (dhcp) on windows computer 2 interfaces - lan , wlan.
import socket s = socket.socket(socket.af_inet, socket.sock_dgram) s.setsockopt(socket.sol_socket, socket.so_reuseaddr, 1) s.setsockopt(socket.sol_socket, socket.so_broadcast, 1) s.bind(('', 67)) s.recvfrom(1024)
i intersted in packets in lan (a laptop connected directly), i packets wlan (packets send real dhcp). assigned manually ip lan interface, , tried disable other interfaces (without restarting), socket doesn't receive broadcast packets in lan @ all.
this part of cross-platform python pxe server. (based on pypxe)
is there solution, or should try implement using raw socket?
Comments
Post a Comment