Skip to contentSkip to conversation

bridge netfilter question

Bridge Rajashekhar Mansanpally 2 participants 2 messages Dec 24, 2003 – Dec 25, 2003 Ethernet bridge

lore
Share & tools
lore
#0 lore raw

Hi,
I found this block of code in br_dev_queue_xmit() @ br_forward.c, after applying 'netfilter' patch for 2.4.21 kernel

Can someone explain what this block of code is doin?

#ifdef CONFIG_NETFILTER
        if (skb->nf_bridge)
                memcpy(skb->data - 16,

skb->nf_bridge->hh, 16);
#endif

1. What is 16 bytes here...? Ethernet hdr is just 14 bytes
2. Why the ethernet hdr is being overwritten with nf_bridge->hh? what is there in nf_bridge->hh? and when is nf_bridge is actually assigned this content.

-Raj

#1 lore raw
Quoted 8 lines · Rajashekhar Mansanpally
#ifdef CONFIG_NETFILTER
        if (skb->nf_bridge)
                memcpy(skb->data - 16,

skb->nf_bridge->hh, 16);
#endif

1. What is 16 bytes here...? Ethernet hdr is just 14 bytes

A memcpy of 16 bytes is faster.

Quoted 2 lines

2. Why the ethernet hdr is being overwritten with
nf_bridge->hh? what is there in nf_bridge->hh?

This is needed for refragmented UDP packets.

Quoted 1 line

when is nf_bridge is actually assigned this content.

See br_netfilter.c.

cheers,
Bart