Kunal Trivedi wrote:
> > As I read it, the parameters are changed so the network stack knows this
> > packet came from the bridge device rather than from the enslaved interface
> > and that it should be passed up to higher layers. The dev is changed to
> > br->dev, the packet_type is changed to PACKET_HOST which means the packet is
> > to us, and we set the ethernet protocol type.
>
> Yes, it sets skb->pkt_type = PACKET_HOST, but immediately it calls
> skb->protocol = eth_type_trans(skb, &br->dev), in eth_type_trans,
> if (*eth->h_dest&1) {
> /* if (memcmp()), otherwise MULTI */
> skb->pkt_type = PACKET_BROADCAST;
> }
>
> So, I am not sure, what happens exactly, b'coz there are 2 functions , get
> called skb_pull() (in eth.c::eth_type_trans) and skb_push() (in
> br_input.c::br_pass_frame_up). One of these functions, change skb->mac to
> 'bridge' device mac ?
That's because br_pass_frame_up is called from several spots (promisc, bcast, and
local). That way, if it's not a bcast packet, the pkt_type will survive as
PACKET_HOST. If it is bcast, it will be replaced with PACKET_BROADCAST. If it
got there because of promisc, pkt_type gets PACKET_OTHERHOST. Works all around
;-)
Best regards,
Adam Fineberg
_______________________________________________
Bridge mailing list
[EMAIL PROTECTED]
http://www.math.leidenuniv.nl/mailman/listinfo/bridge