Skip to content

Commit

Permalink
netfilter: bridge: really save frag_max_size between PRE and POST_ROU…
Browse files Browse the repository at this point in the history
…TING

commit 0b67c43 upstream.

We also need to save/store in forward, else br_parse_ip_options call
will zero frag_max_size as well.

Fixes: 93fdd47 ('bridge: Save frag_max_size between PRE_ROUTING and POST_ROUTING')
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Florian Westphal authored and Greg Kroah-Hartman committed May 6, 2015
1 parent fb2eb81 commit 2cb8874
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions net/bridge/br_netfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,13 @@ static int br_nf_forward_finish(struct sk_buff *skb)
struct net_device *in;

if (!IS_ARP(skb) && !IS_VLAN_ARP(skb)) {
int frag_max_size;

if (skb->protocol == htons(ETH_P_IP)) {
frag_max_size = IPCB(skb)->frag_max_size;
BR_INPUT_SKB_CB(skb)->frag_max_size = frag_max_size;
}

in = nf_bridge->physindev;
if (nf_bridge->mask & BRNF_PKT_TYPE) {
skb->pkt_type = PACKET_OTHERHOST;
Expand Down Expand Up @@ -710,8 +717,14 @@ static unsigned int br_nf_forward_ip(const struct nf_hook_ops *ops,
nf_bridge->mask |= BRNF_PKT_TYPE;
}

if (pf == NFPROTO_IPV4 && br_parse_ip_options(skb))
return NF_DROP;
if (pf == NFPROTO_IPV4) {
int frag_max = BR_INPUT_SKB_CB(skb)->frag_max_size;

if (br_parse_ip_options(skb))
return NF_DROP;

IPCB(skb)->frag_max_size = frag_max;
}

/* The physdev module checks on this */
nf_bridge->mask |= BRNF_BRIDGED;
Expand Down

0 comments on commit 2cb8874

Please sign in to comment.