diff options
Diffstat (limited to 'net/ipv6/raw.c')
-rw-r--r-- | net/ipv6/raw.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 343852e5c703..6f7824e1cea4 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -130,14 +130,14 @@ static mh_filter_t __rcu *mh_filter __read_mostly; | |||
130 | 130 | ||
131 | int rawv6_mh_filter_register(mh_filter_t filter) | 131 | int rawv6_mh_filter_register(mh_filter_t filter) |
132 | { | 132 | { |
133 | rcu_assign_pointer(mh_filter, filter); | 133 | RCU_INIT_POINTER(mh_filter, filter); |
134 | return 0; | 134 | return 0; |
135 | } | 135 | } |
136 | EXPORT_SYMBOL(rawv6_mh_filter_register); | 136 | EXPORT_SYMBOL(rawv6_mh_filter_register); |
137 | 137 | ||
138 | int rawv6_mh_filter_unregister(mh_filter_t filter) | 138 | int rawv6_mh_filter_unregister(mh_filter_t filter) |
139 | { | 139 | { |
140 | rcu_assign_pointer(mh_filter, NULL); | 140 | RCU_INIT_POINTER(mh_filter, NULL); |
141 | synchronize_rcu(); | 141 | synchronize_rcu(); |
142 | return 0; | 142 | return 0; |
143 | } | 143 | } |
@@ -372,9 +372,9 @@ void raw6_icmp_error(struct sk_buff *skb, int nexthdr, | |||
372 | read_unlock(&raw_v6_hashinfo.lock); | 372 | read_unlock(&raw_v6_hashinfo.lock); |
373 | } | 373 | } |
374 | 374 | ||
375 | static inline int rawv6_rcv_skb(struct sock * sk, struct sk_buff * skb) | 375 | static inline int rawv6_rcv_skb(struct sock *sk, struct sk_buff *skb) |
376 | { | 376 | { |
377 | if ((raw6_sk(sk)->checksum || rcu_dereference_raw(sk->sk_filter)) && | 377 | if ((raw6_sk(sk)->checksum || rcu_access_pointer(sk->sk_filter)) && |
378 | skb_checksum_complete(skb)) { | 378 | skb_checksum_complete(skb)) { |
379 | atomic_inc(&sk->sk_drops); | 379 | atomic_inc(&sk->sk_drops); |
380 | kfree_skb(skb); | 380 | kfree_skb(skb); |
@@ -542,8 +542,7 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6, | |||
542 | goto out; | 542 | goto out; |
543 | 543 | ||
544 | offset = rp->offset; | 544 | offset = rp->offset; |
545 | total_len = inet_sk(sk)->cork.base.length - (skb_network_header(skb) - | 545 | total_len = inet_sk(sk)->cork.base.length; |
546 | skb->data); | ||
547 | if (offset >= total_len - 1) { | 546 | if (offset >= total_len - 1) { |
548 | err = -EINVAL; | 547 | err = -EINVAL; |
549 | ip6_flush_pending_frames(sk); | 548 | ip6_flush_pending_frames(sk); |