Commit 3c9e4f87 authored by Linus Lüssing's avatar Linus Lüssing Committed by David S. Miller

bridge: multicast: call skb_checksum_{simple_, }validate

Let's use these new, neat helpers.
Signed-off-by: default avatarLinus Lüssing <linus.luessing@c0d3.blue>
Acked-by: default avatarStephen Hemminger <stephen@networkplumber.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c19ae86a
...@@ -1610,16 +1610,8 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br, ...@@ -1610,16 +1610,8 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
if (!pskb_may_pull(skb2, sizeof(*ih))) if (!pskb_may_pull(skb2, sizeof(*ih)))
goto out; goto out;
switch (skb2->ip_summed) { if (skb_checksum_simple_validate(skb2))
case CHECKSUM_COMPLETE: goto out;
if (!csum_fold(skb2->csum))
break;
/* fall through */
case CHECKSUM_NONE:
skb2->csum = 0;
if (skb_checksum_complete(skb2))
goto out;
}
err = 0; err = 0;
...@@ -1737,20 +1729,8 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br, ...@@ -1737,20 +1729,8 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
ip6h = ipv6_hdr(skb2); ip6h = ipv6_hdr(skb2);
switch (skb2->ip_summed) { if (skb_checksum_validate(skb2, IPPROTO_ICMPV6, ip6_compute_pseudo))
case CHECKSUM_COMPLETE: goto out;
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;
}
err = 0; err = 0;
......
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