Vlan id is set to 0 when TPACKET_V2 is used

前端 未结 1 1387
梦如初夏
梦如初夏 2021-01-21 16:53

I have a problem about the usage of this TPACKET_V2 .

My problem is that after setting of this type of packet on socket, when I try to receive some packets I can\'t rea

相关标签:
1条回答
  • 2021-01-21 17:54

    When the kernel removes the vlan it also changes eth_h.h_proto to the protocol after de vlan tag so ETH_P_8021Q == ntohs(frame->eth_h.h_proto) will most probably be false.

    Also, if you are listening in the tagged interface (ie. eth0.100) instead of the physical interface (eth0) you will not see the tags.

    0 讨论(0)
提交回复
热议问题