Skip to content

Commit

Permalink
netfilter: bridge: refactor conditional in br_nf_dev_queue_xmit
Browse files Browse the repository at this point in the history
simpilifies followup patch that re-works brnf ip_fragment handling.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Florian Westphal authored and Pablo Neira Ayuso committed Mar 9, 2015
1 parent 4a9d2f2 commit 7a8d831
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions net/bridge/br_netfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,13 +803,16 @@ static int br_nf_dev_queue_xmit(struct sk_buff *skb)
{
int ret;
int frag_max_size;
unsigned int mtu_reserved;

if (skb_is_gso(skb) || skb->protocol != htons(ETH_P_IP))
return br_dev_queue_push_xmit(skb);

mtu_reserved = nf_bridge_mtu_reduction(skb);
/* This is wrong! We should preserve the original fragment
* boundaries by preserving frag_list rather than refragmenting.
*/
if (skb->protocol == htons(ETH_P_IP) &&
skb->len + nf_bridge_mtu_reduction(skb) > skb->dev->mtu &&
!skb_is_gso(skb)) {
if (skb->len + mtu_reserved > skb->dev->mtu) {
frag_max_size = BR_INPUT_SKB_CB(skb)->frag_max_size;
if (br_parse_ip_options(skb))
/* Drop invalid packet */
Expand Down

0 comments on commit 7a8d831

Please sign in to comment.