Commit 77d574e7 authored by Bernhard Thaler's avatar Bernhard Thaler Committed by Pablo Neira Ayuso

netfilter: bridge: rename br_parse_ip_options

br_parse_ip_options() does not parse any IP options, it validates IP
packets as a whole and the function name is misleading.

Rename br_parse_ip_options() to br_validate_ipv4() and remove unneeded
commments.
Signed-off-by: default avatarBernhard Thaler <bernhard.thaler@wvnet.at>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 411ffb4f
...@@ -216,7 +216,7 @@ static inline void nf_bridge_pull_encap_header_rcsum(struct sk_buff *skb) ...@@ -216,7 +216,7 @@ static inline void nf_bridge_pull_encap_header_rcsum(struct sk_buff *skb)
* expected format * expected format
*/ */
static int br_parse_ip_options(struct sk_buff *skb) static int br_validate_ipv4(struct sk_buff *skb)
{ {
const struct iphdr *iph; const struct iphdr *iph;
struct net_device *dev = skb->dev; struct net_device *dev = skb->dev;
...@@ -692,7 +692,7 @@ static unsigned int br_nf_pre_routing(const struct nf_hook_ops *ops, ...@@ -692,7 +692,7 @@ static unsigned int br_nf_pre_routing(const struct nf_hook_ops *ops,
nf_bridge_pull_encap_header_rcsum(skb); nf_bridge_pull_encap_header_rcsum(skb);
if (br_parse_ip_options(skb)) if (br_validate_ipv4(skb))
return NF_DROP; return NF_DROP;
nf_bridge_put(skb->nf_bridge); nf_bridge_put(skb->nf_bridge);
...@@ -802,7 +802,7 @@ static unsigned int br_nf_forward_ip(const struct nf_hook_ops *ops, ...@@ -802,7 +802,7 @@ static unsigned int br_nf_forward_ip(const struct nf_hook_ops *ops,
} }
if (pf == NFPROTO_IPV4) { if (pf == NFPROTO_IPV4) {
if (br_parse_ip_options(skb)) if (br_validate_ipv4(skb))
return NF_DROP; return NF_DROP;
IPCB(skb)->frag_max_size = nf_bridge->frag_max_size; IPCB(skb)->frag_max_size = nf_bridge->frag_max_size;
} }
...@@ -913,8 +913,7 @@ static int br_nf_dev_queue_xmit(struct sock *sk, struct sk_buff *skb) ...@@ -913,8 +913,7 @@ static int br_nf_dev_queue_xmit(struct sock *sk, struct sk_buff *skb)
if (skb->len + mtu_reserved > skb->dev->mtu) { if (skb->len + mtu_reserved > skb->dev->mtu) {
struct brnf_frag_data *data; struct brnf_frag_data *data;
if (br_parse_ip_options(skb)) if (br_validate_ipv4(skb))
/* Drop invalid packet */
return NF_DROP; return NF_DROP;
IPCB(skb)->frag_max_size = nf_bridge->frag_max_size; IPCB(skb)->frag_max_size = nf_bridge->frag_max_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment