Hi All,
I've a few doubts w.r.t layer2-frame processing in linux and PACKET_ORIGDEV socket option for getting origdev info.
For example, 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). >>> (x) ifindex for each netdevice
I have created a RAW socket ( not binded to any interface) , attached with a socket filter to trap only interested packets.
I am getting a copy of frame trapped from each of the netdevice. is this expected?
frame trapped from eth0 will have from.sll_ifindex=1
frame trapped from bond0 will have from.sll_ifindex=2
frame trapped from bridge will have from.sll_ifindex=3
frame trapped from vlan100 will have from.sll_ifindex=4
If I set the following socket option PACKET_ORIGDEV , I get the following result
frame trapped from eth0 will have from.sll_ifindex=1
frame trapped from bond0 will have from.sll_ifindex=1
frame trapped from bridge will have from.sll_ifindex=3. >> why is this not set to 1 or 2?
frame trapped from vlan100 will have from.sll_ifindex=3
can someone help me understand the role played by PACKET_ORIGDEV socket option in the above scenario.