1 May 2003 17:48
[PATCH] change pkt_type to PACKET_HOST earlier
Bart De Schuymer <bdschuym <at> pandora.be>
2003-05-01 15:48:22 GMT
2003-05-01 15:48:22 GMT
Hello Stephen, When a frame arrives on a bridge port and the destination MAC address equals the bridge's address, then I believe the packet type should be set to PACKET_HOST immediately (this is standard behaviour of a network driver). Currently, if the address of the physical device belonging to the bridge port isn't the address used for the logical bridge, then the packet type will be PACKET_OTHERHOST. The current code does the change to PACKET_HOST for this case rather late: in br_pass_frame_up(). What I want is to be able to filter on PACKET_HOST in the ebtables PREROUTING chain. The patch below enables this. Note that when the destination address is that of a bridge port belonging to another logical bridge on the box, the patch below won't change the packet type this early. Also note that brouted frames are not affected by this patch. cheers, Bart --- linux-2.5.68/net/bridge/br_input.c.old Thu May 1 17:09:06 2003 +++ linux-2.5.68/net/bridge/br_input.c Thu May 1 17:22:24 2003 <at> <at> -143,6 +143,9 <at> <at> int br_handle_frame(struct sk_buff *skb) return -1; } + if (!memcmp(p->br->dev.dev_addr, dest, ETH_ALEN)) + skb->pkt_type = PACKET_HOST; + NF_HOOK(PF_BRIDGE, NF_BR_PRE_ROUTING, skb, skb->dev, NULL, br_handle_frame_finish);(Continue reading)

RSS Feed