bridge: Avoid unnecessary clone on forward path

When the packet is delivered to the local bridge device we may
end up cloning it unnecessarily if no bridge port can receive
the packet in br_flood.

This patch avoids this by moving the skb_clone into br_flood.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Herbert Xu 2010-02-27 19:41:41 +00:00 committed by David S. Miller
parent 68b7c895be
commit b33084be19
3 changed files with 26 additions and 17 deletions

View file

@ -72,14 +72,11 @@ int br_handle_frame_finish(struct sk_buff *skb)
skb = NULL;
}
if (skb2 == skb)
skb2 = skb_clone(skb, GFP_ATOMIC);
if (skb) {
if (dst)
br_forward(dst->dst, skb);
else
br_flood_forward(br, skb);
br_flood_forward(br, skb, skb2);
}
if (skb2)