How to initialize raw socket for VLAN sniffing

后端 未结 2 1671
难免孤独
难免孤独 2021-01-21 02:33

I\'m trying to create software that sniffes DHCP-offers from diffrent VLAN\'s and my problem is that the packets recv\'ed by me contains no VLAN-tags. I\'m using raw sockets, an

2条回答
  •  后悔当初
    2021-01-21 02:48

    If I understand the Linux code correctly, VLAN tags are stripped from packets' payload early and stored in a field that is not accessible through the raw sockets API. Instead, try to do what wireshark does, i.e., use the pcap API.

提交回复
热议问题