Lets assume below given is the set of net devices that my frame is intended to traverse over.
eth0(1) -> bond0(2) -> bridge(3) -> vlan100(4). >>> (number) is the ifindex for each netdevice
I have created a RAW socket ( not binded to any interface) , attached with a socket filter to trap only a specific set of packets.
I am getting a copy of frame trapped from each of the netdevice. Is this expected?
Printing from.sll_ifindex for each trapped packet.
frame trapped from eth0 has from.sll_ifindex=1 frame trapped from bond0 has from.sll_ifindex=2 frame trapped from bridge has from.sll_ifindex=3 frame trapped from vlan100 has from.sll_ifindex=4
Now I set the following socket option PACKET_ORIGDEV , I get the following result
frame trapped from eth0 has from.sll_ifindex=1 frame trapped from bond0 has from.sll_ifindex=1 >> acceptable since the originating device is eth0 whose ifindex is 1. frame trapped from bridge has from.sll_ifindex=3 >> why is this not set to 1? frame trapped from vlan100 has from.sll_ifindex=3 >> why is this not set to 1?
can someone help me understand the role played by PACKET_ORIGDEV socket option in the above scenario.