diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/addrconf.c | 2 | ||||
-rw-r--r-- | net/ipv6/addrlabel.c | 5 | ||||
-rw-r--r-- | net/ipv6/af_inet6.c | 6 | ||||
-rw-r--r-- | net/ipv6/exthdrs_core.c | 4 | ||||
-rw-r--r-- | net/ipv6/ip6_output.c | 4 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 8 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 14 | ||||
-rw-r--r-- | net/ipv6/raw.c | 12 | ||||
-rw-r--r-- | net/ipv6/route.c | 14 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 2 | ||||
-rw-r--r-- | net/ipv6/xfrm6_policy.c | 2 |
11 files changed, 36 insertions, 37 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 5bc893e28008..89aa54394a08 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -243,7 +243,7 @@ static inline bool addrconf_qdisc_ok(const struct net_device *dev) | |||
243 | /* Check if a route is valid prefix route */ | 243 | /* Check if a route is valid prefix route */ |
244 | static inline int addrconf_is_prefix_route(const struct rt6_info *rt) | 244 | static inline int addrconf_is_prefix_route(const struct rt6_info *rt) |
245 | { | 245 | { |
246 | return ((rt->rt6i_flags & (RTF_GATEWAY | RTF_DEFAULT)) == 0); | 246 | return (rt->rt6i_flags & (RTF_GATEWAY | RTF_DEFAULT)) == 0; |
247 | } | 247 | } |
248 | 248 | ||
249 | static void addrconf_del_timer(struct inet6_ifaddr *ifp) | 249 | static void addrconf_del_timer(struct inet6_ifaddr *ifp) |
diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c index f0e774cea386..921dcf6c271a 100644 --- a/net/ipv6/addrlabel.c +++ b/net/ipv6/addrlabel.c | |||
@@ -513,10 +513,9 @@ static int ip6addrlbl_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
513 | 513 | ||
514 | static inline int ip6addrlbl_msgsize(void) | 514 | static inline int ip6addrlbl_msgsize(void) |
515 | { | 515 | { |
516 | return (NLMSG_ALIGN(sizeof(struct ifaddrlblmsg)) | 516 | return NLMSG_ALIGN(sizeof(struct ifaddrlblmsg)) |
517 | + nla_total_size(16) /* IFAL_ADDRESS */ | 517 | + nla_total_size(16) /* IFAL_ADDRESS */ |
518 | + nla_total_size(4) /* IFAL_LABEL */ | 518 | + nla_total_size(4); /* IFAL_LABEL */ |
519 | ); | ||
520 | } | 519 | } |
521 | 520 | ||
522 | static int ip6addrlbl_get(struct sk_buff *in_skb, struct nlmsghdr* nlh, | 521 | static int ip6addrlbl_get(struct sk_buff *in_skb, struct nlmsghdr* nlh, |
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 56b9bf2516f4..60220985bb80 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -467,7 +467,7 @@ int inet6_getname(struct socket *sock, struct sockaddr *uaddr, | |||
467 | if (ipv6_addr_type(&sin->sin6_addr) & IPV6_ADDR_LINKLOCAL) | 467 | if (ipv6_addr_type(&sin->sin6_addr) & IPV6_ADDR_LINKLOCAL) |
468 | sin->sin6_scope_id = sk->sk_bound_dev_if; | 468 | sin->sin6_scope_id = sk->sk_bound_dev_if; |
469 | *uaddr_len = sizeof(*sin); | 469 | *uaddr_len = sizeof(*sin); |
470 | return(0); | 470 | return 0; |
471 | } | 471 | } |
472 | 472 | ||
473 | EXPORT_SYMBOL(inet6_getname); | 473 | EXPORT_SYMBOL(inet6_getname); |
@@ -488,7 +488,7 @@ int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
488 | case SIOCADDRT: | 488 | case SIOCADDRT: |
489 | case SIOCDELRT: | 489 | case SIOCDELRT: |
490 | 490 | ||
491 | return(ipv6_route_ioctl(net, cmd, (void __user *)arg)); | 491 | return ipv6_route_ioctl(net, cmd, (void __user *)arg); |
492 | 492 | ||
493 | case SIOCSIFADDR: | 493 | case SIOCSIFADDR: |
494 | return addrconf_add_ifaddr(net, (void __user *) arg); | 494 | return addrconf_add_ifaddr(net, (void __user *) arg); |
@@ -502,7 +502,7 @@ int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
502 | return sk->sk_prot->ioctl(sk, cmd, arg); | 502 | return sk->sk_prot->ioctl(sk, cmd, arg); |
503 | } | 503 | } |
504 | /*NOTREACHED*/ | 504 | /*NOTREACHED*/ |
505 | return(0); | 505 | return 0; |
506 | } | 506 | } |
507 | 507 | ||
508 | EXPORT_SYMBOL(inet6_ioctl); | 508 | EXPORT_SYMBOL(inet6_ioctl); |
diff --git a/net/ipv6/exthdrs_core.c b/net/ipv6/exthdrs_core.c index e1caa5d526c2..14ed0a955b56 100644 --- a/net/ipv6/exthdrs_core.c +++ b/net/ipv6/exthdrs_core.c | |||
@@ -13,12 +13,12 @@ int ipv6_ext_hdr(u8 nexthdr) | |||
13 | /* | 13 | /* |
14 | * find out if nexthdr is an extension header or a protocol | 14 | * find out if nexthdr is an extension header or a protocol |
15 | */ | 15 | */ |
16 | return ( (nexthdr == NEXTHDR_HOP) || | 16 | return (nexthdr == NEXTHDR_HOP) || |
17 | (nexthdr == NEXTHDR_ROUTING) || | 17 | (nexthdr == NEXTHDR_ROUTING) || |
18 | (nexthdr == NEXTHDR_FRAGMENT) || | 18 | (nexthdr == NEXTHDR_FRAGMENT) || |
19 | (nexthdr == NEXTHDR_AUTH) || | 19 | (nexthdr == NEXTHDR_AUTH) || |
20 | (nexthdr == NEXTHDR_NONE) || | 20 | (nexthdr == NEXTHDR_NONE) || |
21 | (nexthdr == NEXTHDR_DEST) ); | 21 | (nexthdr == NEXTHDR_DEST); |
22 | } | 22 | } |
23 | 23 | ||
24 | /* | 24 | /* |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 1838927a2243..efbbbce68f9e 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -870,8 +870,8 @@ static inline int ip6_rt_check(struct rt6key *rt_key, | |||
870 | struct in6_addr *fl_addr, | 870 | struct in6_addr *fl_addr, |
871 | struct in6_addr *addr_cache) | 871 | struct in6_addr *addr_cache) |
872 | { | 872 | { |
873 | return ((rt_key->plen != 128 || !ipv6_addr_equal(fl_addr, &rt_key->addr)) && | 873 | return (rt_key->plen != 128 || !ipv6_addr_equal(fl_addr, &rt_key->addr)) && |
874 | (addr_cache == NULL || !ipv6_addr_equal(fl_addr, addr_cache))); | 874 | (addr_cache == NULL || !ipv6_addr_equal(fl_addr, addr_cache)); |
875 | } | 875 | } |
876 | 876 | ||
877 | static struct dst_entry *ip6_sk_dst_check(struct sock *sk, | 877 | static struct dst_entry *ip6_sk_dst_check(struct sock *sk, |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 69a0051cea67..b3dd844cd34f 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -228,12 +228,12 @@ static struct nd_opt_hdr *ndisc_next_option(struct nd_opt_hdr *cur, | |||
228 | do { | 228 | do { |
229 | cur = ((void *)cur) + (cur->nd_opt_len << 3); | 229 | cur = ((void *)cur) + (cur->nd_opt_len << 3); |
230 | } while(cur < end && cur->nd_opt_type != type); | 230 | } while(cur < end && cur->nd_opt_type != type); |
231 | return (cur <= end && cur->nd_opt_type == type ? cur : NULL); | 231 | return cur <= end && cur->nd_opt_type == type ? cur : NULL; |
232 | } | 232 | } |
233 | 233 | ||
234 | static inline int ndisc_is_useropt(struct nd_opt_hdr *opt) | 234 | static inline int ndisc_is_useropt(struct nd_opt_hdr *opt) |
235 | { | 235 | { |
236 | return (opt->nd_opt_type == ND_OPT_RDNSS); | 236 | return opt->nd_opt_type == ND_OPT_RDNSS; |
237 | } | 237 | } |
238 | 238 | ||
239 | static struct nd_opt_hdr *ndisc_next_useropt(struct nd_opt_hdr *cur, | 239 | static struct nd_opt_hdr *ndisc_next_useropt(struct nd_opt_hdr *cur, |
@@ -244,7 +244,7 @@ static struct nd_opt_hdr *ndisc_next_useropt(struct nd_opt_hdr *cur, | |||
244 | do { | 244 | do { |
245 | cur = ((void *)cur) + (cur->nd_opt_len << 3); | 245 | cur = ((void *)cur) + (cur->nd_opt_len << 3); |
246 | } while(cur < end && !ndisc_is_useropt(cur)); | 246 | } while(cur < end && !ndisc_is_useropt(cur)); |
247 | return (cur <= end && ndisc_is_useropt(cur) ? cur : NULL); | 247 | return cur <= end && ndisc_is_useropt(cur) ? cur : NULL; |
248 | } | 248 | } |
249 | 249 | ||
250 | static struct ndisc_options *ndisc_parse_options(u8 *opt, int opt_len, | 250 | static struct ndisc_options *ndisc_parse_options(u8 *opt, int opt_len, |
@@ -319,7 +319,7 @@ static inline u8 *ndisc_opt_addr_data(struct nd_opt_hdr *p, | |||
319 | int prepad = ndisc_addr_option_pad(dev->type); | 319 | int prepad = ndisc_addr_option_pad(dev->type); |
320 | if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len + prepad)) | 320 | if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len + prepad)) |
321 | return NULL; | 321 | return NULL; |
322 | return (lladdr + prepad); | 322 | return lladdr + prepad; |
323 | } | 323 | } |
324 | 324 | ||
325 | int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir) | 325 | int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir) |
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 8e754be92c24..6b331e9b5706 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -82,13 +82,13 @@ EXPORT_SYMBOL_GPL(ip6t_alloc_initial_table); | |||
82 | int | 82 | int |
83 | ip6t_ext_hdr(u8 nexthdr) | 83 | ip6t_ext_hdr(u8 nexthdr) |
84 | { | 84 | { |
85 | return ( (nexthdr == IPPROTO_HOPOPTS) || | 85 | return (nexthdr == IPPROTO_HOPOPTS) || |
86 | (nexthdr == IPPROTO_ROUTING) || | 86 | (nexthdr == IPPROTO_ROUTING) || |
87 | (nexthdr == IPPROTO_FRAGMENT) || | 87 | (nexthdr == IPPROTO_FRAGMENT) || |
88 | (nexthdr == IPPROTO_ESP) || | 88 | (nexthdr == IPPROTO_ESP) || |
89 | (nexthdr == IPPROTO_AH) || | 89 | (nexthdr == IPPROTO_AH) || |
90 | (nexthdr == IPPROTO_NONE) || | 90 | (nexthdr == IPPROTO_NONE) || |
91 | (nexthdr == IPPROTO_DSTOPTS) ); | 91 | (nexthdr == IPPROTO_DSTOPTS); |
92 | } | 92 | } |
93 | 93 | ||
94 | /* Returns whether matches rule or not. */ | 94 | /* Returns whether matches rule or not. */ |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index e677937a07fc..45e6efb7f171 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -764,7 +764,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
764 | return -EINVAL; | 764 | return -EINVAL; |
765 | 765 | ||
766 | if (sin6->sin6_family && sin6->sin6_family != AF_INET6) | 766 | if (sin6->sin6_family && sin6->sin6_family != AF_INET6) |
767 | return(-EAFNOSUPPORT); | 767 | return -EAFNOSUPPORT; |
768 | 768 | ||
769 | /* port is the proto value [0..255] carried in nexthdr */ | 769 | /* port is the proto value [0..255] carried in nexthdr */ |
770 | proto = ntohs(sin6->sin6_port); | 770 | proto = ntohs(sin6->sin6_port); |
@@ -772,10 +772,10 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
772 | if (!proto) | 772 | if (!proto) |
773 | proto = inet->inet_num; | 773 | proto = inet->inet_num; |
774 | else if (proto != inet->inet_num) | 774 | else if (proto != inet->inet_num) |
775 | return(-EINVAL); | 775 | return -EINVAL; |
776 | 776 | ||
777 | if (proto > 255) | 777 | if (proto > 255) |
778 | return(-EINVAL); | 778 | return -EINVAL; |
779 | 779 | ||
780 | daddr = &sin6->sin6_addr; | 780 | daddr = &sin6->sin6_addr; |
781 | if (np->sndflow) { | 781 | if (np->sndflow) { |
@@ -985,7 +985,7 @@ static int do_rawv6_setsockopt(struct sock *sk, int level, int optname, | |||
985 | /* You may get strange result with a positive odd offset; | 985 | /* You may get strange result with a positive odd offset; |
986 | RFC2292bis agrees with me. */ | 986 | RFC2292bis agrees with me. */ |
987 | if (val > 0 && (val&1)) | 987 | if (val > 0 && (val&1)) |
988 | return(-EINVAL); | 988 | return -EINVAL; |
989 | if (val < 0) { | 989 | if (val < 0) { |
990 | rp->checksum = 0; | 990 | rp->checksum = 0; |
991 | } else { | 991 | } else { |
@@ -997,7 +997,7 @@ static int do_rawv6_setsockopt(struct sock *sk, int level, int optname, | |||
997 | break; | 997 | break; |
998 | 998 | ||
999 | default: | 999 | default: |
1000 | return(-ENOPROTOOPT); | 1000 | return -ENOPROTOOPT; |
1001 | } | 1001 | } |
1002 | } | 1002 | } |
1003 | 1003 | ||
@@ -1190,7 +1190,7 @@ static int rawv6_init_sk(struct sock *sk) | |||
1190 | default: | 1190 | default: |
1191 | break; | 1191 | break; |
1192 | } | 1192 | } |
1193 | return(0); | 1193 | return 0; |
1194 | } | 1194 | } |
1195 | 1195 | ||
1196 | struct proto rawv6_prot = { | 1196 | struct proto rawv6_prot = { |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index d126365ac046..25b0beda4331 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -217,14 +217,14 @@ static void ip6_dst_ifdown(struct dst_entry *dst, struct net_device *dev, | |||
217 | 217 | ||
218 | static __inline__ int rt6_check_expired(const struct rt6_info *rt) | 218 | static __inline__ int rt6_check_expired(const struct rt6_info *rt) |
219 | { | 219 | { |
220 | return (rt->rt6i_flags & RTF_EXPIRES && | 220 | return (rt->rt6i_flags & RTF_EXPIRES) && |
221 | time_after(jiffies, rt->rt6i_expires)); | 221 | time_after(jiffies, rt->rt6i_expires); |
222 | } | 222 | } |
223 | 223 | ||
224 | static inline int rt6_need_strict(struct in6_addr *daddr) | 224 | static inline int rt6_need_strict(struct in6_addr *daddr) |
225 | { | 225 | { |
226 | return (ipv6_addr_type(daddr) & | 226 | return ipv6_addr_type(daddr) & |
227 | (IPV6_ADDR_MULTICAST | IPV6_ADDR_LINKLOCAL | IPV6_ADDR_LOOPBACK)); | 227 | (IPV6_ADDR_MULTICAST | IPV6_ADDR_LINKLOCAL | IPV6_ADDR_LOOPBACK); |
228 | } | 228 | } |
229 | 229 | ||
230 | /* | 230 | /* |
@@ -440,7 +440,7 @@ static struct rt6_info *rt6_select(struct fib6_node *fn, int oif, int strict) | |||
440 | __func__, match); | 440 | __func__, match); |
441 | 441 | ||
442 | net = dev_net(rt0->rt6i_dev); | 442 | net = dev_net(rt0->rt6i_dev); |
443 | return (match ? match : net->ipv6.ip6_null_entry); | 443 | return match ? match : net->ipv6.ip6_null_entry; |
444 | } | 444 | } |
445 | 445 | ||
446 | #ifdef CONFIG_IPV6_ROUTE_INFO | 446 | #ifdef CONFIG_IPV6_ROUTE_INFO |
@@ -859,7 +859,7 @@ int ip6_dst_blackhole(struct sock *sk, struct dst_entry **dstp, struct flowi *fl | |||
859 | 859 | ||
860 | dst_release(*dstp); | 860 | dst_release(*dstp); |
861 | *dstp = new; | 861 | *dstp = new; |
862 | return (new ? 0 : -ENOMEM); | 862 | return new ? 0 : -ENOMEM; |
863 | } | 863 | } |
864 | EXPORT_SYMBOL_GPL(ip6_dst_blackhole); | 864 | EXPORT_SYMBOL_GPL(ip6_dst_blackhole); |
865 | 865 | ||
@@ -1070,7 +1070,7 @@ static int ip6_dst_gc(struct dst_ops *ops) | |||
1070 | net->ipv6.ip6_rt_gc_expire = rt_gc_timeout>>1; | 1070 | net->ipv6.ip6_rt_gc_expire = rt_gc_timeout>>1; |
1071 | out: | 1071 | out: |
1072 | net->ipv6.ip6_rt_gc_expire -= net->ipv6.ip6_rt_gc_expire>>rt_elasticity; | 1072 | net->ipv6.ip6_rt_gc_expire -= net->ipv6.ip6_rt_gc_expire>>rt_elasticity; |
1073 | return (atomic_read(&ops->entries) > rt_max_size); | 1073 | return atomic_read(&ops->entries) > rt_max_size; |
1074 | } | 1074 | } |
1075 | 1075 | ||
1076 | /* Clean host part of a prefix. Not necessary in radix tree, | 1076 | /* Clean host part of a prefix. Not necessary in radix tree, |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index fe6d40418c0b..8d93f6d81979 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -139,7 +139,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, | |||
139 | return -EINVAL; | 139 | return -EINVAL; |
140 | 140 | ||
141 | if (usin->sin6_family != AF_INET6) | 141 | if (usin->sin6_family != AF_INET6) |
142 | return(-EAFNOSUPPORT); | 142 | return -EAFNOSUPPORT; |
143 | 143 | ||
144 | memset(&fl, 0, sizeof(fl)); | 144 | memset(&fl, 0, sizeof(fl)); |
145 | 145 | ||
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 6baeabbbca82..39676eac3a37 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c | |||
@@ -199,7 +199,7 @@ static inline int xfrm6_garbage_collect(struct dst_ops *ops) | |||
199 | struct net *net = container_of(ops, struct net, xfrm.xfrm6_dst_ops); | 199 | struct net *net = container_of(ops, struct net, xfrm.xfrm6_dst_ops); |
200 | 200 | ||
201 | xfrm6_policy_afinfo.garbage_collect(net); | 201 | xfrm6_policy_afinfo.garbage_collect(net); |
202 | return (atomic_read(&ops->entries) > ops->gc_thresh * 2); | 202 | return atomic_read(&ops->entries) > ops->gc_thresh * 2; |
203 | } | 203 | } |
204 | 204 | ||
205 | static void xfrm6_update_pmtu(struct dst_entry *dst, u32 mtu) | 205 | static void xfrm6_update_pmtu(struct dst_entry *dst, u32 mtu) |