diff options
Diffstat (limited to 'net/ipv6/ip6_flowlabel.c')
-rw-r--r-- | net/ipv6/ip6_flowlabel.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c index 7712578bdc66..6e7bffa2205e 100644 --- a/net/ipv6/ip6_flowlabel.c +++ b/net/ipv6/ip6_flowlabel.c | |||
@@ -67,7 +67,7 @@ static inline struct ip6_flowlabel *__fl_lookup(struct net *net, __be32 label) | |||
67 | struct ip6_flowlabel *fl; | 67 | struct ip6_flowlabel *fl; |
68 | 68 | ||
69 | for (fl=fl_ht[FL_HASH(label)]; fl; fl = fl->next) { | 69 | for (fl=fl_ht[FL_HASH(label)]; fl; fl = fl->next) { |
70 | if (fl->label == label && fl->fl_net == net) | 70 | if (fl->label == label && net_eq(fl->fl_net, net)) |
71 | return fl; | 71 | return fl; |
72 | } | 72 | } |
73 | return NULL; | 73 | return NULL; |
@@ -163,7 +163,8 @@ static void ip6_fl_purge(struct net *net) | |||
163 | struct ip6_flowlabel *fl, **flp; | 163 | struct ip6_flowlabel *fl, **flp; |
164 | flp = &fl_ht[i]; | 164 | flp = &fl_ht[i]; |
165 | while ((fl = *flp) != NULL) { | 165 | while ((fl = *flp) != NULL) { |
166 | if (fl->fl_net == net && atomic_read(&fl->users) == 0) { | 166 | if (net_eq(fl->fl_net, net) && |
167 | atomic_read(&fl->users) == 0) { | ||
167 | *flp = fl->next; | 168 | *flp = fl->next; |
168 | fl_free(fl); | 169 | fl_free(fl); |
169 | atomic_dec(&fl_size); | 170 | atomic_dec(&fl_size); |
@@ -377,8 +378,8 @@ fl_create(struct net *net, struct in6_flowlabel_req *freq, char __user *optval, | |||
377 | goto done; | 378 | goto done; |
378 | fl->share = freq->flr_share; | 379 | fl->share = freq->flr_share; |
379 | addr_type = ipv6_addr_type(&freq->flr_dst); | 380 | addr_type = ipv6_addr_type(&freq->flr_dst); |
380 | if ((addr_type&IPV6_ADDR_MAPPED) | 381 | if ((addr_type & IPV6_ADDR_MAPPED) || |
381 | || addr_type == IPV6_ADDR_ANY) { | 382 | addr_type == IPV6_ADDR_ANY) { |
382 | err = -EINVAL; | 383 | err = -EINVAL; |
383 | goto done; | 384 | goto done; |
384 | } | 385 | } |
@@ -421,8 +422,8 @@ static int mem_check(struct sock *sk) | |||
421 | 422 | ||
422 | if (room <= 0 || | 423 | if (room <= 0 || |
423 | ((count >= FL_MAX_PER_SOCK || | 424 | ((count >= FL_MAX_PER_SOCK || |
424 | (count > 0 && room < FL_MAX_SIZE/2) || room < FL_MAX_SIZE/4) | 425 | (count > 0 && room < FL_MAX_SIZE/2) || room < FL_MAX_SIZE/4) && |
425 | && !capable(CAP_NET_ADMIN))) | 426 | !capable(CAP_NET_ADMIN))) |
426 | return -ENOBUFS; | 427 | return -ENOBUFS; |
427 | 428 | ||
428 | return 0; | 429 | return 0; |
@@ -630,7 +631,7 @@ static struct ip6_flowlabel *ip6fl_get_first(struct seq_file *seq) | |||
630 | for (state->bucket = 0; state->bucket <= FL_HASH_MASK; ++state->bucket) { | 631 | for (state->bucket = 0; state->bucket <= FL_HASH_MASK; ++state->bucket) { |
631 | fl = fl_ht[state->bucket]; | 632 | fl = fl_ht[state->bucket]; |
632 | 633 | ||
633 | while (fl && fl->fl_net != net) | 634 | while (fl && !net_eq(fl->fl_net, net)) |
634 | fl = fl->next; | 635 | fl = fl->next; |
635 | if (fl) | 636 | if (fl) |
636 | break; | 637 | break; |
@@ -645,7 +646,7 @@ static struct ip6_flowlabel *ip6fl_get_next(struct seq_file *seq, struct ip6_flo | |||
645 | 646 | ||
646 | fl = fl->next; | 647 | fl = fl->next; |
647 | try_again: | 648 | try_again: |
648 | while (fl && fl->fl_net != net) | 649 | while (fl && !net_eq(fl->fl_net, net)) |
649 | fl = fl->next; | 650 | fl = fl->next; |
650 | 651 | ||
651 | while (!fl) { | 652 | while (!fl) { |