netfilter: bridge: refactor conditional in br_nf_dev_queue_xmit
authorFlorian Westphal <fw@strlen.de>
Wed, 4 Mar 2015 23:52:36 +0000 (00:52 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 9 Mar 2015 12:22:58 +0000 (13:22 +0100)
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>
net/bridge/br_netfilter.c

index 5b3bceb3ee626c3b9156a9ca2a880c0473e60831..ef1fe281ca1100e03964ea5493251934cd8d9d45 100644 (file)
@@ -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 */