aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorIan Morris <ipm@chirality.org.uk>2014-08-24 16:53:10 -0400
committerDavid S. Miller <davem@davemloft.net>2014-08-25 01:37:52 -0400
commit67ba4152e8b77eada6a9c64e3c2c84d6112794fc (patch)
tree833bd7925ed3b69ef65f759c3f806cdaa8643d00 /net
parenta9b0b2faa8ed299ca617a317e2abb9ea1bf0e733 (diff)
ipv6: White-space cleansing : Line Layouts
This patch makes no changes to the logic of the code but simply addresses coding style issues as detected by checkpatch. Both objdump and diff -w show no differences. A number of items are addressed in this patch: * Multiple spaces converted to tabs * Spaces before tabs removed. * Spaces in pointer typing cleansed (char *)foo etc. * Remove space after sizeof * Ensure spacing around comparators such as if statements. Signed-off-by: Ian Morris <ipm@chirality.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/addrconf.c12
-rw-r--r--net/ipv6/af_inet6.c12
-rw-r--r--net/ipv6/ah6.c16
-rw-r--r--net/ipv6/datagram.c8
-rw-r--r--net/ipv6/esp6.c8
-rw-r--r--net/ipv6/exthdrs.c2
-rw-r--r--net/ipv6/icmp.c10
-rw-r--r--net/ipv6/inet6_connection_sock.c2
-rw-r--r--net/ipv6/inet6_hashtables.c2
-rw-r--r--net/ipv6/ip6_flowlabel.c18
-rw-r--r--net/ipv6/ip6_icmp.c2
-rw-r--r--net/ipv6/ip6_input.c6
-rw-r--r--net/ipv6/ip6_offload.c2
-rw-r--r--net/ipv6/ip6_output.c20
-rw-r--r--net/ipv6/ip6_tunnel.c32
-rw-r--r--net/ipv6/ip6mr.c4
-rw-r--r--net/ipv6/ipv6_sockglue.c22
-rw-r--r--net/ipv6/mcast.c100
-rw-r--r--net/ipv6/ndisc.c16
-rw-r--r--net/ipv6/output_core.c2
-rw-r--r--net/ipv6/proc.c2
-rw-r--r--net/ipv6/raw.c8
-rw-r--r--net/ipv6/reassembly.c6
-rw-r--r--net/ipv6/route.c20
-rw-r--r--net/ipv6/sit.c12
-rw-r--r--net/ipv6/tunnel6.c2
-rw-r--r--net/ipv6/udp.c18
-rw-r--r--net/ipv6/xfrm6_input.c4
-rw-r--r--net/ipv6/xfrm6_policy.c22
-rw-r--r--net/ipv6/xfrm6_state.c14
-rw-r--r--net/ipv6/xfrm6_tunnel.c2
31 files changed, 203 insertions, 203 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 0b239fc1816e..267ce3caee24 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -180,7 +180,7 @@ static struct ipv6_devconf ipv6_devconf __read_mostly = {
180 .rtr_solicits = MAX_RTR_SOLICITATIONS, 180 .rtr_solicits = MAX_RTR_SOLICITATIONS,
181 .rtr_solicit_interval = RTR_SOLICITATION_INTERVAL, 181 .rtr_solicit_interval = RTR_SOLICITATION_INTERVAL,
182 .rtr_solicit_delay = MAX_RTR_SOLICITATION_DELAY, 182 .rtr_solicit_delay = MAX_RTR_SOLICITATION_DELAY,
183 .use_tempaddr = 0, 183 .use_tempaddr = 0,
184 .temp_valid_lft = TEMP_VALID_LIFETIME, 184 .temp_valid_lft = TEMP_VALID_LIFETIME,
185 .temp_prefered_lft = TEMP_PREFERRED_LIFETIME, 185 .temp_prefered_lft = TEMP_PREFERRED_LIFETIME,
186 .regen_max_retry = REGEN_MAX_RETRY, 186 .regen_max_retry = REGEN_MAX_RETRY,
@@ -1105,8 +1105,8 @@ retry:
1105 spin_unlock_bh(&ifp->lock); 1105 spin_unlock_bh(&ifp->lock);
1106 1106
1107 regen_advance = idev->cnf.regen_max_retry * 1107 regen_advance = idev->cnf.regen_max_retry *
1108 idev->cnf.dad_transmits * 1108 idev->cnf.dad_transmits *
1109 NEIGH_VAR(idev->nd_parms, RETRANS_TIME) / HZ; 1109 NEIGH_VAR(idev->nd_parms, RETRANS_TIME) / HZ;
1110 write_unlock_bh(&idev->lock); 1110 write_unlock_bh(&idev->lock);
1111 1111
1112 /* A temporary address is created only if this calculated Preferred 1112 /* A temporary address is created only if this calculated Preferred
@@ -3035,7 +3035,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)
3035 struct hlist_head *h = &inet6_addr_lst[i]; 3035 struct hlist_head *h = &inet6_addr_lst[i];
3036 3036
3037 spin_lock_bh(&addrconf_hash_lock); 3037 spin_lock_bh(&addrconf_hash_lock);
3038 restart: 3038restart:
3039 hlist_for_each_entry_rcu(ifa, h, addr_lst) { 3039 hlist_for_each_entry_rcu(ifa, h, addr_lst) {
3040 if (ifa->idev == idev) { 3040 if (ifa->idev == idev) {
3041 hlist_del_init_rcu(&ifa->addr_lst); 3041 hlist_del_init_rcu(&ifa->addr_lst);
@@ -3547,8 +3547,8 @@ static void __net_exit if6_proc_net_exit(struct net *net)
3547} 3547}
3548 3548
3549static struct pernet_operations if6_proc_net_ops = { 3549static struct pernet_operations if6_proc_net_ops = {
3550 .init = if6_proc_net_init, 3550 .init = if6_proc_net_init,
3551 .exit = if6_proc_net_exit, 3551 .exit = if6_proc_net_exit,
3552}; 3552};
3553 3553
3554int __init if6_proc_init(void) 3554int __init if6_proc_init(void)
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 2daa3a133e49..b9393e6a21fe 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -7,15 +7,15 @@
7 * 7 *
8 * Adapted from linux/net/ipv4/af_inet.c 8 * Adapted from linux/net/ipv4/af_inet.c
9 * 9 *
10 * Fixes: 10 * Fixes:
11 * piggy, Karl Knutson : Socket protocol table 11 * piggy, Karl Knutson : Socket protocol table
12 * Hideaki YOSHIFUJI : sin6_scope_id support 12 * Hideaki YOSHIFUJI : sin6_scope_id support
13 * Arnaldo Melo : check proc_net_create return, cleanups 13 * Arnaldo Melo : check proc_net_create return, cleanups
14 * 14 *
15 * This program is free software; you can redistribute it and/or 15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License 16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 17 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version. 18 * 2 of the License, or (at your option) any later version.
19 */ 19 */
20 20
21#define pr_fmt(fmt) "IPv6: " fmt 21#define pr_fmt(fmt) "IPv6: " fmt
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 72a4930bdc0a..ac71d9e0a500 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -17,10 +17,10 @@
17 * Authors 17 * Authors
18 * 18 *
19 * Mitsuru KANDA @USAGI : IPv6 Support 19 * Mitsuru KANDA @USAGI : IPv6 Support
20 * Kazunori MIYAZAWA @USAGI : 20 * Kazunori MIYAZAWA @USAGI :
21 * Kunihiro Ishiguro <kunihiro@ipinfusion.com> 21 * Kunihiro Ishiguro <kunihiro@ipinfusion.com>
22 * 22 *
23 * This file is derived from net/ipv4/ah.c. 23 * This file is derived from net/ipv4/ah.c.
24 */ 24 */
25 25
26#define pr_fmt(fmt) "IPv6: " fmt 26#define pr_fmt(fmt) "IPv6: " fmt
@@ -284,7 +284,7 @@ static int ipv6_clear_mutable_options(struct ipv6hdr *iph, int len, int dir)
284 ipv6_rearrange_rthdr(iph, exthdr.rth); 284 ipv6_rearrange_rthdr(iph, exthdr.rth);
285 break; 285 break;
286 286
287 default : 287 default:
288 return 0; 288 return 0;
289 } 289 }
290 290
@@ -478,7 +478,7 @@ static void ah6_input_done(struct crypto_async_request *base, int err)
478 auth_data = ah_tmp_auth(work_iph, hdr_len); 478 auth_data = ah_tmp_auth(work_iph, hdr_len);
479 icv = ah_tmp_icv(ahp->ahash, auth_data, ahp->icv_trunc_len); 479 icv = ah_tmp_icv(ahp->ahash, auth_data, ahp->icv_trunc_len);
480 480
481 err = memcmp(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG: 0; 481 err = memcmp(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG : 0;
482 if (err) 482 if (err)
483 goto out; 483 goto out;
484 484
@@ -622,7 +622,7 @@ static int ah6_input(struct xfrm_state *x, struct sk_buff *skb)
622 goto out_free; 622 goto out_free;
623 } 623 }
624 624
625 err = memcmp(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG: 0; 625 err = memcmp(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG : 0;
626 if (err) 626 if (err)
627 goto out_free; 627 goto out_free;
628 628
@@ -647,8 +647,8 @@ static int ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
647 u8 type, u8 code, int offset, __be32 info) 647 u8 type, u8 code, int offset, __be32 info)
648{ 648{
649 struct net *net = dev_net(skb->dev); 649 struct net *net = dev_net(skb->dev);
650 struct ipv6hdr *iph = (struct ipv6hdr*)skb->data; 650 struct ipv6hdr *iph = (struct ipv6hdr *)skb->data;
651 struct ip_auth_hdr *ah = (struct ip_auth_hdr*)(skb->data+offset); 651 struct ip_auth_hdr *ah = (struct ip_auth_hdr *)(skb->data+offset);
652 struct xfrm_state *x; 652 struct xfrm_state *x;
653 653
654 if (type != ICMPV6_PKT_TOOBIG && 654 if (type != ICMPV6_PKT_TOOBIG &&
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 2753319524f1..1844e874a350 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -43,13 +43,13 @@ static bool ipv6_mapped_addr_any(const struct in6_addr *a)
43int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) 43int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
44{ 44{
45 struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr; 45 struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr;
46 struct inet_sock *inet = inet_sk(sk); 46 struct inet_sock *inet = inet_sk(sk);
47 struct ipv6_pinfo *np = inet6_sk(sk); 47 struct ipv6_pinfo *np = inet6_sk(sk);
48 struct in6_addr *daddr, *final_p, final; 48 struct in6_addr *daddr, *final_p, final;
49 struct dst_entry *dst; 49 struct dst_entry *dst;
50 struct flowi6 fl6; 50 struct flowi6 fl6;
51 struct ip6_flowlabel *flowlabel = NULL; 51 struct ip6_flowlabel *flowlabel = NULL;
52 struct ipv6_txoptions *opt; 52 struct ipv6_txoptions *opt;
53 int addr_type; 53 int addr_type;
54 int err; 54 int err;
55 55
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index d15da1377149..7b6e830ebc6d 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -17,10 +17,10 @@
17 * Authors 17 * Authors
18 * 18 *
19 * Mitsuru KANDA @USAGI : IPv6 Support 19 * Mitsuru KANDA @USAGI : IPv6 Support
20 * Kazunori MIYAZAWA @USAGI : 20 * Kazunori MIYAZAWA @USAGI :
21 * Kunihiro Ishiguro <kunihiro@ipinfusion.com> 21 * Kunihiro Ishiguro <kunihiro@ipinfusion.com>
22 * 22 *
23 * This file is derived from net/ipv4/esp.c 23 * This file is derived from net/ipv4/esp.c
24 */ 24 */
25 25
26#define pr_fmt(fmt) "IPv6: " fmt 26#define pr_fmt(fmt) "IPv6: " fmt
@@ -598,7 +598,7 @@ static int esp6_init_state(struct xfrm_state *x)
598 case XFRM_MODE_BEET: 598 case XFRM_MODE_BEET:
599 if (x->sel.family != AF_INET6) 599 if (x->sel.family != AF_INET6)
600 x->props.header_len += IPV4_BEET_PHMAXLEN + 600 x->props.header_len += IPV4_BEET_PHMAXLEN +
601 (sizeof(struct ipv6hdr) - sizeof(struct iphdr)); 601 (sizeof(struct ipv6hdr) - sizeof(struct iphdr));
602 break; 602 break;
603 case XFRM_MODE_TRANSPORT: 603 case XFRM_MODE_TRANSPORT:
604 break; 604 break;
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 8d67900aa003..bfde361b6134 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -142,7 +142,7 @@ static bool ip6_parse_tlv(const struct tlvtype_proc *procs, struct sk_buff *skb)
142 default: /* Other TLV code so scan list */ 142 default: /* Other TLV code so scan list */
143 if (optlen > len) 143 if (optlen > len)
144 goto bad; 144 goto bad;
145 for (curr=procs; curr->type >= 0; curr++) { 145 for (curr = procs; curr->type >= 0; curr++) {
146 if (curr->type == nh[off]) { 146 if (curr->type == nh[off]) {
147 /* type specific length/alignment 147 /* type specific length/alignment
148 checks will be performed in the 148 checks will be performed in the
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 06ba3e58320b..394bb824fe4b 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -503,7 +503,7 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
503 msg.type = type; 503 msg.type = type;
504 504
505 len = skb->len - msg.offset; 505 len = skb->len - msg.offset;
506 len = min_t(unsigned int, len, IPV6_MIN_MTU - sizeof(struct ipv6hdr) -sizeof(struct icmp6hdr)); 506 len = min_t(unsigned int, len, IPV6_MIN_MTU - sizeof(struct ipv6hdr) - sizeof(struct icmp6hdr));
507 if (len < 0) { 507 if (len < 0) {
508 LIMIT_NETDEBUG(KERN_DEBUG "icmp: len problem\n"); 508 LIMIT_NETDEBUG(KERN_DEBUG "icmp: len problem\n");
509 goto out_dst_release; 509 goto out_dst_release;
@@ -636,7 +636,7 @@ void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info)
636 /* now skip over extension headers */ 636 /* now skip over extension headers */
637 inner_offset = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), 637 inner_offset = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr),
638 &nexthdr, &frag_off); 638 &nexthdr, &frag_off);
639 if (inner_offset<0) 639 if (inner_offset < 0)
640 goto out; 640 goto out;
641 } else { 641 } else {
642 inner_offset = sizeof(struct ipv6hdr); 642 inner_offset = sizeof(struct ipv6hdr);
@@ -808,7 +808,7 @@ void icmpv6_flow_init(struct sock *sk, struct flowi6 *fl6,
808 memset(fl6, 0, sizeof(*fl6)); 808 memset(fl6, 0, sizeof(*fl6));
809 fl6->saddr = *saddr; 809 fl6->saddr = *saddr;
810 fl6->daddr = *daddr; 810 fl6->daddr = *daddr;
811 fl6->flowi6_proto = IPPROTO_ICMPV6; 811 fl6->flowi6_proto = IPPROTO_ICMPV6;
812 fl6->fl6_icmp_type = type; 812 fl6->fl6_icmp_type = type;
813 fl6->fl6_icmp_code = 0; 813 fl6->fl6_icmp_code = 0;
814 fl6->flowi6_oif = oif; 814 fl6->flowi6_oif = oif;
@@ -875,8 +875,8 @@ static void __net_exit icmpv6_sk_exit(struct net *net)
875} 875}
876 876
877static struct pernet_operations icmpv6_sk_ops = { 877static struct pernet_operations icmpv6_sk_ops = {
878 .init = icmpv6_sk_init, 878 .init = icmpv6_sk_init,
879 .exit = icmpv6_sk_exit, 879 .exit = icmpv6_sk_exit,
880}; 880};
881 881
882int __init icmpv6_init(void) 882int __init icmpv6_init(void)
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index a245e5ddffbd..8c33a0b52b64 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -163,7 +163,7 @@ void inet6_csk_reqsk_queue_hash_add(struct sock *sk,
163 163
164EXPORT_SYMBOL_GPL(inet6_csk_reqsk_queue_hash_add); 164EXPORT_SYMBOL_GPL(inet6_csk_reqsk_queue_hash_add);
165 165
166void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr) 166void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr)
167{ 167{
168 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) uaddr; 168 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) uaddr;
169 169
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c
index 826019008958..5f7927c06f18 100644
--- a/net/ipv6/inet6_hashtables.c
+++ b/net/ipv6/inet6_hashtables.c
@@ -6,7 +6,7 @@
6 * Generic INET6 transport hashtables 6 * Generic INET6 transport hashtables
7 * 7 *
8 * Authors: Lotsa people, from code originally in tcp, generalised here 8 * Authors: Lotsa people, from code originally in tcp, generalised here
9 * by Arnaldo Carvalho de Melo <acme@mandriva.com> 9 * by Arnaldo Carvalho de Melo <acme@mandriva.com>
10 * 10 *
11 * This program is free software; you can redistribute it and/or 11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License 12 * modify it under the terms of the GNU General Public License
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index 4052694c6f2c..2ace4749bef4 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -136,7 +136,7 @@ static void ip6_fl_gc(unsigned long dummy)
136 136
137 spin_lock(&ip6_fl_lock); 137 spin_lock(&ip6_fl_lock);
138 138
139 for (i=0; i<=FL_HASH_MASK; i++) { 139 for (i = 0; i <= FL_HASH_MASK; i++) {
140 struct ip6_flowlabel *fl; 140 struct ip6_flowlabel *fl;
141 struct ip6_flowlabel __rcu **flp; 141 struct ip6_flowlabel __rcu **flp;
142 142
@@ -239,7 +239,7 @@ static struct ip6_flowlabel *fl_intern(struct net *net,
239 239
240/* Socket flowlabel lists */ 240/* Socket flowlabel lists */
241 241
242struct ip6_flowlabel * fl6_sock_lookup(struct sock *sk, __be32 label) 242struct ip6_flowlabel *fl6_sock_lookup(struct sock *sk, __be32 label)
243{ 243{
244 struct ipv6_fl_socklist *sfl; 244 struct ipv6_fl_socklist *sfl;
245 struct ipv6_pinfo *np = inet6_sk(sk); 245 struct ipv6_pinfo *np = inet6_sk(sk);
@@ -293,11 +293,11 @@ void fl6_free_socklist(struct sock *sk)
293 following rthdr. 293 following rthdr.
294 */ 294 */
295 295
296struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions * opt_space, 296struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions *opt_space,
297 struct ip6_flowlabel * fl, 297 struct ip6_flowlabel *fl,
298 struct ipv6_txoptions * fopt) 298 struct ipv6_txoptions *fopt)
299{ 299{
300 struct ipv6_txoptions * fl_opt = fl->opt; 300 struct ipv6_txoptions *fl_opt = fl->opt;
301 301
302 if (fopt == NULL || fopt->opt_flen == 0) 302 if (fopt == NULL || fopt->opt_flen == 0)
303 return fl_opt; 303 return fl_opt;
@@ -388,7 +388,7 @@ fl_create(struct net *net, struct sock *sk, struct in6_flowlabel_req *freq,
388 goto done; 388 goto done;
389 389
390 msg.msg_controllen = olen; 390 msg.msg_controllen = olen;
391 msg.msg_control = (void*)(fl->opt+1); 391 msg.msg_control = (void *)(fl->opt+1);
392 memset(&flowi6, 0, sizeof(flowi6)); 392 memset(&flowi6, 0, sizeof(flowi6));
393 393
394 err = ip6_datagram_send_ctl(net, sk, &msg, &flowi6, fl->opt, 394 err = ip6_datagram_send_ctl(net, sk, &msg, &flowi6, fl->opt,
@@ -517,7 +517,7 @@ int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen)
517 struct net *net = sock_net(sk); 517 struct net *net = sock_net(sk);
518 struct ipv6_pinfo *np = inet6_sk(sk); 518 struct ipv6_pinfo *np = inet6_sk(sk);
519 struct in6_flowlabel_req freq; 519 struct in6_flowlabel_req freq;
520 struct ipv6_fl_socklist *sfl1=NULL; 520 struct ipv6_fl_socklist *sfl1 = NULL;
521 struct ipv6_fl_socklist *sfl; 521 struct ipv6_fl_socklist *sfl;
522 struct ipv6_fl_socklist __rcu **sflp; 522 struct ipv6_fl_socklist __rcu **sflp;
523 struct ip6_flowlabel *fl, *fl1 = NULL; 523 struct ip6_flowlabel *fl, *fl1 = NULL;
@@ -542,7 +542,7 @@ int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen)
542 } 542 }
543 spin_lock_bh(&ip6_sk_fl_lock); 543 spin_lock_bh(&ip6_sk_fl_lock);
544 for (sflp = &np->ipv6_fl_list; 544 for (sflp = &np->ipv6_fl_list;
545 (sfl = rcu_dereference(*sflp))!=NULL; 545 (sfl = rcu_dereference(*sflp)) != NULL;
546 sflp = &sfl->next) { 546 sflp = &sfl->next) {
547 if (sfl->fl->label == freq.flr_label) { 547 if (sfl->fl->label == freq.flr_label) {
548 if (freq.flr_label == (np->flow_label&IPV6_FLOWLABEL_MASK)) 548 if (freq.flr_label == (np->flow_label&IPV6_FLOWLABEL_MASK))
diff --git a/net/ipv6/ip6_icmp.c b/net/ipv6/ip6_icmp.c
index 4578e23834f7..14dacc544c3e 100644
--- a/net/ipv6/ip6_icmp.c
+++ b/net/ipv6/ip6_icmp.c
@@ -13,7 +13,7 @@ static ip6_icmp_send_t __rcu *ip6_icmp_send;
13int inet6_register_icmp_sender(ip6_icmp_send_t *fn) 13int inet6_register_icmp_sender(ip6_icmp_send_t *fn)
14{ 14{
15 return (cmpxchg((ip6_icmp_send_t **)&ip6_icmp_send, NULL, fn) == NULL) ? 15 return (cmpxchg((ip6_icmp_send_t **)&ip6_icmp_send, NULL, fn) == NULL) ?
16 0 : -EBUSY; 16 0 : -EBUSY;
17} 17}
18EXPORT_SYMBOL(inet6_register_icmp_sender); 18EXPORT_SYMBOL(inet6_register_icmp_sender);
19 19
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index 51d54dc376f3..a3084ab5df6c 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -15,8 +15,8 @@
15 */ 15 */
16/* Changes 16/* Changes
17 * 17 *
18 * Mitsuru KANDA @USAGI and 18 * Mitsuru KANDA @USAGI and
19 * YOSHIFUJI Hideaki @USAGI: Remove ipv6_parse_exthdrs(). 19 * YOSHIFUJI Hideaki @USAGI: Remove ipv6_parse_exthdrs().
20 */ 20 */
21 21
22#include <linux/errno.h> 22#include <linux/errno.h>
@@ -65,7 +65,7 @@ int ip6_rcv_finish(struct sk_buff *skb)
65int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev) 65int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
66{ 66{
67 const struct ipv6hdr *hdr; 67 const struct ipv6hdr *hdr;
68 u32 pkt_len; 68 u32 pkt_len;
69 struct inet6_dev *idev; 69 struct inet6_dev *idev;
70 struct net *net = dev_net(skb->dev); 70 struct net *net = dev_net(skb->dev);
71 71
diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c
index 65eda2a8af48..5bcda338bcef 100644
--- a/net/ipv6/ip6_offload.c
+++ b/net/ipv6/ip6_offload.c
@@ -244,7 +244,7 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head,
244 continue; 244 continue;
245 245
246 iph2 = (struct ipv6hdr *)(p->data + off); 246 iph2 = (struct ipv6hdr *)(p->data + off);
247 first_word = *(__be32 *)iph ^ *(__be32 *)iph2 ; 247 first_word = *(__be32 *)iph ^ *(__be32 *)iph2;
248 248
249 /* All fields must match except length and Traffic Class. 249 /* All fields must match except length and Traffic Class.
250 * XXX skbs on the gro_list have all been parsed and pulled 250 * XXX skbs on the gro_list have all been parsed and pulled
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 315a55d66079..4ead5547b5c6 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -20,7 +20,7 @@
20 * etc. 20 * etc.
21 * 21 *
22 * H. von Brand : Added missing #include <linux/string.h> 22 * H. von Brand : Added missing #include <linux/string.h>
23 * Imran Patel : frag id should be in NBO 23 * Imran Patel : frag id should be in NBO
24 * Kazunori MIYAZAWA @USAGI 24 * Kazunori MIYAZAWA @USAGI
25 * : add ip6_append_data and related functions 25 * : add ip6_append_data and related functions
26 * for datagram xmit 26 * for datagram xmit
@@ -555,14 +555,14 @@ static void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
555int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) 555int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
556{ 556{
557 struct sk_buff *frag; 557 struct sk_buff *frag;
558 struct rt6_info *rt = (struct rt6_info*)skb_dst(skb); 558 struct rt6_info *rt = (struct rt6_info *)skb_dst(skb);
559 struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL; 559 struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL;
560 struct ipv6hdr *tmp_hdr; 560 struct ipv6hdr *tmp_hdr;
561 struct frag_hdr *fh; 561 struct frag_hdr *fh;
562 unsigned int mtu, hlen, left, len; 562 unsigned int mtu, hlen, left, len;
563 int hroom, troom; 563 int hroom, troom;
564 __be32 frag_id = 0; 564 __be32 frag_id = 0;
565 int ptr, offset = 0, err=0; 565 int ptr, offset = 0, err = 0;
566 u8 *prevhdr, nexthdr = 0; 566 u8 *prevhdr, nexthdr = 0;
567 struct net *net = dev_net(skb_dst(skb)->dev); 567 struct net *net = dev_net(skb_dst(skb)->dev);
568 568
@@ -637,7 +637,7 @@ int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
637 } 637 }
638 638
639 __skb_pull(skb, hlen); 639 __skb_pull(skb, hlen);
640 fh = (struct frag_hdr*)__skb_push(skb, sizeof(struct frag_hdr)); 640 fh = (struct frag_hdr *)__skb_push(skb, sizeof(struct frag_hdr));
641 __skb_push(skb, hlen); 641 __skb_push(skb, hlen);
642 skb_reset_network_header(skb); 642 skb_reset_network_header(skb);
643 memcpy(skb_network_header(skb), tmp_hdr, hlen); 643 memcpy(skb_network_header(skb), tmp_hdr, hlen);
@@ -662,7 +662,7 @@ int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
662 if (frag) { 662 if (frag) {
663 frag->ip_summed = CHECKSUM_NONE; 663 frag->ip_summed = CHECKSUM_NONE;
664 skb_reset_transport_header(frag); 664 skb_reset_transport_header(frag);
665 fh = (struct frag_hdr*)__skb_push(frag, sizeof(struct frag_hdr)); 665 fh = (struct frag_hdr *)__skb_push(frag, sizeof(struct frag_hdr));
666 __skb_push(frag, hlen); 666 __skb_push(frag, hlen);
667 skb_reset_network_header(frag); 667 skb_reset_network_header(frag);
668 memcpy(skb_network_header(frag), tmp_hdr, 668 memcpy(skb_network_header(frag), tmp_hdr,
@@ -681,7 +681,7 @@ int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
681 } 681 }
682 682
683 err = output(skb); 683 err = output(skb);
684 if(!err) 684 if (!err)
685 IP6_INC_STATS(net, ip6_dst_idev(&rt->dst), 685 IP6_INC_STATS(net, ip6_dst_idev(&rt->dst),
686 IPSTATS_MIB_FRAGCREATES); 686 IPSTATS_MIB_FRAGCREATES);
687 687
@@ -742,7 +742,7 @@ slow_path:
742 /* 742 /*
743 * Keep copying data until we run out. 743 * Keep copying data until we run out.
744 */ 744 */
745 while(left > 0) { 745 while (left > 0) {
746 len = left; 746 len = left;
747 /* IF: it doesn't fit, use 'mtu' - the data space left */ 747 /* IF: it doesn't fit, use 'mtu' - the data space left */
748 if (len > mtu) 748 if (len > mtu)
@@ -865,7 +865,7 @@ static struct dst_entry *ip6_sk_dst_check(struct sock *sk,
865 /* Yes, checking route validity in not connected 865 /* Yes, checking route validity in not connected
866 * case is not very simple. Take into account, 866 * case is not very simple. Take into account,
867 * that we do not support routing by source, TOS, 867 * that we do not support routing by source, TOS,
868 * and MSG_DONTROUTE --ANK (980726) 868 * and MSG_DONTROUTE --ANK (980726)
869 * 869 *
870 * 1. ip6_rt_check(): If route was host route, 870 * 1. ip6_rt_check(): If route was host route,
871 * check that cached destination is current. 871 * check that cached destination is current.
@@ -1049,7 +1049,7 @@ static inline int ip6_ufo_append_data(struct sock *sk,
1049 int getfrag(void *from, char *to, int offset, int len, 1049 int getfrag(void *from, char *to, int offset, int len,
1050 int odd, struct sk_buff *skb), 1050 int odd, struct sk_buff *skb),
1051 void *from, int length, int hh_len, int fragheaderlen, 1051 void *from, int length, int hh_len, int fragheaderlen,
1052 int transhdrlen, int mtu,unsigned int flags, 1052 int transhdrlen, int mtu, unsigned int flags,
1053 struct rt6_info *rt) 1053 struct rt6_info *rt)
1054 1054
1055{ 1055{
@@ -1072,7 +1072,7 @@ static inline int ip6_ufo_append_data(struct sock *sk,
1072 skb_reserve(skb, hh_len); 1072 skb_reserve(skb, hh_len);
1073 1073
1074 /* create space for UDP/IP header */ 1074 /* create space for UDP/IP header */
1075 skb_put(skb,fragheaderlen + transhdrlen); 1075 skb_put(skb, fragheaderlen + transhdrlen);
1076 1076
1077 /* initialize network header pointer */ 1077 /* initialize network header pointer */
1078 skb_reset_network_header(skb); 1078 skb_reset_network_header(skb);
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index f9de5a695072..e01bd0399297 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -408,12 +408,12 @@ __u16 ip6_tnl_parse_tlv_enc_lim(struct sk_buff *skb, __u8 *raw)
408{ 408{
409 const struct ipv6hdr *ipv6h = (const struct ipv6hdr *) raw; 409 const struct ipv6hdr *ipv6h = (const struct ipv6hdr *) raw;
410 __u8 nexthdr = ipv6h->nexthdr; 410 __u8 nexthdr = ipv6h->nexthdr;
411 __u16 off = sizeof (*ipv6h); 411 __u16 off = sizeof(*ipv6h);
412 412
413 while (ipv6_ext_hdr(nexthdr) && nexthdr != NEXTHDR_NONE) { 413 while (ipv6_ext_hdr(nexthdr) && nexthdr != NEXTHDR_NONE) {
414 __u16 optlen = 0; 414 __u16 optlen = 0;
415 struct ipv6_opt_hdr *hdr; 415 struct ipv6_opt_hdr *hdr;
416 if (raw + off + sizeof (*hdr) > skb->data && 416 if (raw + off + sizeof(*hdr) > skb->data &&
417 !pskb_may_pull(skb, raw - skb->data + off + sizeof (*hdr))) 417 !pskb_may_pull(skb, raw - skb->data + off + sizeof (*hdr)))
418 break; 418 break;
419 419
@@ -530,7 +530,7 @@ ip6_tnl_err(struct sk_buff *skb, __u8 ipproto, struct inet6_skb_parm *opt,
530 mtu = IPV6_MIN_MTU; 530 mtu = IPV6_MIN_MTU;
531 t->dev->mtu = mtu; 531 t->dev->mtu = mtu;
532 532
533 if ((len = sizeof (*ipv6h) + ntohs(ipv6h->payload_len)) > mtu) { 533 if ((len = sizeof(*ipv6h) + ntohs(ipv6h->payload_len)) > mtu) {
534 rel_type = ICMPV6_PKT_TOOBIG; 534 rel_type = ICMPV6_PKT_TOOBIG;
535 rel_code = 0; 535 rel_code = 0;
536 rel_info = mtu; 536 rel_info = mtu;
@@ -991,7 +991,7 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
991 t->parms.name); 991 t->parms.name);
992 goto tx_err_dst_release; 992 goto tx_err_dst_release;
993 } 993 }
994 mtu = dst_mtu(dst) - sizeof (*ipv6h); 994 mtu = dst_mtu(dst) - sizeof(*ipv6h);
995 if (encap_limit >= 0) { 995 if (encap_limit >= 0) {
996 max_headroom += 8; 996 max_headroom += 8;
997 mtu -= 8; 997 mtu -= 8;
@@ -1083,7 +1083,7 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
1083 if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) 1083 if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT))
1084 encap_limit = t->parms.encap_limit; 1084 encap_limit = t->parms.encap_limit;
1085 1085
1086 memcpy(&fl6, &t->fl.u.ip6, sizeof (fl6)); 1086 memcpy(&fl6, &t->fl.u.ip6, sizeof(fl6));
1087 fl6.flowi6_proto = IPPROTO_IPIP; 1087 fl6.flowi6_proto = IPPROTO_IPIP;
1088 1088
1089 dsfield = ipv4_get_dsfield(iph); 1089 dsfield = ipv4_get_dsfield(iph);
@@ -1135,7 +1135,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
1135 } else if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) 1135 } else if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT))
1136 encap_limit = t->parms.encap_limit; 1136 encap_limit = t->parms.encap_limit;
1137 1137
1138 memcpy(&fl6, &t->fl.u.ip6, sizeof (fl6)); 1138 memcpy(&fl6, &t->fl.u.ip6, sizeof(fl6));
1139 fl6.flowi6_proto = IPPROTO_IPV6; 1139 fl6.flowi6_proto = IPPROTO_IPV6;
1140 1140
1141 dsfield = ipv6_get_dsfield(ipv6h); 1141 dsfield = ipv6_get_dsfield(ipv6h);
@@ -1229,11 +1229,11 @@ static void ip6_tnl_link_config(struct ip6_tnl *t)
1229 1229
1230 if (rt->dst.dev) { 1230 if (rt->dst.dev) {
1231 dev->hard_header_len = rt->dst.dev->hard_header_len + 1231 dev->hard_header_len = rt->dst.dev->hard_header_len +
1232 sizeof (struct ipv6hdr); 1232 sizeof(struct ipv6hdr);
1233 1233
1234 dev->mtu = rt->dst.dev->mtu - sizeof (struct ipv6hdr); 1234 dev->mtu = rt->dst.dev->mtu - sizeof(struct ipv6hdr);
1235 if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) 1235 if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT))
1236 dev->mtu-=8; 1236 dev->mtu -= 8;
1237 1237
1238 if (dev->mtu < IPV6_MIN_MTU) 1238 if (dev->mtu < IPV6_MIN_MTU)
1239 dev->mtu = IPV6_MIN_MTU; 1239 dev->mtu = IPV6_MIN_MTU;
@@ -1350,7 +1350,7 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1350 switch (cmd) { 1350 switch (cmd) {
1351 case SIOCGETTUNNEL: 1351 case SIOCGETTUNNEL:
1352 if (dev == ip6n->fb_tnl_dev) { 1352 if (dev == ip6n->fb_tnl_dev) {
1353 if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof (p))) { 1353 if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof(p))) {
1354 err = -EFAULT; 1354 err = -EFAULT;
1355 break; 1355 break;
1356 } 1356 }
@@ -1362,7 +1362,7 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1362 memset(&p, 0, sizeof(p)); 1362 memset(&p, 0, sizeof(p));
1363 } 1363 }
1364 ip6_tnl_parm_to_user(&p, &t->parms); 1364 ip6_tnl_parm_to_user(&p, &t->parms);
1365 if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof (p))) { 1365 if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof(p))) {
1366 err = -EFAULT; 1366 err = -EFAULT;
1367 } 1367 }
1368 break; 1368 break;
@@ -1372,7 +1372,7 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1372 if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) 1372 if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
1373 break; 1373 break;
1374 err = -EFAULT; 1374 err = -EFAULT;
1375 if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof (p))) 1375 if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof(p)))
1376 break; 1376 break;
1377 err = -EINVAL; 1377 err = -EINVAL;
1378 if (p.proto != IPPROTO_IPV6 && p.proto != IPPROTO_IPIP && 1378 if (p.proto != IPPROTO_IPV6 && p.proto != IPPROTO_IPIP &&
@@ -1407,7 +1407,7 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1407 1407
1408 if (dev == ip6n->fb_tnl_dev) { 1408 if (dev == ip6n->fb_tnl_dev) {
1409 err = -EFAULT; 1409 err = -EFAULT;
1410 if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof (p))) 1410 if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof(p)))
1411 break; 1411 break;
1412 err = -ENOENT; 1412 err = -ENOENT;
1413 ip6_tnl_parm_from_user(&p1, &p); 1413 ip6_tnl_parm_from_user(&p1, &p);
@@ -1482,11 +1482,11 @@ static void ip6_tnl_dev_setup(struct net_device *dev)
1482 dev->destructor = ip6_dev_free; 1482 dev->destructor = ip6_dev_free;
1483 1483
1484 dev->type = ARPHRD_TUNNEL6; 1484 dev->type = ARPHRD_TUNNEL6;
1485 dev->hard_header_len = LL_MAX_HEADER + sizeof (struct ipv6hdr); 1485 dev->hard_header_len = LL_MAX_HEADER + sizeof(struct ipv6hdr);
1486 dev->mtu = ETH_DATA_LEN - sizeof (struct ipv6hdr); 1486 dev->mtu = ETH_DATA_LEN - sizeof(struct ipv6hdr);
1487 t = netdev_priv(dev); 1487 t = netdev_priv(dev);
1488 if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) 1488 if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT))
1489 dev->mtu-=8; 1489 dev->mtu -= 8;
1490 dev->flags |= IFF_NOARP; 1490 dev->flags |= IFF_NOARP;
1491 dev->addr_len = sizeof(struct in6_addr); 1491 dev->addr_len = sizeof(struct in6_addr);
1492 dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; 1492 dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index f9a3fd320d1d..0171f08325c3 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -845,7 +845,7 @@ static void ip6mr_destroy_unres(struct mr6_table *mrt, struct mfc6_cache *c)
845 845
846 atomic_dec(&mrt->cache_resolve_queue_len); 846 atomic_dec(&mrt->cache_resolve_queue_len);
847 847
848 while((skb = skb_dequeue(&c->mfc_un.unres.unresolved)) != NULL) { 848 while ((skb = skb_dequeue(&c->mfc_un.unres.unresolved)) != NULL) {
849 if (ipv6_hdr(skb)->version == 0) { 849 if (ipv6_hdr(skb)->version == 0) {
850 struct nlmsghdr *nlh = (struct nlmsghdr *)skb_pull(skb, sizeof(struct ipv6hdr)); 850 struct nlmsghdr *nlh = (struct nlmsghdr *)skb_pull(skb, sizeof(struct ipv6hdr));
851 nlh->nlmsg_type = NLMSG_ERROR; 851 nlh->nlmsg_type = NLMSG_ERROR;
@@ -1103,7 +1103,7 @@ static void ip6mr_cache_resolve(struct net *net, struct mr6_table *mrt,
1103 * Play the pending entries through our router 1103 * Play the pending entries through our router
1104 */ 1104 */
1105 1105
1106 while((skb = __skb_dequeue(&uc->mfc_un.unres.unresolved))) { 1106 while ((skb = __skb_dequeue(&uc->mfc_un.unres.unresolved))) {
1107 if (ipv6_hdr(skb)->version == 0) { 1107 if (ipv6_hdr(skb)->version == 0) {
1108 struct nlmsghdr *nlh = (struct nlmsghdr *)skb_pull(skb, sizeof(struct ipv6hdr)); 1108 struct nlmsghdr *nlh = (struct nlmsghdr *)skb_pull(skb, sizeof(struct ipv6hdr));
1109 1109
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 0c289982796d..64177efe5cca 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -66,12 +66,12 @@ int ip6_ra_control(struct sock *sk, int sel)
66 if (sk->sk_type != SOCK_RAW || inet_sk(sk)->inet_num != IPPROTO_RAW) 66 if (sk->sk_type != SOCK_RAW || inet_sk(sk)->inet_num != IPPROTO_RAW)
67 return -ENOPROTOOPT; 67 return -ENOPROTOOPT;
68 68
69 new_ra = (sel>=0) ? kmalloc(sizeof(*new_ra), GFP_KERNEL) : NULL; 69 new_ra = (sel >= 0) ? kmalloc(sizeof(*new_ra), GFP_KERNEL) : NULL;
70 70
71 write_lock_bh(&ip6_ra_lock); 71 write_lock_bh(&ip6_ra_lock);
72 for (rap = &ip6_ra_chain; (ra=*rap) != NULL; rap = &ra->next) { 72 for (rap = &ip6_ra_chain; (ra = *rap) != NULL; rap = &ra->next) {
73 if (ra->sk == sk) { 73 if (ra->sk == sk) {
74 if (sel>=0) { 74 if (sel >= 0) {
75 write_unlock_bh(&ip6_ra_lock); 75 write_unlock_bh(&ip6_ra_lock);
76 kfree(new_ra); 76 kfree(new_ra);
77 return -EADDRINUSE; 77 return -EADDRINUSE;
@@ -130,7 +130,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
130 int retv = -ENOPROTOOPT; 130 int retv = -ENOPROTOOPT;
131 131
132 if (optval == NULL) 132 if (optval == NULL)
133 val=0; 133 val = 0;
134 else { 134 else {
135 if (optlen >= sizeof(int)) { 135 if (optlen >= sizeof(int)) {
136 if (get_user(val, (int __user *) optval)) 136 if (get_user(val, (int __user *) optval))
@@ -139,7 +139,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
139 val = 0; 139 val = 0;
140 } 140 }
141 141
142 valbool = (val!=0); 142 valbool = (val != 0);
143 143
144 if (ip6_mroute_opt(optname)) 144 if (ip6_mroute_opt(optname))
145 return ip6_mroute_setsockopt(sk, optname, optval, optlen); 145 return ip6_mroute_setsockopt(sk, optname, optval, optlen);
@@ -474,7 +474,7 @@ sticky_done:
474 goto done; 474 goto done;
475 475
476 msg.msg_controllen = optlen; 476 msg.msg_controllen = optlen;
477 msg.msg_control = (void*)(opt+1); 477 msg.msg_control = (void *)(opt+1);
478 478
479 retv = ip6_datagram_send_ctl(net, sk, &msg, &fl6, opt, &junk, 479 retv = ip6_datagram_send_ctl(net, sk, &msg, &fl6, opt, &junk,
480 &junk, &junk); 480 &junk, &junk);
@@ -687,7 +687,7 @@ done:
687 retv = -ENOBUFS; 687 retv = -ENOBUFS;
688 break; 688 break;
689 } 689 }
690 gsf = kmalloc(optlen,GFP_KERNEL); 690 gsf = kmalloc(optlen, GFP_KERNEL);
691 if (!gsf) { 691 if (!gsf) {
692 retv = -ENOBUFS; 692 retv = -ENOBUFS;
693 break; 693 break;
@@ -921,7 +921,7 @@ static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_txoptions *opt,
921 if (!opt) 921 if (!opt)
922 return 0; 922 return 0;
923 923
924 switch(optname) { 924 switch (optname) {
925 case IPV6_HOPOPTS: 925 case IPV6_HOPOPTS:
926 hdr = opt->hopopt; 926 hdr = opt->hopopt;
927 break; 927 break;
@@ -1284,9 +1284,9 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
1284 return -ENOPROTOOPT; 1284 return -ENOPROTOOPT;
1285 } 1285 }
1286 len = min_t(unsigned int, sizeof(int), len); 1286 len = min_t(unsigned int, sizeof(int), len);
1287 if(put_user(len, optlen)) 1287 if (put_user(len, optlen))
1288 return -EFAULT; 1288 return -EFAULT;
1289 if(copy_to_user(optval,&val,len)) 1289 if (copy_to_user(optval, &val, len))
1290 return -EFAULT; 1290 return -EFAULT;
1291 return 0; 1291 return 0;
1292} 1292}
@@ -1299,7 +1299,7 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname,
1299 if (level == SOL_IP && sk->sk_type != SOCK_RAW) 1299 if (level == SOL_IP && sk->sk_type != SOCK_RAW)
1300 return udp_prot.getsockopt(sk, level, optname, optval, optlen); 1300 return udp_prot.getsockopt(sk, level, optname, optval, optlen);
1301 1301
1302 if(level != SOL_IPV6) 1302 if (level != SOL_IPV6)
1303 return -ENOPROTOOPT; 1303 return -ENOPROTOOPT;
1304 1304
1305 err = do_ipv6_getsockopt(sk, level, optname, optval, optlen, 0); 1305 err = do_ipv6_getsockopt(sk, level, optname, optval, optlen, 0);
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 617f0958e164..70881795da96 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -232,7 +232,7 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex, const struct in6_addr *addr)
232 spin_lock(&ipv6_sk_mc_lock); 232 spin_lock(&ipv6_sk_mc_lock);
233 for (lnk = &np->ipv6_mc_list; 233 for (lnk = &np->ipv6_mc_list;
234 (mc_lst = rcu_dereference_protected(*lnk, 234 (mc_lst = rcu_dereference_protected(*lnk,
235 lockdep_is_held(&ipv6_sk_mc_lock))) !=NULL ; 235 lockdep_is_held(&ipv6_sk_mc_lock))) != NULL;
236 lnk = &mc_lst->next) { 236 lnk = &mc_lst->next) {
237 if ((ifindex == 0 || mc_lst->ifindex == ifindex) && 237 if ((ifindex == 0 || mc_lst->ifindex == ifindex) &&
238 ipv6_addr_equal(&mc_lst->addr, addr)) { 238 ipv6_addr_equal(&mc_lst->addr, addr)) {
@@ -390,7 +390,7 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
390 if (!psl) 390 if (!psl)
391 goto done; /* err = -EADDRNOTAVAIL */ 391 goto done; /* err = -EADDRNOTAVAIL */
392 rv = !0; 392 rv = !0;
393 for (i=0; i<psl->sl_count; i++) { 393 for (i = 0; i < psl->sl_count; i++) {
394 rv = !ipv6_addr_equal(&psl->sl_addr[i], source); 394 rv = !ipv6_addr_equal(&psl->sl_addr[i], source);
395 if (rv == 0) 395 if (rv == 0)
396 break; 396 break;
@@ -407,7 +407,7 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
407 /* update the interface filter */ 407 /* update the interface filter */
408 ip6_mc_del_src(idev, group, omode, 1, source, 1); 408 ip6_mc_del_src(idev, group, omode, 1, source, 1);
409 409
410 for (j=i+1; j<psl->sl_count; j++) 410 for (j = i+1; j < psl->sl_count; j++)
411 psl->sl_addr[j-1] = psl->sl_addr[j]; 411 psl->sl_addr[j-1] = psl->sl_addr[j];
412 psl->sl_count--; 412 psl->sl_count--;
413 err = 0; 413 err = 0;
@@ -433,19 +433,19 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
433 newpsl->sl_max = count; 433 newpsl->sl_max = count;
434 newpsl->sl_count = count - IP6_SFBLOCK; 434 newpsl->sl_count = count - IP6_SFBLOCK;
435 if (psl) { 435 if (psl) {
436 for (i=0; i<psl->sl_count; i++) 436 for (i = 0; i < psl->sl_count; i++)
437 newpsl->sl_addr[i] = psl->sl_addr[i]; 437 newpsl->sl_addr[i] = psl->sl_addr[i];
438 sock_kfree_s(sk, psl, IP6_SFLSIZE(psl->sl_max)); 438 sock_kfree_s(sk, psl, IP6_SFLSIZE(psl->sl_max));
439 } 439 }
440 pmc->sflist = psl = newpsl; 440 pmc->sflist = psl = newpsl;
441 } 441 }
442 rv = 1; /* > 0 for insert logic below if sl_count is 0 */ 442 rv = 1; /* > 0 for insert logic below if sl_count is 0 */
443 for (i=0; i<psl->sl_count; i++) { 443 for (i = 0; i < psl->sl_count; i++) {
444 rv = !ipv6_addr_equal(&psl->sl_addr[i], source); 444 rv = !ipv6_addr_equal(&psl->sl_addr[i], source);
445 if (rv == 0) /* There is an error in the address. */ 445 if (rv == 0) /* There is an error in the address. */
446 goto done; 446 goto done;
447 } 447 }
448 for (j=psl->sl_count-1; j>=i; j--) 448 for (j = psl->sl_count-1; j >= i; j--)
449 psl->sl_addr[j+1] = psl->sl_addr[j]; 449 psl->sl_addr[j+1] = psl->sl_addr[j];
450 psl->sl_addr[i] = *source; 450 psl->sl_addr[i] = *source;
451 psl->sl_count++; 451 psl->sl_count++;
@@ -514,7 +514,7 @@ int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf)
514 goto done; 514 goto done;
515 } 515 }
516 newpsl->sl_max = newpsl->sl_count = gsf->gf_numsrc; 516 newpsl->sl_max = newpsl->sl_count = gsf->gf_numsrc;
517 for (i=0; i<newpsl->sl_count; ++i) { 517 for (i = 0; i < newpsl->sl_count; ++i) {
518 struct sockaddr_in6 *psin6; 518 struct sockaddr_in6 *psin6;
519 519
520 psin6 = (struct sockaddr_in6 *)&gsf->gf_slist[i]; 520 psin6 = (struct sockaddr_in6 *)&gsf->gf_slist[i];
@@ -606,7 +606,7 @@ int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
606 * on ipv6_sk_mc_lock and a write lock on pmc->sflock. We 606 * on ipv6_sk_mc_lock and a write lock on pmc->sflock. We
607 * have the socket lock, so reading here is safe. 607 * have the socket lock, so reading here is safe.
608 */ 608 */
609 for (i=0; i<copycount; i++) { 609 for (i = 0; i < copycount; i++) {
610 struct sockaddr_in6 *psin6; 610 struct sockaddr_in6 *psin6;
611 struct sockaddr_storage ss; 611 struct sockaddr_storage ss;
612 612
@@ -648,7 +648,7 @@ bool inet6_mc_check(struct sock *sk, const struct in6_addr *mc_addr,
648 } else { 648 } else {
649 int i; 649 int i;
650 650
651 for (i=0; i<psl->sl_count; i++) { 651 for (i = 0; i < psl->sl_count; i++) {
652 if (ipv6_addr_equal(&psl->sl_addr[i], src_addr)) 652 if (ipv6_addr_equal(&psl->sl_addr[i], src_addr))
653 break; 653 break;
654 } 654 }
@@ -762,7 +762,7 @@ static void mld_add_delrec(struct inet6_dev *idev, struct ifmcaddr6 *im)
762 pmc->mca_tomb = im->mca_tomb; 762 pmc->mca_tomb = im->mca_tomb;
763 pmc->mca_sources = im->mca_sources; 763 pmc->mca_sources = im->mca_sources;
764 im->mca_tomb = im->mca_sources = NULL; 764 im->mca_tomb = im->mca_sources = NULL;
765 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) 765 for (psf = pmc->mca_sources; psf; psf = psf->sf_next)
766 psf->sf_crcount = pmc->mca_crcount; 766 psf->sf_crcount = pmc->mca_crcount;
767 } 767 }
768 spin_unlock_bh(&im->mca_lock); 768 spin_unlock_bh(&im->mca_lock);
@@ -780,7 +780,7 @@ static void mld_del_delrec(struct inet6_dev *idev, const struct in6_addr *pmca)
780 780
781 spin_lock_bh(&idev->mc_lock); 781 spin_lock_bh(&idev->mc_lock);
782 pmc_prev = NULL; 782 pmc_prev = NULL;
783 for (pmc=idev->mc_tomb; pmc; pmc=pmc->next) { 783 for (pmc = idev->mc_tomb; pmc; pmc = pmc->next) {
784 if (ipv6_addr_equal(&pmc->mca_addr, pmca)) 784 if (ipv6_addr_equal(&pmc->mca_addr, pmca))
785 break; 785 break;
786 pmc_prev = pmc; 786 pmc_prev = pmc;
@@ -794,7 +794,7 @@ static void mld_del_delrec(struct inet6_dev *idev, const struct in6_addr *pmca)
794 spin_unlock_bh(&idev->mc_lock); 794 spin_unlock_bh(&idev->mc_lock);
795 795
796 if (pmc) { 796 if (pmc) {
797 for (psf=pmc->mca_tomb; psf; psf=psf_next) { 797 for (psf = pmc->mca_tomb; psf; psf = psf_next) {
798 psf_next = psf->sf_next; 798 psf_next = psf->sf_next;
799 kfree(psf); 799 kfree(psf);
800 } 800 }
@@ -821,14 +821,14 @@ static void mld_clear_delrec(struct inet6_dev *idev)
821 821
822 /* clear dead sources, too */ 822 /* clear dead sources, too */
823 read_lock_bh(&idev->lock); 823 read_lock_bh(&idev->lock);
824 for (pmc=idev->mc_list; pmc; pmc=pmc->next) { 824 for (pmc = idev->mc_list; pmc; pmc = pmc->next) {
825 struct ip6_sf_list *psf, *psf_next; 825 struct ip6_sf_list *psf, *psf_next;
826 826
827 spin_lock_bh(&pmc->mca_lock); 827 spin_lock_bh(&pmc->mca_lock);
828 psf = pmc->mca_tomb; 828 psf = pmc->mca_tomb;
829 pmc->mca_tomb = NULL; 829 pmc->mca_tomb = NULL;
830 spin_unlock_bh(&pmc->mca_lock); 830 spin_unlock_bh(&pmc->mca_lock);
831 for (; psf; psf=psf_next) { 831 for (; psf; psf = psf_next) {
832 psf_next = psf->sf_next; 832 psf_next = psf->sf_next;
833 kfree(psf); 833 kfree(psf);
834 } 834 }
@@ -917,7 +917,7 @@ int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr)
917 struct ifmcaddr6 *ma, **map; 917 struct ifmcaddr6 *ma, **map;
918 918
919 write_lock_bh(&idev->lock); 919 write_lock_bh(&idev->lock);
920 for (map = &idev->mc_list; (ma=*map) != NULL; map = &ma->next) { 920 for (map = &idev->mc_list; (ma = *map) != NULL; map = &ma->next) {
921 if (ipv6_addr_equal(&ma->mca_addr, addr)) { 921 if (ipv6_addr_equal(&ma->mca_addr, addr)) {
922 if (--ma->mca_users == 0) { 922 if (--ma->mca_users == 0) {
923 *map = ma->next; 923 *map = ma->next;
@@ -968,7 +968,7 @@ bool ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group,
968 idev = __in6_dev_get(dev); 968 idev = __in6_dev_get(dev);
969 if (idev) { 969 if (idev) {
970 read_lock_bh(&idev->lock); 970 read_lock_bh(&idev->lock);
971 for (mc = idev->mc_list; mc; mc=mc->next) { 971 for (mc = idev->mc_list; mc; mc = mc->next) {
972 if (ipv6_addr_equal(&mc->mca_addr, group)) 972 if (ipv6_addr_equal(&mc->mca_addr, group))
973 break; 973 break;
974 } 974 }
@@ -977,7 +977,7 @@ bool ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group,
977 struct ip6_sf_list *psf; 977 struct ip6_sf_list *psf;
978 978
979 spin_lock_bh(&mc->mca_lock); 979 spin_lock_bh(&mc->mca_lock);
980 for (psf=mc->mca_sources;psf;psf=psf->sf_next) { 980 for (psf = mc->mca_sources; psf; psf = psf->sf_next) {
981 if (ipv6_addr_equal(&psf->sf_addr, src_addr)) 981 if (ipv6_addr_equal(&psf->sf_addr, src_addr))
982 break; 982 break;
983 } 983 }
@@ -986,7 +986,7 @@ bool ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group,
986 psf->sf_count[MCAST_EXCLUDE] != 986 psf->sf_count[MCAST_EXCLUDE] !=
987 mc->mca_sfcount[MCAST_EXCLUDE]; 987 mc->mca_sfcount[MCAST_EXCLUDE];
988 else 988 else
989 rv = mc->mca_sfcount[MCAST_EXCLUDE] !=0; 989 rv = mc->mca_sfcount[MCAST_EXCLUDE] != 0;
990 spin_unlock_bh(&mc->mca_lock); 990 spin_unlock_bh(&mc->mca_lock);
991 } else 991 } else
992 rv = true; /* don't filter unspecified source */ 992 rv = true; /* don't filter unspecified source */
@@ -1077,10 +1077,10 @@ static bool mld_xmarksources(struct ifmcaddr6 *pmc, int nsrcs,
1077 int i, scount; 1077 int i, scount;
1078 1078
1079 scount = 0; 1079 scount = 0;
1080 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { 1080 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
1081 if (scount == nsrcs) 1081 if (scount == nsrcs)
1082 break; 1082 break;
1083 for (i=0; i<nsrcs; i++) { 1083 for (i = 0; i < nsrcs; i++) {
1084 /* skip inactive filters */ 1084 /* skip inactive filters */
1085 if (psf->sf_count[MCAST_INCLUDE] || 1085 if (psf->sf_count[MCAST_INCLUDE] ||
1086 pmc->mca_sfcount[MCAST_EXCLUDE] != 1086 pmc->mca_sfcount[MCAST_EXCLUDE] !=
@@ -1110,10 +1110,10 @@ static bool mld_marksources(struct ifmcaddr6 *pmc, int nsrcs,
1110 /* mark INCLUDE-mode sources */ 1110 /* mark INCLUDE-mode sources */
1111 1111
1112 scount = 0; 1112 scount = 0;
1113 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { 1113 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
1114 if (scount == nsrcs) 1114 if (scount == nsrcs)
1115 break; 1115 break;
1116 for (i=0; i<nsrcs; i++) { 1116 for (i = 0; i < nsrcs; i++) {
1117 if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) { 1117 if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) {
1118 psf->sf_gsresp = 1; 1118 psf->sf_gsresp = 1;
1119 scount++; 1119 scount++;
@@ -1364,13 +1364,13 @@ int igmp6_event_query(struct sk_buff *skb)
1364 1364
1365 read_lock_bh(&idev->lock); 1365 read_lock_bh(&idev->lock);
1366 if (group_type == IPV6_ADDR_ANY) { 1366 if (group_type == IPV6_ADDR_ANY) {
1367 for (ma = idev->mc_list; ma; ma=ma->next) { 1367 for (ma = idev->mc_list; ma; ma = ma->next) {
1368 spin_lock_bh(&ma->mca_lock); 1368 spin_lock_bh(&ma->mca_lock);
1369 igmp6_group_queried(ma, max_delay); 1369 igmp6_group_queried(ma, max_delay);
1370 spin_unlock_bh(&ma->mca_lock); 1370 spin_unlock_bh(&ma->mca_lock);
1371 } 1371 }
1372 } else { 1372 } else {
1373 for (ma = idev->mc_list; ma; ma=ma->next) { 1373 for (ma = idev->mc_list; ma; ma = ma->next) {
1374 if (!ipv6_addr_equal(group, &ma->mca_addr)) 1374 if (!ipv6_addr_equal(group, &ma->mca_addr))
1375 continue; 1375 continue;
1376 spin_lock_bh(&ma->mca_lock); 1376 spin_lock_bh(&ma->mca_lock);
@@ -1434,7 +1434,7 @@ int igmp6_event_report(struct sk_buff *skb)
1434 */ 1434 */
1435 1435
1436 read_lock_bh(&idev->lock); 1436 read_lock_bh(&idev->lock);
1437 for (ma = idev->mc_list; ma; ma=ma->next) { 1437 for (ma = idev->mc_list; ma; ma = ma->next) {
1438 if (ipv6_addr_equal(&ma->mca_addr, &mld->mld_mca)) { 1438 if (ipv6_addr_equal(&ma->mca_addr, &mld->mld_mca)) {
1439 spin_lock(&ma->mca_lock); 1439 spin_lock(&ma->mca_lock);
1440 if (del_timer(&ma->mca_timer)) 1440 if (del_timer(&ma->mca_timer))
@@ -1498,7 +1498,7 @@ mld_scount(struct ifmcaddr6 *pmc, int type, int gdeleted, int sdeleted)
1498 struct ip6_sf_list *psf; 1498 struct ip6_sf_list *psf;
1499 int scount = 0; 1499 int scount = 0;
1500 1500
1501 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { 1501 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
1502 if (!is_in(pmc, psf, type, gdeleted, sdeleted)) 1502 if (!is_in(pmc, psf, type, gdeleted, sdeleted))
1503 continue; 1503 continue;
1504 scount++; 1504 scount++;
@@ -1712,7 +1712,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
1712 } 1712 }
1713 first = 1; 1713 first = 1;
1714 psf_prev = NULL; 1714 psf_prev = NULL;
1715 for (psf=*psf_list; psf; psf=psf_next) { 1715 for (psf = *psf_list; psf; psf = psf_next) {
1716 struct in6_addr *psrc; 1716 struct in6_addr *psrc;
1717 1717
1718 psf_next = psf->sf_next; 1718 psf_next = psf->sf_next;
@@ -1791,7 +1791,7 @@ static void mld_send_report(struct inet6_dev *idev, struct ifmcaddr6 *pmc)
1791 1791
1792 read_lock_bh(&idev->lock); 1792 read_lock_bh(&idev->lock);
1793 if (!pmc) { 1793 if (!pmc) {
1794 for (pmc=idev->mc_list; pmc; pmc=pmc->next) { 1794 for (pmc = idev->mc_list; pmc; pmc = pmc->next) {
1795 if (pmc->mca_flags & MAF_NOREPORT) 1795 if (pmc->mca_flags & MAF_NOREPORT)
1796 continue; 1796 continue;
1797 spin_lock_bh(&pmc->mca_lock); 1797 spin_lock_bh(&pmc->mca_lock);
@@ -1824,7 +1824,7 @@ static void mld_clear_zeros(struct ip6_sf_list **ppsf)
1824 struct ip6_sf_list *psf_prev, *psf_next, *psf; 1824 struct ip6_sf_list *psf_prev, *psf_next, *psf;
1825 1825
1826 psf_prev = NULL; 1826 psf_prev = NULL;
1827 for (psf=*ppsf; psf; psf = psf_next) { 1827 for (psf = *ppsf; psf; psf = psf_next) {
1828 psf_next = psf->sf_next; 1828 psf_next = psf->sf_next;
1829 if (psf->sf_crcount == 0) { 1829 if (psf->sf_crcount == 0) {
1830 if (psf_prev) 1830 if (psf_prev)
@@ -1848,7 +1848,7 @@ static void mld_send_cr(struct inet6_dev *idev)
1848 1848
1849 /* deleted MCA's */ 1849 /* deleted MCA's */
1850 pmc_prev = NULL; 1850 pmc_prev = NULL;
1851 for (pmc=idev->mc_tomb; pmc; pmc=pmc_next) { 1851 for (pmc = idev->mc_tomb; pmc; pmc = pmc_next) {
1852 pmc_next = pmc->next; 1852 pmc_next = pmc->next;
1853 if (pmc->mca_sfmode == MCAST_INCLUDE) { 1853 if (pmc->mca_sfmode == MCAST_INCLUDE) {
1854 type = MLD2_BLOCK_OLD_SOURCES; 1854 type = MLD2_BLOCK_OLD_SOURCES;
@@ -1881,7 +1881,7 @@ static void mld_send_cr(struct inet6_dev *idev)
1881 spin_unlock(&idev->mc_lock); 1881 spin_unlock(&idev->mc_lock);
1882 1882
1883 /* change recs */ 1883 /* change recs */
1884 for (pmc=idev->mc_list; pmc; pmc=pmc->next) { 1884 for (pmc = idev->mc_list; pmc; pmc = pmc->next) {
1885 spin_lock_bh(&pmc->mca_lock); 1885 spin_lock_bh(&pmc->mca_lock);
1886 if (pmc->mca_sfcount[MCAST_EXCLUDE]) { 1886 if (pmc->mca_sfcount[MCAST_EXCLUDE]) {
1887 type = MLD2_BLOCK_OLD_SOURCES; 1887 type = MLD2_BLOCK_OLD_SOURCES;
@@ -2018,7 +2018,7 @@ static void mld_send_initial_cr(struct inet6_dev *idev)
2018 2018
2019 skb = NULL; 2019 skb = NULL;
2020 read_lock_bh(&idev->lock); 2020 read_lock_bh(&idev->lock);
2021 for (pmc=idev->mc_list; pmc; pmc=pmc->next) { 2021 for (pmc = idev->mc_list; pmc; pmc = pmc->next) {
2022 spin_lock_bh(&pmc->mca_lock); 2022 spin_lock_bh(&pmc->mca_lock);
2023 if (pmc->mca_sfcount[MCAST_EXCLUDE]) 2023 if (pmc->mca_sfcount[MCAST_EXCLUDE])
2024 type = MLD2_CHANGE_TO_EXCLUDE; 2024 type = MLD2_CHANGE_TO_EXCLUDE;
@@ -2063,7 +2063,7 @@ static int ip6_mc_del1_src(struct ifmcaddr6 *pmc, int sfmode,
2063 int rv = 0; 2063 int rv = 0;
2064 2064
2065 psf_prev = NULL; 2065 psf_prev = NULL;
2066 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { 2066 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
2067 if (ipv6_addr_equal(&psf->sf_addr, psfsrc)) 2067 if (ipv6_addr_equal(&psf->sf_addr, psfsrc))
2068 break; 2068 break;
2069 psf_prev = psf; 2069 psf_prev = psf;
@@ -2104,7 +2104,7 @@ static int ip6_mc_del_src(struct inet6_dev *idev, const struct in6_addr *pmca,
2104 if (!idev) 2104 if (!idev)
2105 return -ENODEV; 2105 return -ENODEV;
2106 read_lock_bh(&idev->lock); 2106 read_lock_bh(&idev->lock);
2107 for (pmc=idev->mc_list; pmc; pmc=pmc->next) { 2107 for (pmc = idev->mc_list; pmc; pmc = pmc->next) {
2108 if (ipv6_addr_equal(pmca, &pmc->mca_addr)) 2108 if (ipv6_addr_equal(pmca, &pmc->mca_addr))
2109 break; 2109 break;
2110 } 2110 }
@@ -2124,7 +2124,7 @@ static int ip6_mc_del_src(struct inet6_dev *idev, const struct in6_addr *pmca,
2124 pmc->mca_sfcount[sfmode]--; 2124 pmc->mca_sfcount[sfmode]--;
2125 } 2125 }
2126 err = 0; 2126 err = 0;
2127 for (i=0; i<sfcount; i++) { 2127 for (i = 0; i < sfcount; i++) {
2128 int rv = ip6_mc_del1_src(pmc, sfmode, &psfsrc[i]); 2128 int rv = ip6_mc_del1_src(pmc, sfmode, &psfsrc[i]);
2129 2129
2130 changerec |= rv > 0; 2130 changerec |= rv > 0;
@@ -2140,7 +2140,7 @@ static int ip6_mc_del_src(struct inet6_dev *idev, const struct in6_addr *pmca,
2140 pmc->mca_sfmode = MCAST_INCLUDE; 2140 pmc->mca_sfmode = MCAST_INCLUDE;
2141 pmc->mca_crcount = idev->mc_qrv; 2141 pmc->mca_crcount = idev->mc_qrv;
2142 idev->mc_ifc_count = pmc->mca_crcount; 2142 idev->mc_ifc_count = pmc->mca_crcount;
2143 for (psf=pmc->mca_sources; psf; psf = psf->sf_next) 2143 for (psf = pmc->mca_sources; psf; psf = psf->sf_next)
2144 psf->sf_crcount = 0; 2144 psf->sf_crcount = 0;
2145 mld_ifc_event(pmc->idev); 2145 mld_ifc_event(pmc->idev);
2146 } else if (sf_setstate(pmc) || changerec) 2146 } else if (sf_setstate(pmc) || changerec)
@@ -2159,7 +2159,7 @@ static int ip6_mc_add1_src(struct ifmcaddr6 *pmc, int sfmode,
2159 struct ip6_sf_list *psf, *psf_prev; 2159 struct ip6_sf_list *psf, *psf_prev;
2160 2160
2161 psf_prev = NULL; 2161 psf_prev = NULL;
2162 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { 2162 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
2163 if (ipv6_addr_equal(&psf->sf_addr, psfsrc)) 2163 if (ipv6_addr_equal(&psf->sf_addr, psfsrc))
2164 break; 2164 break;
2165 psf_prev = psf; 2165 psf_prev = psf;
@@ -2184,7 +2184,7 @@ static void sf_markstate(struct ifmcaddr6 *pmc)
2184 struct ip6_sf_list *psf; 2184 struct ip6_sf_list *psf;
2185 int mca_xcount = pmc->mca_sfcount[MCAST_EXCLUDE]; 2185 int mca_xcount = pmc->mca_sfcount[MCAST_EXCLUDE];
2186 2186
2187 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) 2187 for (psf = pmc->mca_sources; psf; psf = psf->sf_next)
2188 if (pmc->mca_sfcount[MCAST_EXCLUDE]) { 2188 if (pmc->mca_sfcount[MCAST_EXCLUDE]) {
2189 psf->sf_oldin = mca_xcount == 2189 psf->sf_oldin = mca_xcount ==
2190 psf->sf_count[MCAST_EXCLUDE] && 2190 psf->sf_count[MCAST_EXCLUDE] &&
@@ -2201,7 +2201,7 @@ static int sf_setstate(struct ifmcaddr6 *pmc)
2201 int new_in, rv; 2201 int new_in, rv;
2202 2202
2203 rv = 0; 2203 rv = 0;
2204 for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { 2204 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) {
2205 if (pmc->mca_sfcount[MCAST_EXCLUDE]) { 2205 if (pmc->mca_sfcount[MCAST_EXCLUDE]) {
2206 new_in = mca_xcount == psf->sf_count[MCAST_EXCLUDE] && 2206 new_in = mca_xcount == psf->sf_count[MCAST_EXCLUDE] &&
2207 !psf->sf_count[MCAST_INCLUDE]; 2207 !psf->sf_count[MCAST_INCLUDE];
@@ -2211,8 +2211,8 @@ static int sf_setstate(struct ifmcaddr6 *pmc)
2211 if (!psf->sf_oldin) { 2211 if (!psf->sf_oldin) {
2212 struct ip6_sf_list *prev = NULL; 2212 struct ip6_sf_list *prev = NULL;
2213 2213
2214 for (dpsf=pmc->mca_tomb; dpsf; 2214 for (dpsf = pmc->mca_tomb; dpsf;
2215 dpsf=dpsf->sf_next) { 2215 dpsf = dpsf->sf_next) {
2216 if (ipv6_addr_equal(&dpsf->sf_addr, 2216 if (ipv6_addr_equal(&dpsf->sf_addr,
2217 &psf->sf_addr)) 2217 &psf->sf_addr))
2218 break; 2218 break;
@@ -2234,7 +2234,7 @@ static int sf_setstate(struct ifmcaddr6 *pmc)
2234 * add or update "delete" records if an active filter 2234 * add or update "delete" records if an active filter
2235 * is now inactive 2235 * is now inactive
2236 */ 2236 */
2237 for (dpsf=pmc->mca_tomb; dpsf; dpsf=dpsf->sf_next) 2237 for (dpsf = pmc->mca_tomb; dpsf; dpsf = dpsf->sf_next)
2238 if (ipv6_addr_equal(&dpsf->sf_addr, 2238 if (ipv6_addr_equal(&dpsf->sf_addr,
2239 &psf->sf_addr)) 2239 &psf->sf_addr))
2240 break; 2240 break;
@@ -2268,7 +2268,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,
2268 if (!idev) 2268 if (!idev)
2269 return -ENODEV; 2269 return -ENODEV;
2270 read_lock_bh(&idev->lock); 2270 read_lock_bh(&idev->lock);
2271 for (pmc=idev->mc_list; pmc; pmc=pmc->next) { 2271 for (pmc = idev->mc_list; pmc; pmc = pmc->next) {
2272 if (ipv6_addr_equal(pmca, &pmc->mca_addr)) 2272 if (ipv6_addr_equal(pmca, &pmc->mca_addr))
2273 break; 2273 break;
2274 } 2274 }
@@ -2284,7 +2284,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,
2284 if (!delta) 2284 if (!delta)
2285 pmc->mca_sfcount[sfmode]++; 2285 pmc->mca_sfcount[sfmode]++;
2286 err = 0; 2286 err = 0;
2287 for (i=0; i<sfcount; i++) { 2287 for (i = 0; i < sfcount; i++) {
2288 err = ip6_mc_add1_src(pmc, sfmode, &psfsrc[i]); 2288 err = ip6_mc_add1_src(pmc, sfmode, &psfsrc[i]);
2289 if (err) 2289 if (err)
2290 break; 2290 break;
@@ -2294,7 +2294,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,
2294 2294
2295 if (!delta) 2295 if (!delta)
2296 pmc->mca_sfcount[sfmode]--; 2296 pmc->mca_sfcount[sfmode]--;
2297 for (j=0; j<i; j++) 2297 for (j = 0; j < i; j++)
2298 ip6_mc_del1_src(pmc, sfmode, &psfsrc[j]); 2298 ip6_mc_del1_src(pmc, sfmode, &psfsrc[j]);
2299 } else if (isexclude != (pmc->mca_sfcount[MCAST_EXCLUDE] != 0)) { 2299 } else if (isexclude != (pmc->mca_sfcount[MCAST_EXCLUDE] != 0)) {
2300 struct ip6_sf_list *psf; 2300 struct ip6_sf_list *psf;
@@ -2308,7 +2308,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,
2308 2308
2309 pmc->mca_crcount = idev->mc_qrv; 2309 pmc->mca_crcount = idev->mc_qrv;
2310 idev->mc_ifc_count = pmc->mca_crcount; 2310 idev->mc_ifc_count = pmc->mca_crcount;
2311 for (psf=pmc->mca_sources; psf; psf = psf->sf_next) 2311 for (psf = pmc->mca_sources; psf; psf = psf->sf_next)
2312 psf->sf_crcount = 0; 2312 psf->sf_crcount = 0;
2313 mld_ifc_event(idev); 2313 mld_ifc_event(idev);
2314 } else if (sf_setstate(pmc)) 2314 } else if (sf_setstate(pmc))
@@ -2322,12 +2322,12 @@ static void ip6_mc_clear_src(struct ifmcaddr6 *pmc)
2322{ 2322{
2323 struct ip6_sf_list *psf, *nextpsf; 2323 struct ip6_sf_list *psf, *nextpsf;
2324 2324
2325 for (psf=pmc->mca_tomb; psf; psf=nextpsf) { 2325 for (psf = pmc->mca_tomb; psf; psf = nextpsf) {
2326 nextpsf = psf->sf_next; 2326 nextpsf = psf->sf_next;
2327 kfree(psf); 2327 kfree(psf);
2328 } 2328 }
2329 pmc->mca_tomb = NULL; 2329 pmc->mca_tomb = NULL;
2330 for (psf=pmc->mca_sources; psf; psf=nextpsf) { 2330 for (psf = pmc->mca_sources; psf; psf = nextpsf) {
2331 nextpsf = psf->sf_next; 2331 nextpsf = psf->sf_next;
2332 kfree(psf); 2332 kfree(psf);
2333 } 2333 }
@@ -2471,7 +2471,7 @@ void ipv6_mc_down(struct inet6_dev *idev)
2471 mld_gq_stop_timer(idev); 2471 mld_gq_stop_timer(idev);
2472 mld_dad_stop_timer(idev); 2472 mld_dad_stop_timer(idev);
2473 2473
2474 for (i = idev->mc_list; i; i=i->next) 2474 for (i = idev->mc_list; i; i = i->next)
2475 igmp6_group_dropped(i); 2475 igmp6_group_dropped(i);
2476 read_unlock_bh(&idev->lock); 2476 read_unlock_bh(&idev->lock);
2477 2477
@@ -2488,7 +2488,7 @@ void ipv6_mc_up(struct inet6_dev *idev)
2488 /* Install multicast list, except for all-nodes (already installed) */ 2488 /* Install multicast list, except for all-nodes (already installed) */
2489 2489
2490 read_lock_bh(&idev->lock); 2490 read_lock_bh(&idev->lock);
2491 for (i = idev->mc_list; i; i=i->next) 2491 for (i = idev->mc_list; i; i = i->next)
2492 igmp6_group_added(i); 2492 igmp6_group_added(i);
2493 read_unlock_bh(&idev->lock); 2493 read_unlock_bh(&idev->lock);
2494} 2494}
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 339078f95d1b..995a82945994 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -175,7 +175,7 @@ static struct nd_opt_hdr *ndisc_next_option(struct nd_opt_hdr *cur,
175 type = cur->nd_opt_type; 175 type = cur->nd_opt_type;
176 do { 176 do {
177 cur = ((void *)cur) + (cur->nd_opt_len << 3); 177 cur = ((void *)cur) + (cur->nd_opt_len << 3);
178 } while(cur < end && cur->nd_opt_type != type); 178 } while (cur < end && cur->nd_opt_type != type);
179 return cur <= end && cur->nd_opt_type == type ? cur : NULL; 179 return cur <= end && cur->nd_opt_type == type ? cur : NULL;
180} 180}
181 181
@@ -192,7 +192,7 @@ static struct nd_opt_hdr *ndisc_next_useropt(struct nd_opt_hdr *cur,
192 return NULL; 192 return NULL;
193 do { 193 do {
194 cur = ((void *)cur) + (cur->nd_opt_len << 3); 194 cur = ((void *)cur) + (cur->nd_opt_len << 3);
195 } while(cur < end && !ndisc_is_useropt(cur)); 195 } while (cur < end && !ndisc_is_useropt(cur));
196 return cur <= end && ndisc_is_useropt(cur) ? cur : NULL; 196 return cur <= end && ndisc_is_useropt(cur) ? cur : NULL;
197} 197}
198 198
@@ -296,7 +296,7 @@ static u32 ndisc_hash(const void *pkey,
296 296
297static int ndisc_constructor(struct neighbour *neigh) 297static int ndisc_constructor(struct neighbour *neigh)
298{ 298{
299 struct in6_addr *addr = (struct in6_addr*)&neigh->primary_key; 299 struct in6_addr *addr = (struct in6_addr *)&neigh->primary_key;
300 struct net_device *dev = neigh->dev; 300 struct net_device *dev = neigh->dev;
301 struct inet6_dev *in6_dev; 301 struct inet6_dev *in6_dev;
302 struct neigh_parms *parms; 302 struct neigh_parms *parms;
@@ -344,7 +344,7 @@ static int ndisc_constructor(struct neighbour *neigh)
344 344
345static int pndisc_constructor(struct pneigh_entry *n) 345static int pndisc_constructor(struct pneigh_entry *n)
346{ 346{
347 struct in6_addr *addr = (struct in6_addr*)&n->key; 347 struct in6_addr *addr = (struct in6_addr *)&n->key;
348 struct in6_addr maddr; 348 struct in6_addr maddr;
349 struct net_device *dev = n->dev; 349 struct net_device *dev = n->dev;
350 350
@@ -357,7 +357,7 @@ static int pndisc_constructor(struct pneigh_entry *n)
357 357
358static void pndisc_destructor(struct pneigh_entry *n) 358static void pndisc_destructor(struct pneigh_entry *n)
359{ 359{
360 struct in6_addr *addr = (struct in6_addr*)&n->key; 360 struct in6_addr *addr = (struct in6_addr *)&n->key;
361 struct in6_addr maddr; 361 struct in6_addr maddr;
362 struct net_device *dev = n->dev; 362 struct net_device *dev = n->dev;
363 363
@@ -1065,7 +1065,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
1065 int optlen; 1065 int optlen;
1066 unsigned int pref = 0; 1066 unsigned int pref = 0;
1067 1067
1068 __u8 * opt = (__u8 *)(ra_msg + 1); 1068 __u8 *opt = (__u8 *)(ra_msg + 1);
1069 1069
1070 optlen = (skb_tail_pointer(skb) - skb_transport_header(skb)) - 1070 optlen = (skb_tail_pointer(skb) - skb_transport_header(skb)) -
1071 sizeof(struct ra_msg); 1071 sizeof(struct ra_msg);
@@ -1319,7 +1319,7 @@ skip_linkparms:
1319 continue; 1319 continue;
1320 if (ri->prefix_len > in6_dev->cnf.accept_ra_rt_info_max_plen) 1320 if (ri->prefix_len > in6_dev->cnf.accept_ra_rt_info_max_plen)
1321 continue; 1321 continue;
1322 rt6_route_rcv(skb->dev, (u8*)p, (p->nd_opt_len) << 3, 1322 rt6_route_rcv(skb->dev, (u8 *)p, (p->nd_opt_len) << 3,
1323 &ipv6_hdr(skb)->saddr); 1323 &ipv6_hdr(skb)->saddr);
1324 } 1324 }
1325 } 1325 }
@@ -1352,7 +1352,7 @@ skip_routeinfo:
1352 __be32 n; 1352 __be32 n;
1353 u32 mtu; 1353 u32 mtu;
1354 1354
1355 memcpy(&n, ((u8*)(ndopts.nd_opts_mtu+1))+2, sizeof(mtu)); 1355 memcpy(&n, ((u8 *)(ndopts.nd_opts_mtu+1))+2, sizeof(mtu));
1356 mtu = ntohl(n); 1356 mtu = ntohl(n);
1357 1357
1358 if (mtu < IPV6_MIN_MTU || mtu > skb->dev->mtu) { 1358 if (mtu < IPV6_MIN_MTU || mtu > skb->dev->mtu) {
diff --git a/net/ipv6/output_core.c b/net/ipv6/output_core.c
index 5ec867e4a8b7..fc24c390af05 100644
--- a/net/ipv6/output_core.c
+++ b/net/ipv6/output_core.c
@@ -35,7 +35,7 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr)
35 if (found_rhdr) 35 if (found_rhdr)
36 return offset; 36 return offset;
37 break; 37 break;
38 default : 38 default:
39 return offset; 39 return offset;
40 } 40 }
41 41
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index 2d6f860e5c1e..1752cd0b4882 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -8,7 +8,7 @@
8 * except it reports the sockets in the INET6 address family. 8 * except it reports the sockets in the INET6 address family.
9 * 9 *
10 * Authors: David S. Miller (davem@caip.rutgers.edu) 10 * Authors: David S. Miller (davem@caip.rutgers.edu)
11 * YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> 11 * YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
12 * 12 *
13 * This program is free software; you can redistribute it and/or 13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License 14 * modify it under the terms of the GNU General Public License
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 39d44226e402..896af8807979 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -889,7 +889,7 @@ back_from_confirm:
889 else { 889 else {
890 lock_sock(sk); 890 lock_sock(sk);
891 err = ip6_append_data(sk, ip_generic_getfrag, msg->msg_iov, 891 err = ip6_append_data(sk, ip_generic_getfrag, msg->msg_iov,
892 len, 0, hlimit, tclass, opt, &fl6, (struct rt6_info*)dst, 892 len, 0, hlimit, tclass, opt, &fl6, (struct rt6_info *)dst,
893 msg->msg_flags, dontfrag); 893 msg->msg_flags, dontfrag);
894 894
895 if (err) 895 if (err)
@@ -902,7 +902,7 @@ done:
902 dst_release(dst); 902 dst_release(dst);
903out: 903out:
904 fl6_sock_release(flowlabel); 904 fl6_sock_release(flowlabel);
905 return err<0?err:len; 905 return err < 0 ? err : len;
906do_confirm: 906do_confirm:
907 dst_confirm(dst); 907 dst_confirm(dst);
908 if (!(msg->msg_flags & MSG_PROBE) || len) 908 if (!(msg->msg_flags & MSG_PROBE) || len)
@@ -1045,7 +1045,7 @@ static int do_rawv6_getsockopt(struct sock *sk, int level, int optname,
1045 struct raw6_sock *rp = raw6_sk(sk); 1045 struct raw6_sock *rp = raw6_sk(sk);
1046 int val, len; 1046 int val, len;
1047 1047
1048 if (get_user(len,optlen)) 1048 if (get_user(len, optlen))
1049 return -EFAULT; 1049 return -EFAULT;
1050 1050
1051 switch (optname) { 1051 switch (optname) {
@@ -1069,7 +1069,7 @@ static int do_rawv6_getsockopt(struct sock *sk, int level, int optname,
1069 1069
1070 if (put_user(len, optlen)) 1070 if (put_user(len, optlen))
1071 return -EFAULT; 1071 return -EFAULT;
1072 if (copy_to_user(optval,&val,len)) 1072 if (copy_to_user(optval, &val, len))
1073 return -EFAULT; 1073 return -EFAULT;
1074 return 0; 1074 return 0;
1075} 1075}
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index c6557d9f7808..fe156d99179e 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -68,7 +68,7 @@ struct ip6frag_skb_cb
68 int offset; 68 int offset;
69}; 69};
70 70
71#define FRAG6_CB(skb) ((struct ip6frag_skb_cb*)((skb)->cb)) 71#define FRAG6_CB(skb) ((struct ip6frag_skb_cb *)((skb)->cb))
72 72
73static inline u8 ip6_frag_ecn(const struct ipv6hdr *ipv6h) 73static inline u8 ip6_frag_ecn(const struct ipv6hdr *ipv6h)
74{ 74{
@@ -289,7 +289,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
289 goto found; 289 goto found;
290 } 290 }
291 prev = NULL; 291 prev = NULL;
292 for(next = fq->q.fragments; next != NULL; next = next->next) { 292 for (next = fq->q.fragments; next != NULL; next = next->next) {
293 if (FRAG6_CB(next)->offset >= offset) 293 if (FRAG6_CB(next)->offset >= offset)
294 break; /* bingo! */ 294 break; /* bingo! */
295 prev = next; 295 prev = next;
@@ -529,7 +529,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb)
529 IP6_INC_STATS_BH(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_REASMREQDS); 529 IP6_INC_STATS_BH(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_REASMREQDS);
530 530
531 /* Jumbo payload inhibits frag. header */ 531 /* Jumbo payload inhibits frag. header */
532 if (hdr->payload_len==0) 532 if (hdr->payload_len == 0)
533 goto fail_hdr; 533 goto fail_hdr;
534 534
535 if (!pskb_may_pull(skb, (skb_transport_offset(skb) + 535 if (!pskb_may_pull(skb, (skb_transport_offset(skb) +
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index f23fbd28a501..76c793096893 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -813,7 +813,7 @@ out:
813 813
814} 814}
815 815
816struct dst_entry * ip6_route_lookup(struct net *net, struct flowi6 *fl6, 816struct dst_entry *ip6_route_lookup(struct net *net, struct flowi6 *fl6,
817 int flags) 817 int flags)
818{ 818{
819 return fib6_rule_lookup(net, fl6, flags, ip6_pol_route_lookup); 819 return fib6_rule_lookup(net, fl6, flags, ip6_pol_route_lookup);
@@ -1024,7 +1024,7 @@ static struct rt6_info *ip6_pol_route_output(struct net *net, struct fib6_table
1024 return ip6_pol_route(net, table, fl6->flowi6_oif, fl6, flags); 1024 return ip6_pol_route(net, table, fl6->flowi6_oif, fl6, flags);
1025} 1025}
1026 1026
1027struct dst_entry * ip6_route_output(struct net *net, const struct sock *sk, 1027struct dst_entry *ip6_route_output(struct net *net, const struct sock *sk,
1028 struct flowi6 *fl6) 1028 struct flowi6 *fl6)
1029{ 1029{
1030 int flags = 0; 1030 int flags = 0;
@@ -1149,7 +1149,7 @@ static void ip6_link_failure(struct sk_buff *skb)
1149static void ip6_rt_update_pmtu(struct dst_entry *dst, struct sock *sk, 1149static void ip6_rt_update_pmtu(struct dst_entry *dst, struct sock *sk,
1150 struct sk_buff *skb, u32 mtu) 1150 struct sk_buff *skb, u32 mtu)
1151{ 1151{
1152 struct rt6_info *rt6 = (struct rt6_info*)dst; 1152 struct rt6_info *rt6 = (struct rt6_info *)dst;
1153 1153
1154 dst_confirm(dst); 1154 dst_confirm(dst);
1155 if (mtu < dst_mtu(dst) && rt6->rt6i_dst.plen == 128) { 1155 if (mtu < dst_mtu(dst) && rt6->rt6i_dst.plen == 128) {
@@ -1924,7 +1924,7 @@ static struct rt6_info *rt6_get_route_info(struct net *net,
1924 return NULL; 1924 return NULL;
1925 1925
1926 read_lock_bh(&table->tb6_lock); 1926 read_lock_bh(&table->tb6_lock);
1927 fn = fib6_locate(&table->tb6_root, prefix ,prefixlen, NULL, 0); 1927 fn = fib6_locate(&table->tb6_root, prefix, prefixlen, NULL, 0);
1928 if (!fn) 1928 if (!fn)
1929 goto out; 1929 goto out;
1930 1930
@@ -1983,7 +1983,7 @@ struct rt6_info *rt6_get_dflt_router(const struct in6_addr *addr, struct net_dev
1983 return NULL; 1983 return NULL;
1984 1984
1985 read_lock_bh(&table->tb6_lock); 1985 read_lock_bh(&table->tb6_lock);
1986 for (rt = table->tb6_root.leaf; rt; rt=rt->dst.rt6_next) { 1986 for (rt = table->tb6_root.leaf; rt; rt = rt->dst.rt6_next) {
1987 if (dev == rt->dst.dev && 1987 if (dev == rt->dst.dev &&
1988 ((rt->rt6i_flags & (RTF_ADDRCONF | RTF_DEFAULT)) == (RTF_ADDRCONF | RTF_DEFAULT)) && 1988 ((rt->rt6i_flags & (RTF_ADDRCONF | RTF_DEFAULT)) == (RTF_ADDRCONF | RTF_DEFAULT)) &&
1989 ipv6_addr_equal(&rt->rt6i_gateway, addr)) 1989 ipv6_addr_equal(&rt->rt6i_gateway, addr))
@@ -2068,7 +2068,7 @@ int ipv6_route_ioctl(struct net *net, unsigned int cmd, void __user *arg)
2068 struct in6_rtmsg rtmsg; 2068 struct in6_rtmsg rtmsg;
2069 int err; 2069 int err;
2070 2070
2071 switch(cmd) { 2071 switch (cmd) {
2072 case SIOCADDRT: /* Add a route */ 2072 case SIOCADDRT: /* Add a route */
2073 case SIOCDELRT: /* Delete a route */ 2073 case SIOCDELRT: /* Delete a route */
2074 if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) 2074 if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
@@ -2191,7 +2191,7 @@ int ip6_route_get_saddr(struct net *net,
2191 unsigned int prefs, 2191 unsigned int prefs,
2192 struct in6_addr *saddr) 2192 struct in6_addr *saddr)
2193{ 2193{
2194 struct inet6_dev *idev = ip6_dst_idev((struct dst_entry*)rt); 2194 struct inet6_dev *idev = ip6_dst_idev((struct dst_entry *)rt);
2195 int err = 0; 2195 int err = 0;
2196 if (rt->rt6i_prefsrc.plen) 2196 if (rt->rt6i_prefsrc.plen)
2197 *saddr = rt->rt6i_prefsrc.addr; 2197 *saddr = rt->rt6i_prefsrc.addr;
@@ -2486,7 +2486,7 @@ beginning:
2486 return last_err; 2486 return last_err;
2487} 2487}
2488 2488
2489static int inet6_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh) 2489static int inet6_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh)
2490{ 2490{
2491 struct fib6_config cfg; 2491 struct fib6_config cfg;
2492 int err; 2492 int err;
@@ -2501,7 +2501,7 @@ static int inet6_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh)
2501 return ip6_route_del(&cfg); 2501 return ip6_route_del(&cfg);
2502} 2502}
2503 2503
2504static int inet6_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh) 2504static int inet6_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh)
2505{ 2505{
2506 struct fib6_config cfg; 2506 struct fib6_config cfg;
2507 int err; 2507 int err;
@@ -2693,7 +2693,7 @@ int rt6_dump_route(struct rt6_info *rt, void *p_arg)
2693 prefix, 0, NLM_F_MULTI); 2693 prefix, 0, NLM_F_MULTI);
2694} 2694}
2695 2695
2696static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh) 2696static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh)
2697{ 2697{
2698 struct net *net = sock_net(in_skb->sk); 2698 struct net *net = sock_net(in_skb->sk);
2699 struct nlattr *tb[RTA_MAX+1]; 2699 struct nlattr *tb[RTA_MAX+1];
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 6163f851dc01..86e3fa81f85e 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -812,9 +812,9 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
812 const struct ipv6hdr *iph6 = ipv6_hdr(skb); 812 const struct ipv6hdr *iph6 = ipv6_hdr(skb);
813 u8 tos = tunnel->parms.iph.tos; 813 u8 tos = tunnel->parms.iph.tos;
814 __be16 df = tiph->frag_off; 814 __be16 df = tiph->frag_off;
815 struct rtable *rt; /* Route to the other host */ 815 struct rtable *rt; /* Route to the other host */
816 struct net_device *tdev; /* Device to other host */ 816 struct net_device *tdev; /* Device to other host */
817 unsigned int max_headroom; /* The extra header space needed */ 817 unsigned int max_headroom; /* The extra header space needed */
818 __be32 dst = tiph->daddr; 818 __be32 dst = tiph->daddr;
819 struct flowi4 fl4; 819 struct flowi4 fl4;
820 int mtu; 820 int mtu;
@@ -1123,7 +1123,7 @@ static int ipip6_tunnel_update_6rd(struct ip_tunnel *t,
1123#endif 1123#endif
1124 1124
1125static int 1125static int
1126ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) 1126ipip6_tunnel_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1127{ 1127{
1128 int err = 0; 1128 int err = 0;
1129 struct ip_tunnel_parm p; 1129 struct ip_tunnel_parm p;
@@ -1339,10 +1339,10 @@ static void ipip6_dev_free(struct net_device *dev)
1339static void ipip6_tunnel_setup(struct net_device *dev) 1339static void ipip6_tunnel_setup(struct net_device *dev)
1340{ 1340{
1341 dev->netdev_ops = &ipip6_netdev_ops; 1341 dev->netdev_ops = &ipip6_netdev_ops;
1342 dev->destructor = ipip6_dev_free; 1342 dev->destructor = ipip6_dev_free;
1343 1343
1344 dev->type = ARPHRD_SIT; 1344 dev->type = ARPHRD_SIT;
1345 dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr); 1345 dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr);
1346 dev->mtu = ETH_DATA_LEN - sizeof(struct iphdr); 1346 dev->mtu = ETH_DATA_LEN - sizeof(struct iphdr);
1347 dev->flags = IFF_NOARP; 1347 dev->flags = IFF_NOARP;
1348 dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; 1348 dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
diff --git a/net/ipv6/tunnel6.c b/net/ipv6/tunnel6.c
index 2c4e4c5c7614..7a53d397c739 100644
--- a/net/ipv6/tunnel6.c
+++ b/net/ipv6/tunnel6.c
@@ -15,7 +15,7 @@
15 * along with this program; if not, see <http://www.gnu.org/licenses/>. 15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 * 16 *
17 * Authors Mitsuru KANDA <mk@linux-ipv6.org> 17 * Authors Mitsuru KANDA <mk@linux-ipv6.org>
18 * YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> 18 * YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
19 */ 19 */
20 20
21#define pr_fmt(fmt) "IPv6: " fmt 21#define pr_fmt(fmt) "IPv6: " fmt
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 25ffe737b975..12fcce8fba46 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -373,8 +373,8 @@ EXPORT_SYMBOL_GPL(udp6_lib_lookup);
373 373
374 374
375/* 375/*
376 * This should be easy, if there is something there we 376 * This should be easy, if there is something there we
377 * return it, otherwise we block. 377 * return it, otherwise we block.
378 */ 378 */
379 379
380int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk, 380int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk,
@@ -530,7 +530,7 @@ void __udp6_lib_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
530 const struct ipv6hdr *hdr = (const struct ipv6hdr *)skb->data; 530 const struct ipv6hdr *hdr = (const struct ipv6hdr *)skb->data;
531 const struct in6_addr *saddr = &hdr->saddr; 531 const struct in6_addr *saddr = &hdr->saddr;
532 const struct in6_addr *daddr = &hdr->daddr; 532 const struct in6_addr *daddr = &hdr->daddr;
533 struct udphdr *uh = (struct udphdr*)(skb->data+offset); 533 struct udphdr *uh = (struct udphdr *)(skb->data+offset);
534 struct sock *sk; 534 struct sock *sk;
535 int err; 535 int err;
536 struct net *net = dev_net(skb->dev); 536 struct net *net = dev_net(skb->dev);
@@ -596,7 +596,7 @@ static int __udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
596 596
597static __inline__ void udpv6_err(struct sk_buff *skb, 597static __inline__ void udpv6_err(struct sk_buff *skb,
598 struct inet6_skb_parm *opt, u8 type, 598 struct inet6_skb_parm *opt, u8 type,
599 u8 code, int offset, __be32 info ) 599 u8 code, int offset, __be32 info)
600{ 600{
601 __udp6_lib_err(skb, opt, type, code, offset, info, &udp_table); 601 __udp6_lib_err(skb, opt, type, code, offset, info, &udp_table);
602} 602}
@@ -960,10 +960,10 @@ static void udp_v6_flush_pending_frames(struct sock *sk)
960} 960}
961 961
962/** 962/**
963 * udp6_hwcsum_outgoing - handle outgoing HW checksumming 963 * udp6_hwcsum_outgoing - handle outgoing HW checksumming
964 * @sk: socket we are sending on 964 * @sk: socket we are sending on
965 * @skb: sk_buff containing the filled-in UDP header 965 * @skb: sk_buff containing the filled-in UDP header
966 * (checksum field must be zeroed out) 966 * (checksum field must be zeroed out)
967 */ 967 */
968static void udp6_hwcsum_outgoing(struct sock *sk, struct sk_buff *skb, 968static void udp6_hwcsum_outgoing(struct sock *sk, struct sk_buff *skb,
969 const struct in6_addr *saddr, 969 const struct in6_addr *saddr,
@@ -1294,7 +1294,7 @@ do_append_data:
1294 getfrag = is_udplite ? udplite_getfrag : ip_generic_getfrag; 1294 getfrag = is_udplite ? udplite_getfrag : ip_generic_getfrag;
1295 err = ip6_append_data(sk, getfrag, msg->msg_iov, ulen, 1295 err = ip6_append_data(sk, getfrag, msg->msg_iov, ulen,
1296 sizeof(struct udphdr), hlimit, tclass, opt, &fl6, 1296 sizeof(struct udphdr), hlimit, tclass, opt, &fl6,
1297 (struct rt6_info*)dst, 1297 (struct rt6_info *)dst,
1298 corkreq ? msg->msg_flags|MSG_MORE : msg->msg_flags, dontfrag); 1298 corkreq ? msg->msg_flags|MSG_MORE : msg->msg_flags, dontfrag);
1299 if (err) 1299 if (err)
1300 udp_v6_flush_pending_frames(sk); 1300 udp_v6_flush_pending_frames(sk);
diff --git a/net/ipv6/xfrm6_input.c b/net/ipv6/xfrm6_input.c
index f8c3cf842f53..cd4c98c7c805 100644
--- a/net/ipv6/xfrm6_input.c
+++ b/net/ipv6/xfrm6_input.c
@@ -3,8 +3,8 @@
3 * 3 *
4 * Authors: 4 * Authors:
5 * Mitsuru KANDA @USAGI 5 * Mitsuru KANDA @USAGI
6 * Kazunori MIYAZAWA @USAGI 6 * Kazunori MIYAZAWA @USAGI
7 * Kunihiro Ishiguro <kunihiro@ipinfusion.com> 7 * Kunihiro Ishiguro <kunihiro@ipinfusion.com>
8 * YOSHIFUJI Hideaki @USAGI 8 * YOSHIFUJI Hideaki @USAGI
9 * IPv6 support 9 * IPv6 support
10 */ 10 */
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 2a0bbda2c76a..ac49f84fe2c3 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -3,11 +3,11 @@
3 * 3 *
4 * Authors: 4 * Authors:
5 * Mitsuru KANDA @USAGI 5 * Mitsuru KANDA @USAGI
6 * Kazunori MIYAZAWA @USAGI 6 * Kazunori MIYAZAWA @USAGI
7 * Kunihiro Ishiguro <kunihiro@ipinfusion.com> 7 * Kunihiro Ishiguro <kunihiro@ipinfusion.com>
8 * IPv6 support 8 * IPv6 support
9 * YOSHIFUJI Hideaki 9 * YOSHIFUJI Hideaki
10 * Split up af-specific portion 10 * Split up af-specific portion
11 * 11 *
12 */ 12 */
13 13
@@ -84,7 +84,7 @@ static int xfrm6_init_path(struct xfrm_dst *path, struct dst_entry *dst,
84 int nfheader_len) 84 int nfheader_len)
85{ 85{
86 if (dst->ops->family == AF_INET6) { 86 if (dst->ops->family == AF_INET6) {
87 struct rt6_info *rt = (struct rt6_info*)dst; 87 struct rt6_info *rt = (struct rt6_info *)dst;
88 if (rt->rt6i_node) 88 if (rt->rt6i_node)
89 path->path_cookie = rt->rt6i_node->fn_sernum; 89 path->path_cookie = rt->rt6i_node->fn_sernum;
90 } 90 }
@@ -97,7 +97,7 @@ static int xfrm6_init_path(struct xfrm_dst *path, struct dst_entry *dst,
97static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev, 97static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
98 const struct flowi *fl) 98 const struct flowi *fl)
99{ 99{
100 struct rt6_info *rt = (struct rt6_info*)xdst->route; 100 struct rt6_info *rt = (struct rt6_info *)xdst->route;
101 101
102 xdst->u.dst.dev = dev; 102 xdst->u.dst.dev = dev;
103 dev_hold(dev); 103 dev_hold(dev);
@@ -296,7 +296,7 @@ static struct xfrm_policy_afinfo xfrm6_policy_afinfo = {
296 .family = AF_INET6, 296 .family = AF_INET6,
297 .dst_ops = &xfrm6_dst_ops, 297 .dst_ops = &xfrm6_dst_ops,
298 .dst_lookup = xfrm6_dst_lookup, 298 .dst_lookup = xfrm6_dst_lookup,
299 .get_saddr = xfrm6_get_saddr, 299 .get_saddr = xfrm6_get_saddr,
300 .decode_session = _decode_session6, 300 .decode_session = _decode_session6,
301 .get_tos = xfrm6_get_tos, 301 .get_tos = xfrm6_get_tos,
302 .init_dst = xfrm6_init_dst, 302 .init_dst = xfrm6_init_dst,
@@ -319,9 +319,9 @@ static void xfrm6_policy_fini(void)
319static struct ctl_table xfrm6_policy_table[] = { 319static struct ctl_table xfrm6_policy_table[] = {
320 { 320 {
321 .procname = "xfrm6_gc_thresh", 321 .procname = "xfrm6_gc_thresh",
322 .data = &init_net.xfrm.xfrm6_dst_ops.gc_thresh, 322 .data = &init_net.xfrm.xfrm6_dst_ops.gc_thresh,
323 .maxlen = sizeof(int), 323 .maxlen = sizeof(int),
324 .mode = 0644, 324 .mode = 0644,
325 .proc_handler = proc_dointvec, 325 .proc_handler = proc_dointvec,
326 }, 326 },
327 { } 327 { }
diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c
index 3fc970135fc6..8a1f9c0d2a13 100644
--- a/net/ipv6/xfrm6_state.c
+++ b/net/ipv6/xfrm6_state.c
@@ -3,11 +3,11 @@
3 * 3 *
4 * Authors: 4 * Authors:
5 * Mitsuru KANDA @USAGI 5 * Mitsuru KANDA @USAGI
6 * Kazunori MIYAZAWA @USAGI 6 * Kazunori MIYAZAWA @USAGI
7 * Kunihiro Ishiguro <kunihiro@ipinfusion.com> 7 * Kunihiro Ishiguro <kunihiro@ipinfusion.com>
8 * IPv6 support 8 * IPv6 support
9 * YOSHIFUJI Hideaki @USAGI 9 * YOSHIFUJI Hideaki @USAGI
10 * Split up af-specific portion 10 * Split up af-specific portion
11 * 11 *
12 */ 12 */
13 13
@@ -45,10 +45,10 @@ xfrm6_init_temprop(struct xfrm_state *x, const struct xfrm_tmpl *tmpl,
45 const xfrm_address_t *daddr, const xfrm_address_t *saddr) 45 const xfrm_address_t *daddr, const xfrm_address_t *saddr)
46{ 46{
47 x->id = tmpl->id; 47 x->id = tmpl->id;
48 if (ipv6_addr_any((struct in6_addr*)&x->id.daddr)) 48 if (ipv6_addr_any((struct in6_addr *)&x->id.daddr))
49 memcpy(&x->id.daddr, daddr, sizeof(x->sel.daddr)); 49 memcpy(&x->id.daddr, daddr, sizeof(x->sel.daddr));
50 memcpy(&x->props.saddr, &tmpl->saddr, sizeof(x->props.saddr)); 50 memcpy(&x->props.saddr, &tmpl->saddr, sizeof(x->props.saddr));
51 if (ipv6_addr_any((struct in6_addr*)&x->props.saddr)) 51 if (ipv6_addr_any((struct in6_addr *)&x->props.saddr))
52 memcpy(&x->props.saddr, saddr, sizeof(x->props.saddr)); 52 memcpy(&x->props.saddr, saddr, sizeof(x->props.saddr));
53 x->props.mode = tmpl->mode; 53 x->props.mode = tmpl->mode;
54 x->props.reqid = tmpl->reqid; 54 x->props.reqid = tmpl->reqid;
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c
index 1c66465a42dd..7b2508be24fd 100644
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -15,7 +15,7 @@
15 * along with this program; if not, see <http://www.gnu.org/licenses/>. 15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 * 16 *
17 * Authors Mitsuru KANDA <mk@linux-ipv6.org> 17 * Authors Mitsuru KANDA <mk@linux-ipv6.org>
18 * YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> 18 * YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
19 * 19 *
20 * Based on net/ipv4/xfrm4_tunnel.c 20 * Based on net/ipv4/xfrm4_tunnel.c
21 * 21 *