0

I tried to receive broadcast packets on an interface that has no IPv4 address set.

The packets are visible via tcpdump. But the network stack seems to drop the packets before they can be received via a socket.

Is this possible without libpcap?

mwarning
  • 721
  • 5
  • 22
  • 2
    If the interface has no IP address, the TCP/IP stack will not use it. – Barmar Sep 11 '19 at 21:08
  • you might be able to do something using raw sockets, but libpcap will make it easier. – Barmar Sep 11 '19 at 21:09
  • Maybe [network interface promiscuous mode](https://duckduckgo.com/?q=network+interface+promiscuous+mode+c+program) and [How to properly put network interface into promiscuous mode on Linux](https://stackoverflow.com/q/41678219/608639). – jww Sep 11 '19 at 23:34
  • promiscuous mode seems to work. But I get the packets of all interfaces. SO_BINDTODEVICE does not seem to work. (I tried https://gist.github.com/austinmarton/2862515) – mwarning Sep 12 '19 at 13:08

0 Answers0