summaryrefslogtreecommitdiff
path: root/net/bridge/br_multicast.c
diff options
context:
space:
mode:
authorLinus Lüssing <linus.luessing@c0d3.blue>2015-05-02 14:01:06 +0200
committerDavid S. Miller <davem@davemloft.net>2015-05-04 14:49:22 -0400
commit3c9e4f870012350a36dc3091c7a57f5ba2799afe (patch)
tree3c3aa2220817bef55fafaf89f1be9e80e60e71d3 /net/bridge/br_multicast.c
parentc19ae86a510cf4332af64caab04718bc853d3184 (diff)
bridge: multicast: call skb_checksum_{simple_, }validate
Let's use these new, neat helpers. Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_multicast.c')
-rw-r--r--net/bridge/br_multicast.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 4b6722f8f179..b52f4cb8aee9 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1610,16 +1610,8 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
if (!pskb_may_pull(skb2, sizeof(*ih)))
goto out;
- switch (skb2->ip_summed) {
- case CHECKSUM_COMPLETE:
- if (!csum_fold(skb2->csum))
- break;
- /* fall through */
- case CHECKSUM_NONE:
- skb2->csum = 0;
- if (skb_checksum_complete(skb2))
- goto out;
- }
+ if (skb_checksum_simple_validate(skb2))
+ goto out;
err = 0;
@@ -1737,20 +1729,8 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
ip6h = ipv6_hdr(skb2);
- switch (skb2->ip_summed) {
- case CHECKSUM_COMPLETE:
- if (!csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr, skb2->len,
- IPPROTO_ICMPV6, skb2->csum))
- break;
- /*FALLTHROUGH*/
- case CHECKSUM_NONE:
- skb2->csum = ~csum_unfold(csum_ipv6_magic(&ip6h->saddr,
- &ip6h->daddr,
- skb2->len,
- IPPROTO_ICMPV6, 0));
- if (__skb_checksum_complete(skb2))
- goto out;
- }
+ if (skb_checksum_validate(skb2, IPPROTO_ICMPV6, ip6_compute_pseudo))
+ goto out;
err = 0;