aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/8021q/vlan.c2
-rw-r--r--net/bridge/br_input.c6
-rw-r--r--net/bridge/netfilter/ebt_log.c7
-rw-r--r--net/bridge/netfilter/ebt_ulog.c9
-rw-r--r--net/ipv4/netfilter/ipt_LOG.c6
-rw-r--r--net/ipv4/netfilter/nf_nat_core.c3
-rw-r--r--net/ipv4/netfilter/nf_nat_rule.c2
-rw-r--r--net/ipv6/ip6_tunnel.c17
-rw-r--r--net/ipv6/netfilter/ip6t_LOG.c6
-rw-r--r--net/ipv6/tcp_ipv6.c1
-rw-r--r--net/iucv/iucv.c15
-rw-r--r--net/key/af_key.c4
-rw-r--r--net/netfilter/nf_conntrack_core.c3
-rw-r--r--net/netfilter/nf_conntrack_expect.c8
-rw-r--r--net/netfilter/nf_conntrack_helper.c2
-rw-r--r--net/netfilter/nf_conntrack_proto_tcp.c1
-rw-r--r--net/netfilter/nf_conntrack_proto_udp.c1
-rw-r--r--net/netfilter/nf_conntrack_proto_udplite.c1
-rw-r--r--net/netfilter/xt_connlimit.c6
-rw-r--r--net/netfilter/xt_physdev.c1
-rw-r--r--net/netfilter/xt_u32.c11
-rw-r--r--net/netlink/genetlink.c28
-rw-r--r--net/rxrpc/af_rxrpc.c2
-rw-r--r--net/rxrpc/ar-connection.c6
-rw-r--r--net/rxrpc/ar-transport.c4
-rw-r--r--net/rxrpc/rxkad.c2
-rw-r--r--net/sunrpc/auth_gss/svcauth_gss.c9
-rw-r--r--net/sunrpc/svcsock.c4
-rw-r--r--net/tipc/msg.h6
29 files changed, 85 insertions, 88 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index cda936b77d2..1583c5ef963 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -810,6 +810,7 @@ static int vlan_ioctl_handler(void __user *arg)
810 err = -EINVAL; 810 err = -EINVAL;
811 break; 811 break;
812 case GET_VLAN_REALDEV_NAME_CMD: 812 case GET_VLAN_REALDEV_NAME_CMD:
813 err = 0;
813 vlan_dev_get_realdev_name(dev, args.u.device2); 814 vlan_dev_get_realdev_name(dev, args.u.device2);
814 if (copy_to_user(arg, &args, 815 if (copy_to_user(arg, &args,
815 sizeof(struct vlan_ioctl_args))) { 816 sizeof(struct vlan_ioctl_args))) {
@@ -818,6 +819,7 @@ static int vlan_ioctl_handler(void __user *arg)
818 break; 819 break;
819 820
820 case GET_VLAN_VID_CMD: 821 case GET_VLAN_VID_CMD:
822 err = 0;
821 vlan_dev_get_vid(dev, &vid); 823 vlan_dev_get_vid(dev, &vid);
822 args.u.VID = vid; 824 args.u.VID = vid;
823 if (copy_to_user(arg, &args, 825 if (copy_to_user(arg, &args,
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 420bbb9955e..5c18595b761 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -112,9 +112,9 @@ static int br_handle_local_finish(struct sk_buff *skb)
112 */ 112 */
113static inline int is_link_local(const unsigned char *dest) 113static inline int is_link_local(const unsigned char *dest)
114{ 114{
115 const u16 *a = (const u16 *) dest; 115 __be16 *a = (__be16 *)dest;
116 static const u16 *const b = (const u16 *const ) br_group_address; 116 static const __be16 *b = (const __be16 *)br_group_address;
117 static const u16 m = __constant_cpu_to_be16(0xfff0); 117 static const __be16 m = __constant_cpu_to_be16(0xfff0);
118 118
119 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0; 119 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0;
120} 120}
diff --git a/net/bridge/netfilter/ebt_log.c b/net/bridge/netfilter/ebt_log.c
index 031bfa4a51f..457815fb558 100644
--- a/net/bridge/netfilter/ebt_log.c
+++ b/net/bridge/netfilter/ebt_log.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/in.h>
13#include <linux/netfilter_bridge/ebtables.h> 12#include <linux/netfilter_bridge/ebtables.h>
14#include <linux/netfilter_bridge/ebt_log.h> 13#include <linux/netfilter_bridge/ebt_log.h>
15#include <linux/netfilter.h> 14#include <linux/netfilter.h>
@@ -196,10 +195,8 @@ static int __init ebt_log_init(void)
196 ret = ebt_register_watcher(&log); 195 ret = ebt_register_watcher(&log);
197 if (ret < 0) 196 if (ret < 0)
198 return ret; 197 return ret;
199 ret = nf_log_register(PF_BRIDGE, &ebt_log_logger); 198 nf_log_register(PF_BRIDGE, &ebt_log_logger);
200 if (ret < 0 && ret != -EEXIST) 199 return 0;
201 ebt_unregister_watcher(&log);
202 return ret;
203} 200}
204 201
205static void __exit ebt_log_fini(void) 202static void __exit ebt_log_fini(void)
diff --git a/net/bridge/netfilter/ebt_ulog.c b/net/bridge/netfilter/ebt_ulog.c
index 9411db62591..204c968fa86 100644
--- a/net/bridge/netfilter/ebt_ulog.c
+++ b/net/bridge/netfilter/ebt_ulog.c
@@ -36,7 +36,6 @@
36#include <linux/timer.h> 36#include <linux/timer.h>
37#include <linux/netlink.h> 37#include <linux/netlink.h>
38#include <linux/netdevice.h> 38#include <linux/netdevice.h>
39#include <linux/module.h>
40#include <linux/netfilter_bridge/ebtables.h> 39#include <linux/netfilter_bridge/ebtables.h>
41#include <linux/netfilter_bridge/ebt_ulog.h> 40#include <linux/netfilter_bridge/ebt_ulog.h>
42#include <net/sock.h> 41#include <net/sock.h>
@@ -308,12 +307,8 @@ static int __init ebt_ulog_init(void)
308 else if ((ret = ebt_register_watcher(&ulog))) 307 else if ((ret = ebt_register_watcher(&ulog)))
309 sock_release(ebtulognl->sk_socket); 308 sock_release(ebtulognl->sk_socket);
310 309
311 if (nf_log_register(PF_BRIDGE, &ebt_ulog_logger) < 0) { 310 if (ret == 0)
312 printk(KERN_WARNING "ebt_ulog: not logging via ulog " 311 nf_log_register(PF_BRIDGE, &ebt_ulog_logger);
313 "since somebody else already registered for PF_BRIDGE\n");
314 /* we cannot make module load fail here, since otherwise
315 * ebtables userspace would abort */
316 }
317 312
318 return ret; 313 return ret;
319} 314}
diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c
index 5937ad150b9..127a5e89bf1 100644
--- a/net/ipv4/netfilter/ipt_LOG.c
+++ b/net/ipv4/netfilter/ipt_LOG.c
@@ -479,10 +479,8 @@ static int __init ipt_log_init(void)
479 ret = xt_register_target(&ipt_log_reg); 479 ret = xt_register_target(&ipt_log_reg);
480 if (ret < 0) 480 if (ret < 0)
481 return ret; 481 return ret;
482 ret = nf_log_register(PF_INET, &ipt_log_logger); 482 nf_log_register(PF_INET, &ipt_log_logger);
483 if (ret < 0 && ret != -EEXIST) 483 return 0;
484 xt_unregister_target(&ipt_log_reg);
485 return ret;
486} 484}
487 485
488static void __exit ipt_log_fini(void) 486static void __exit ipt_log_fini(void)
diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c
index e848d8d6292..deab27facba 100644
--- a/net/ipv4/netfilter/nf_nat_core.c
+++ b/net/ipv4/netfilter/nf_nat_core.c
@@ -77,7 +77,8 @@ static inline unsigned int
77hash_by_src(const struct nf_conntrack_tuple *tuple) 77hash_by_src(const struct nf_conntrack_tuple *tuple)
78{ 78{
79 /* Original src, to ensure we map it consistently if poss. */ 79 /* Original src, to ensure we map it consistently if poss. */
80 return jhash_3words((__force u32)tuple->src.u3.ip, tuple->src.u.all, 80 return jhash_3words((__force u32)tuple->src.u3.ip,
81 (__force u32)tuple->src.u.all,
81 tuple->dst.protonum, 0) % nf_nat_htable_size; 82 tuple->dst.protonum, 0) % nf_nat_htable_size;
82} 83}
83 84
diff --git a/net/ipv4/netfilter/nf_nat_rule.c b/net/ipv4/netfilter/nf_nat_rule.c
index 0f45427e5fd..76ec59ae524 100644
--- a/net/ipv4/netfilter/nf_nat_rule.c
+++ b/net/ipv4/netfilter/nf_nat_rule.c
@@ -192,7 +192,7 @@ alloc_null_binding_confirmed(struct nf_conn *ct, unsigned int hooknum)
192 = (HOOK2MANIP(hooknum) == IP_NAT_MANIP_SRC 192 = (HOOK2MANIP(hooknum) == IP_NAT_MANIP_SRC
193 ? ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip 193 ? ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip
194 : ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3.ip); 194 : ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3.ip);
195 u_int16_t all 195 __be16 all
196 = (HOOK2MANIP(hooknum) == IP_NAT_MANIP_SRC 196 = (HOOK2MANIP(hooknum) == IP_NAT_MANIP_SRC
197 ? ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u.all 197 ? ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u.all
198 : ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u.all); 198 : ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u.all);
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index df30976f6df..ca774d8e3be 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -385,7 +385,7 @@ parse_tlv_tnl_enc_lim(struct sk_buff *skb, __u8 * raw)
385 385
386static int 386static int
387ip6_tnl_err(struct sk_buff *skb, __u8 ipproto, struct inet6_skb_parm *opt, 387ip6_tnl_err(struct sk_buff *skb, __u8 ipproto, struct inet6_skb_parm *opt,
388 int *type, int *code, int *msg, __be32 *info, int offset) 388 int *type, int *code, int *msg, __u32 *info, int offset)
389{ 389{
390 struct ipv6hdr *ipv6h = (struct ipv6hdr *) skb->data; 390 struct ipv6hdr *ipv6h = (struct ipv6hdr *) skb->data;
391 struct ip6_tnl *t; 391 struct ip6_tnl *t;
@@ -435,7 +435,7 @@ ip6_tnl_err(struct sk_buff *skb, __u8 ipproto, struct inet6_skb_parm *opt,
435 if ((*code) == ICMPV6_HDR_FIELD) 435 if ((*code) == ICMPV6_HDR_FIELD)
436 teli = parse_tlv_tnl_enc_lim(skb, skb->data); 436 teli = parse_tlv_tnl_enc_lim(skb, skb->data);
437 437
438 if (teli && teli == ntohl(*info) - 2) { 438 if (teli && teli == *info - 2) {
439 tel = (struct ipv6_tlv_tnl_enc_lim *) &skb->data[teli]; 439 tel = (struct ipv6_tlv_tnl_enc_lim *) &skb->data[teli];
440 if (tel->encap_limit == 0) { 440 if (tel->encap_limit == 0) {
441 if (net_ratelimit()) 441 if (net_ratelimit())
@@ -452,7 +452,7 @@ ip6_tnl_err(struct sk_buff *skb, __u8 ipproto, struct inet6_skb_parm *opt,
452 } 452 }
453 break; 453 break;
454 case ICMPV6_PKT_TOOBIG: 454 case ICMPV6_PKT_TOOBIG:
455 mtu = ntohl(*info) - offset; 455 mtu = *info - offset;
456 if (mtu < IPV6_MIN_MTU) 456 if (mtu < IPV6_MIN_MTU)
457 mtu = IPV6_MIN_MTU; 457 mtu = IPV6_MIN_MTU;
458 t->dev->mtu = mtu; 458 t->dev->mtu = mtu;
@@ -478,12 +478,12 @@ out:
478 478
479static int 479static int
480ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, 480ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
481 int type, int code, int offset, __u32 info) 481 int type, int code, int offset, __be32 info)
482{ 482{
483 int rel_msg = 0; 483 int rel_msg = 0;
484 int rel_type = type; 484 int rel_type = type;
485 int rel_code = code; 485 int rel_code = code;
486 __u32 rel_info = info; 486 __u32 rel_info = ntohl(info);
487 int err; 487 int err;
488 struct sk_buff *skb2; 488 struct sk_buff *skb2;
489 struct iphdr *eiph; 489 struct iphdr *eiph;
@@ -564,10 +564,9 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
564 goto out; 564 goto out;
565 565
566 skb2->dst->ops->update_pmtu(skb2->dst, rel_info); 566 skb2->dst->ops->update_pmtu(skb2->dst, rel_info);
567 rel_info = htonl(rel_info);
568 } 567 }
569 568
570 icmp_send(skb2, rel_type, rel_code, rel_info); 569 icmp_send(skb2, rel_type, rel_code, htonl(rel_info));
571 570
572out: 571out:
573 kfree_skb(skb2); 572 kfree_skb(skb2);
@@ -576,12 +575,12 @@ out:
576 575
577static int 576static int
578ip6ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, 577ip6ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
579 int type, int code, int offset, __u32 info) 578 int type, int code, int offset, __be32 info)
580{ 579{
581 int rel_msg = 0; 580 int rel_msg = 0;
582 int rel_type = type; 581 int rel_type = type;
583 int rel_code = code; 582 int rel_code = code;
584 __u32 rel_info = info; 583 __u32 rel_info = ntohl(info);
585 int err; 584 int err;
586 585
587 err = ip6_tnl_err(skb, IPPROTO_IPV6, opt, &rel_type, &rel_code, 586 err = ip6_tnl_err(skb, IPPROTO_IPV6, opt, &rel_type, &rel_code,
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c
index b05327ebd33..6ab99001dcc 100644
--- a/net/ipv6/netfilter/ip6t_LOG.c
+++ b/net/ipv6/netfilter/ip6t_LOG.c
@@ -493,10 +493,8 @@ static int __init ip6t_log_init(void)
493 ret = xt_register_target(&ip6t_log_reg); 493 ret = xt_register_target(&ip6t_log_reg);
494 if (ret < 0) 494 if (ret < 0)
495 return ret; 495 return ret;
496 ret = nf_log_register(PF_INET6, &ip6t_logger); 496 nf_log_register(PF_INET6, &ip6t_logger);
497 if (ret < 0 && ret != -EEXIST) 497 return 0;
498 xt_unregister_target(&ip6t_log_reg);
499 return ret;
500} 498}
501 499
502static void __exit ip6t_log_fini(void) 500static void __exit ip6t_log_fini(void)
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index d67fb1ef751..f10f3689d67 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -633,6 +633,7 @@ static int tcp_v6_md5_do_del(struct sock *sk, struct in6_addr *peer)
633 if (tp->md5sig_info->entries6 == 0) { 633 if (tp->md5sig_info->entries6 == 0) {
634 kfree(tp->md5sig_info->keys6); 634 kfree(tp->md5sig_info->keys6);
635 tp->md5sig_info->keys6 = NULL; 635 tp->md5sig_info->keys6 = NULL;
636 tp->md5sig_info->alloced6 = 0;
636 637
637 tcp_free_md5sig_pool(); 638 tcp_free_md5sig_pool();
638 639
diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c
index ad5150b8dfa..983058d432d 100644
--- a/net/iucv/iucv.c
+++ b/net/iucv/iucv.c
@@ -479,7 +479,8 @@ static void iucv_setmask_mp(void)
479 /* Enable all cpus with a declared buffer. */ 479 /* Enable all cpus with a declared buffer. */
480 if (cpu_isset(cpu, iucv_buffer_cpumask) && 480 if (cpu_isset(cpu, iucv_buffer_cpumask) &&
481 !cpu_isset(cpu, iucv_irq_cpumask)) 481 !cpu_isset(cpu, iucv_irq_cpumask))
482 smp_call_function_on(iucv_allow_cpu, NULL, 0, 1, cpu); 482 smp_call_function_single(cpu, iucv_allow_cpu,
483 NULL, 0, 1);
483 preempt_enable(); 484 preempt_enable();
484} 485}
485 486
@@ -497,7 +498,7 @@ static void iucv_setmask_up(void)
497 cpumask = iucv_irq_cpumask; 498 cpumask = iucv_irq_cpumask;
498 cpu_clear(first_cpu(iucv_irq_cpumask), cpumask); 499 cpu_clear(first_cpu(iucv_irq_cpumask), cpumask);
499 for_each_cpu_mask(cpu, cpumask) 500 for_each_cpu_mask(cpu, cpumask)
500 smp_call_function_on(iucv_block_cpu, NULL, 0, 1, cpu); 501 smp_call_function_single(cpu, iucv_block_cpu, NULL, 0, 1);
501} 502}
502 503
503/** 504/**
@@ -522,7 +523,7 @@ static int iucv_enable(void)
522 rc = -EIO; 523 rc = -EIO;
523 preempt_disable(); 524 preempt_disable();
524 for_each_online_cpu(cpu) 525 for_each_online_cpu(cpu)
525 smp_call_function_on(iucv_declare_cpu, NULL, 0, 1, cpu); 526 smp_call_function_single(cpu, iucv_declare_cpu, NULL, 0, 1);
526 preempt_enable(); 527 preempt_enable();
527 if (cpus_empty(iucv_buffer_cpumask)) 528 if (cpus_empty(iucv_buffer_cpumask))
528 /* No cpu could declare an iucv buffer. */ 529 /* No cpu could declare an iucv buffer. */
@@ -578,7 +579,7 @@ static int __cpuinit iucv_cpu_notify(struct notifier_block *self,
578 case CPU_ONLINE_FROZEN: 579 case CPU_ONLINE_FROZEN:
579 case CPU_DOWN_FAILED: 580 case CPU_DOWN_FAILED:
580 case CPU_DOWN_FAILED_FROZEN: 581 case CPU_DOWN_FAILED_FROZEN:
581 smp_call_function_on(iucv_declare_cpu, NULL, 0, 1, cpu); 582 smp_call_function_single(cpu, iucv_declare_cpu, NULL, 0, 1);
582 break; 583 break;
583 case CPU_DOWN_PREPARE: 584 case CPU_DOWN_PREPARE:
584 case CPU_DOWN_PREPARE_FROZEN: 585 case CPU_DOWN_PREPARE_FROZEN:
@@ -587,10 +588,10 @@ static int __cpuinit iucv_cpu_notify(struct notifier_block *self,
587 if (cpus_empty(cpumask)) 588 if (cpus_empty(cpumask))
588 /* Can't offline last IUCV enabled cpu. */ 589 /* Can't offline last IUCV enabled cpu. */
589 return NOTIFY_BAD; 590 return NOTIFY_BAD;
590 smp_call_function_on(iucv_retrieve_cpu, NULL, 0, 1, cpu); 591 smp_call_function_single(cpu, iucv_retrieve_cpu, NULL, 0, 1);
591 if (cpus_empty(iucv_irq_cpumask)) 592 if (cpus_empty(iucv_irq_cpumask))
592 smp_call_function_on(iucv_allow_cpu, NULL, 0, 1, 593 smp_call_function_single(first_cpu(iucv_buffer_cpumask),
593 first_cpu(iucv_buffer_cpumask)); 594 iucv_allow_cpu, NULL, 0, 1);
594 break; 595 break;
595 } 596 }
596 return NOTIFY_OK; 597 return NOTIFY_OK;
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 0f8304b0246..7b0a95abe93 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -2540,7 +2540,7 @@ static int pfkey_migrate(struct sock *sk, struct sk_buff *skb,
2540 sel.proto = pfkey_proto_to_xfrm(sa->sadb_address_proto); 2540 sel.proto = pfkey_proto_to_xfrm(sa->sadb_address_proto);
2541 sel.sport = ((struct sockaddr_in *)(sa + 1))->sin_port; 2541 sel.sport = ((struct sockaddr_in *)(sa + 1))->sin_port;
2542 if (sel.sport) 2542 if (sel.sport)
2543 sel.sport_mask = ~0; 2543 sel.sport_mask = htons(0xffff);
2544 2544
2545 /* set destination address info of selector */ 2545 /* set destination address info of selector */
2546 sa = ext_hdrs[SADB_EXT_ADDRESS_DST - 1], 2546 sa = ext_hdrs[SADB_EXT_ADDRESS_DST - 1],
@@ -2549,7 +2549,7 @@ static int pfkey_migrate(struct sock *sk, struct sk_buff *skb,
2549 sel.proto = pfkey_proto_to_xfrm(sa->sadb_address_proto); 2549 sel.proto = pfkey_proto_to_xfrm(sa->sadb_address_proto);
2550 sel.dport = ((struct sockaddr_in *)(sa + 1))->sin_port; 2550 sel.dport = ((struct sockaddr_in *)(sa + 1))->sin_port;
2551 if (sel.dport) 2551 if (sel.dport)
2552 sel.dport_mask = ~0; 2552 sel.dport_mask = htons(0xffff);
2553 2553
2554 rq = (struct sadb_x_ipsecrequest *)(pol + 1); 2554 rq = (struct sadb_x_ipsecrequest *)(pol + 1);
2555 2555
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index aa086c83af8..0fe11889ce1 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -79,7 +79,8 @@ static u_int32_t __hash_conntrack(const struct nf_conntrack_tuple *tuple,
79 a = jhash2(tuple->src.u3.all, ARRAY_SIZE(tuple->src.u3.all), 79 a = jhash2(tuple->src.u3.all, ARRAY_SIZE(tuple->src.u3.all),
80 (tuple->src.l3num << 16) | tuple->dst.protonum); 80 (tuple->src.l3num << 16) | tuple->dst.protonum);
81 b = jhash2(tuple->dst.u3.all, ARRAY_SIZE(tuple->dst.u3.all), 81 b = jhash2(tuple->dst.u3.all, ARRAY_SIZE(tuple->dst.u3.all),
82 (tuple->src.u.all << 16) | tuple->dst.u.all); 82 ((__force __u16)tuple->src.u.all << 16) |
83 (__force __u16)tuple->dst.u.all);
83 84
84 return jhash_2words(a, b, rnd) % size; 85 return jhash_2words(a, b, rnd) % size;
85} 86}
diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c
index 1aa6229ca99..eb6695dcd73 100644
--- a/net/netfilter/nf_conntrack_expect.c
+++ b/net/netfilter/nf_conntrack_expect.c
@@ -80,7 +80,7 @@ static unsigned int nf_ct_expect_dst_hash(const struct nf_conntrack_tuple *tuple
80 80
81 return jhash2(tuple->dst.u3.all, ARRAY_SIZE(tuple->dst.u3.all), 81 return jhash2(tuple->dst.u3.all, ARRAY_SIZE(tuple->dst.u3.all),
82 (((tuple->dst.protonum ^ tuple->src.l3num) << 16) | 82 (((tuple->dst.protonum ^ tuple->src.l3num) << 16) |
83 tuple->dst.u.all) ^ nf_ct_expect_hash_rnd) % 83 (__force __u16)tuple->dst.u.all) ^ nf_ct_expect_hash_rnd) %
84 nf_ct_expect_hsize; 84 nf_ct_expect_hsize;
85} 85}
86 86
@@ -259,8 +259,8 @@ void nf_ct_expect_init(struct nf_conntrack_expect *exp, int family,
259 } 259 }
260 260
261 if (src) { 261 if (src) {
262 exp->tuple.src.u.all = (__force u16)*src; 262 exp->tuple.src.u.all = *src;
263 exp->mask.src.u.all = 0xFFFF; 263 exp->mask.src.u.all = htons(0xFFFF);
264 } else { 264 } else {
265 exp->tuple.src.u.all = 0; 265 exp->tuple.src.u.all = 0;
266 exp->mask.src.u.all = 0; 266 exp->mask.src.u.all = 0;
@@ -272,7 +272,7 @@ void nf_ct_expect_init(struct nf_conntrack_expect *exp, int family,
272 memset((void *)&exp->tuple.dst.u3 + len, 0x00, 272 memset((void *)&exp->tuple.dst.u3 + len, 0x00,
273 sizeof(exp->tuple.dst.u3) - len); 273 sizeof(exp->tuple.dst.u3) - len);
274 274
275 exp->tuple.dst.u.all = (__force u16)*dst; 275 exp->tuple.dst.u.all = *dst;
276} 276}
277EXPORT_SYMBOL_GPL(nf_ct_expect_init); 277EXPORT_SYMBOL_GPL(nf_ct_expect_init);
278 278
diff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c
index ca10df40784..96aa637c093 100644
--- a/net/netfilter/nf_conntrack_helper.c
+++ b/net/netfilter/nf_conntrack_helper.c
@@ -39,7 +39,7 @@ static int nf_ct_helper_vmalloc;
39static unsigned int helper_hash(const struct nf_conntrack_tuple *tuple) 39static unsigned int helper_hash(const struct nf_conntrack_tuple *tuple)
40{ 40{
41 return (((tuple->src.l3num << 8) | tuple->dst.protonum) ^ 41 return (((tuple->src.l3num << 8) | tuple->dst.protonum) ^
42 tuple->src.u.all) % nf_ct_helper_hsize; 42 (__force __u16)tuple->src.u.all) % nf_ct_helper_hsize;
43} 43}
44 44
45struct nf_conntrack_helper * 45struct nf_conntrack_helper *
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index 87ad3ccf8af..eb3fe740146 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -8,7 +8,6 @@
8 8
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/timer.h> 10#include <linux/timer.h>
11#include <linux/netfilter.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/in.h> 12#include <linux/in.h>
14#include <linux/tcp.h> 13#include <linux/tcp.h>
diff --git a/net/netfilter/nf_conntrack_proto_udp.c b/net/netfilter/nf_conntrack_proto_udp.c
index 13d94a02572..2a2fd1a764e 100644
--- a/net/netfilter/nf_conntrack_proto_udp.c
+++ b/net/netfilter/nf_conntrack_proto_udp.c
@@ -9,7 +9,6 @@
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/timer.h> 10#include <linux/timer.h>
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/netfilter.h>
13#include <linux/udp.h> 12#include <linux/udp.h>
14#include <linux/seq_file.h> 13#include <linux/seq_file.h>
15#include <linux/skbuff.h> 14#include <linux/skbuff.h>
diff --git a/net/netfilter/nf_conntrack_proto_udplite.c b/net/netfilter/nf_conntrack_proto_udplite.c
index 93e747b5396..b906b413997 100644
--- a/net/netfilter/nf_conntrack_proto_udplite.c
+++ b/net/netfilter/nf_conntrack_proto_udplite.c
@@ -10,7 +10,6 @@
10#include <linux/types.h> 10#include <linux/types.h>
11#include <linux/timer.h> 11#include <linux/timer.h>
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/netfilter.h>
14#include <linux/udp.h> 13#include <linux/udp.h>
15#include <linux/seq_file.h> 14#include <linux/seq_file.h>
16#include <linux/skbuff.h> 15#include <linux/skbuff.h>
diff --git a/net/netfilter/xt_connlimit.c b/net/netfilter/xt_connlimit.c
index 3335dd5be96..06cff1d1369 100644
--- a/net/netfilter/xt_connlimit.c
+++ b/net/netfilter/xt_connlimit.c
@@ -42,13 +42,13 @@ struct xt_connlimit_data {
42static u_int32_t connlimit_rnd; 42static u_int32_t connlimit_rnd;
43static bool connlimit_rnd_inited; 43static bool connlimit_rnd_inited;
44 44
45static inline unsigned int connlimit_iphash(u_int32_t addr) 45static inline unsigned int connlimit_iphash(__be32 addr)
46{ 46{
47 if (unlikely(!connlimit_rnd_inited)) { 47 if (unlikely(!connlimit_rnd_inited)) {
48 get_random_bytes(&connlimit_rnd, sizeof(connlimit_rnd)); 48 get_random_bytes(&connlimit_rnd, sizeof(connlimit_rnd));
49 connlimit_rnd_inited = true; 49 connlimit_rnd_inited = true;
50 } 50 }
51 return jhash_1word(addr, connlimit_rnd) & 0xFF; 51 return jhash_1word((__force __u32)addr, connlimit_rnd) & 0xFF;
52} 52}
53 53
54static inline unsigned int 54static inline unsigned int
@@ -66,7 +66,7 @@ connlimit_iphash6(const union nf_conntrack_address *addr,
66 for (i = 0; i < ARRAY_SIZE(addr->ip6); ++i) 66 for (i = 0; i < ARRAY_SIZE(addr->ip6); ++i)
67 res.ip6[i] = addr->ip6[i] & mask->ip6[i]; 67 res.ip6[i] = addr->ip6[i] & mask->ip6[i];
68 68
69 return jhash2(res.ip6, ARRAY_SIZE(res.ip6), connlimit_rnd) & 0xFF; 69 return jhash2((u32 *)res.ip6, ARRAY_SIZE(res.ip6), connlimit_rnd) & 0xFF;
70} 70}
71 71
72static inline bool already_closed(const struct nf_conn *conn) 72static inline bool already_closed(const struct nf_conn *conn)
diff --git a/net/netfilter/xt_physdev.c b/net/netfilter/xt_physdev.c
index f47cab7a696..a4bab043a6d 100644
--- a/net/netfilter/xt_physdev.c
+++ b/net/netfilter/xt_physdev.c
@@ -13,7 +13,6 @@
13#include <linux/netfilter_bridge.h> 13#include <linux/netfilter_bridge.h>
14#include <linux/netfilter/xt_physdev.h> 14#include <linux/netfilter/xt_physdev.h>
15#include <linux/netfilter/x_tables.h> 15#include <linux/netfilter/x_tables.h>
16#include <linux/netfilter_bridge.h>
17 16
18MODULE_LICENSE("GPL"); 17MODULE_LICENSE("GPL");
19MODULE_AUTHOR("Bart De Schuymer <bdschuym@pandora.be>"); 18MODULE_AUTHOR("Bart De Schuymer <bdschuym@pandora.be>");
diff --git a/net/netfilter/xt_u32.c b/net/netfilter/xt_u32.c
index 04b677ae8da..74f9b14c012 100644
--- a/net/netfilter/xt_u32.c
+++ b/net/netfilter/xt_u32.c
@@ -21,6 +21,7 @@ static bool u32_match_it(const struct xt_u32 *data,
21 unsigned int nnums; 21 unsigned int nnums;
22 unsigned int nvals; 22 unsigned int nvals;
23 unsigned int i; 23 unsigned int i;
24 __be32 n;
24 u_int32_t pos; 25 u_int32_t pos;
25 u_int32_t val; 26 u_int32_t val;
26 u_int32_t at; 27 u_int32_t at;
@@ -38,9 +39,9 @@ static bool u32_match_it(const struct xt_u32 *data,
38 if (skb->len < 4 || pos > skb->len - 4); 39 if (skb->len < 4 || pos > skb->len - 4);
39 return false; 40 return false;
40 41
41 ret = skb_copy_bits(skb, pos, &val, sizeof(val)); 42 ret = skb_copy_bits(skb, pos, &n, sizeof(n));
42 BUG_ON(ret < 0); 43 BUG_ON(ret < 0);
43 val = ntohl(val); 44 val = ntohl(n);
44 nnums = ct->nnums; 45 nnums = ct->nnums;
45 46
46 /* Inner loop runs over "&", "<<", ">>" and "@" operands */ 47 /* Inner loop runs over "&", "<<", ">>" and "@" operands */
@@ -65,10 +66,10 @@ static bool u32_match_it(const struct xt_u32 *data,
65 pos > skb->len - at - 4) 66 pos > skb->len - at - 4)
66 return false; 67 return false;
67 68
68 ret = skb_copy_bits(skb, at + pos, &val, 69 ret = skb_copy_bits(skb, at + pos, &n,
69 sizeof(val)); 70 sizeof(n));
70 BUG_ON(ret < 0); 71 BUG_ON(ret < 0);
71 val = ntohl(val); 72 val = ntohl(n);
72 break; 73 break;
73 } 74 }
74 } 75 }
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index e146531faf1..8c11ca4a212 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -184,7 +184,7 @@ int genl_register_mc_group(struct genl_family *family,
184 } 184 }
185 185
186 err = netlink_change_ngroups(genl_sock, 186 err = netlink_change_ngroups(genl_sock,
187 sizeof(unsigned long) * NETLINK_GENERIC); 187 mc_groups_longs * BITS_PER_LONG);
188 if (err) 188 if (err)
189 goto out; 189 goto out;
190 190
@@ -196,10 +196,22 @@ int genl_register_mc_group(struct genl_family *family,
196 genl_ctrl_event(CTRL_CMD_NEWMCAST_GRP, grp); 196 genl_ctrl_event(CTRL_CMD_NEWMCAST_GRP, grp);
197 out: 197 out:
198 genl_unlock(); 198 genl_unlock();
199 return 0; 199 return err;
200} 200}
201EXPORT_SYMBOL(genl_register_mc_group); 201EXPORT_SYMBOL(genl_register_mc_group);
202 202
203static void __genl_unregister_mc_group(struct genl_family *family,
204 struct genl_multicast_group *grp)
205{
206 BUG_ON(grp->family != family);
207 netlink_clear_multicast_users(genl_sock, grp->id);
208 clear_bit(grp->id, mc_groups);
209 list_del(&grp->list);
210 genl_ctrl_event(CTRL_CMD_DELMCAST_GRP, grp);
211 grp->id = 0;
212 grp->family = NULL;
213}
214
203/** 215/**
204 * genl_unregister_mc_group - unregister a multicast group 216 * genl_unregister_mc_group - unregister a multicast group
205 * 217 *
@@ -217,14 +229,8 @@ EXPORT_SYMBOL(genl_register_mc_group);
217void genl_unregister_mc_group(struct genl_family *family, 229void genl_unregister_mc_group(struct genl_family *family,
218 struct genl_multicast_group *grp) 230 struct genl_multicast_group *grp)
219{ 231{
220 BUG_ON(grp->family != family);
221 genl_lock(); 232 genl_lock();
222 netlink_clear_multicast_users(genl_sock, grp->id); 233 __genl_unregister_mc_group(family, grp);
223 clear_bit(grp->id, mc_groups);
224 list_del(&grp->list);
225 genl_ctrl_event(CTRL_CMD_DELMCAST_GRP, grp);
226 grp->id = 0;
227 grp->family = NULL;
228 genl_unlock(); 234 genl_unlock();
229} 235}
230 236
@@ -232,8 +238,10 @@ static void genl_unregister_mc_groups(struct genl_family *family)
232{ 238{
233 struct genl_multicast_group *grp, *tmp; 239 struct genl_multicast_group *grp, *tmp;
234 240
241 genl_lock();
235 list_for_each_entry_safe(grp, tmp, &family->mcast_groups, list) 242 list_for_each_entry_safe(grp, tmp, &family->mcast_groups, list)
236 genl_unregister_mc_group(family, grp); 243 __genl_unregister_mc_group(family, grp);
244 genl_unlock();
237} 245}
238 246
239/** 247/**
diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c
index 16a68df4e36..c58fa0d1be2 100644
--- a/net/rxrpc/af_rxrpc.c
+++ b/net/rxrpc/af_rxrpc.c
@@ -787,7 +787,7 @@ static int __init af_rxrpc_init(void)
787 787
788 BUILD_BUG_ON(sizeof(struct rxrpc_skb_priv) > sizeof(dummy_skb->cb)); 788 BUILD_BUG_ON(sizeof(struct rxrpc_skb_priv) > sizeof(dummy_skb->cb));
789 789
790 rxrpc_epoch = htonl(xtime.tv_sec); 790 rxrpc_epoch = htonl(get_seconds());
791 791
792 ret = -ENOMEM; 792 ret = -ENOMEM;
793 rxrpc_call_jar = kmem_cache_create( 793 rxrpc_call_jar = kmem_cache_create(
diff --git a/net/rxrpc/ar-connection.c b/net/rxrpc/ar-connection.c
index 482750efc23..d6667f7bc85 100644
--- a/net/rxrpc/ar-connection.c
+++ b/net/rxrpc/ar-connection.c
@@ -71,7 +71,7 @@ struct rxrpc_conn_bundle *rxrpc_get_bundle(struct rxrpc_sock *rx,
71 struct rb_node *p, *parent, **pp; 71 struct rb_node *p, *parent, **pp;
72 72
73 _enter("%p{%x},%x,%hx,", 73 _enter("%p{%x},%x,%hx,",
74 rx, key_serial(key), trans->debug_id, ntohl(service_id)); 74 rx, key_serial(key), trans->debug_id, ntohs(service_id));
75 75
76 if (rx->trans == trans && rx->bundle) { 76 if (rx->trans == trans && rx->bundle) {
77 atomic_inc(&rx->bundle->usage); 77 atomic_inc(&rx->bundle->usage);
@@ -791,7 +791,7 @@ void rxrpc_put_connection(struct rxrpc_connection *conn)
791 791
792 ASSERTCMP(atomic_read(&conn->usage), >, 0); 792 ASSERTCMP(atomic_read(&conn->usage), >, 0);
793 793
794 conn->put_time = xtime.tv_sec; 794 conn->put_time = get_seconds();
795 if (atomic_dec_and_test(&conn->usage)) { 795 if (atomic_dec_and_test(&conn->usage)) {
796 _debug("zombie"); 796 _debug("zombie");
797 rxrpc_queue_delayed_work(&rxrpc_connection_reap, 0); 797 rxrpc_queue_delayed_work(&rxrpc_connection_reap, 0);
@@ -835,7 +835,7 @@ void rxrpc_connection_reaper(struct work_struct *work)
835 835
836 _enter(""); 836 _enter("");
837 837
838 now = xtime.tv_sec; 838 now = get_seconds();
839 earliest = ULONG_MAX; 839 earliest = ULONG_MAX;
840 840
841 write_lock_bh(&rxrpc_connection_lock); 841 write_lock_bh(&rxrpc_connection_lock);
diff --git a/net/rxrpc/ar-transport.c b/net/rxrpc/ar-transport.c
index d43d78f1930..bb282a6a19f 100644
--- a/net/rxrpc/ar-transport.c
+++ b/net/rxrpc/ar-transport.c
@@ -183,7 +183,7 @@ void rxrpc_put_transport(struct rxrpc_transport *trans)
183 183
184 ASSERTCMP(atomic_read(&trans->usage), >, 0); 184 ASSERTCMP(atomic_read(&trans->usage), >, 0);
185 185
186 trans->put_time = xtime.tv_sec; 186 trans->put_time = get_seconds();
187 if (unlikely(atomic_dec_and_test(&trans->usage))) 187 if (unlikely(atomic_dec_and_test(&trans->usage)))
188 _debug("zombie"); 188 _debug("zombie");
189 /* let the reaper determine the timeout to avoid a race with 189 /* let the reaper determine the timeout to avoid a race with
@@ -219,7 +219,7 @@ static void rxrpc_transport_reaper(struct work_struct *work)
219 219
220 _enter(""); 220 _enter("");
221 221
222 now = xtime.tv_sec; 222 now = get_seconds();
223 earliest = ULONG_MAX; 223 earliest = ULONG_MAX;
224 224
225 /* extract all the transports that have been dead too long */ 225 /* extract all the transports that have been dead too long */
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c
index 5ec705144e1..ac3cabdca78 100644
--- a/net/rxrpc/rxkad.c
+++ b/net/rxrpc/rxkad.c
@@ -916,7 +916,7 @@ static int rxkad_decrypt_ticket(struct rxrpc_connection *conn,
916 issue = be32_to_cpu(stamp); 916 issue = be32_to_cpu(stamp);
917 } 917 }
918 p += 4; 918 p += 4;
919 now = xtime.tv_sec; 919 now = get_seconds();
920 _debug("KIV ISSUE: %lx [%lx]", issue, now); 920 _debug("KIV ISSUE: %lx [%lx]", issue, now);
921 921
922 /* check the ticket is in date */ 922 /* check the ticket is in date */
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index 490697542fc..dc2f41e9f57 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -769,11 +769,12 @@ svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name)
769 new->h.flavour = &svcauthops_gss; 769 new->h.flavour = &svcauthops_gss;
770 new->pseudoflavor = pseudoflavor; 770 new->pseudoflavor = pseudoflavor;
771 771
772 stat = 0;
772 test = auth_domain_lookup(name, &new->h); 773 test = auth_domain_lookup(name, &new->h);
773 if (test != &new->h) { /* XXX Duplicate registration? */ 774 if (test != &new->h) { /* Duplicate registration */
774 auth_domain_put(&new->h); 775 auth_domain_put(test);
775 /* dangling ref-count... */ 776 kfree(new->h.name);
776 goto out; 777 goto out_free_dom;
777 } 778 }
778 return 0; 779 return 0;
779 780
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 64b9b8c743c..12ff5da8160 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -131,13 +131,13 @@ static char *__svc_print_addr(struct sockaddr *addr, char *buf, size_t len)
131 case AF_INET: 131 case AF_INET:
132 snprintf(buf, len, "%u.%u.%u.%u, port=%u", 132 snprintf(buf, len, "%u.%u.%u.%u, port=%u",
133 NIPQUAD(((struct sockaddr_in *) addr)->sin_addr), 133 NIPQUAD(((struct sockaddr_in *) addr)->sin_addr),
134 htons(((struct sockaddr_in *) addr)->sin_port)); 134 ntohs(((struct sockaddr_in *) addr)->sin_port));
135 break; 135 break;
136 136
137 case AF_INET6: 137 case AF_INET6:
138 snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u", 138 snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u",
139 NIP6(((struct sockaddr_in6 *) addr)->sin6_addr), 139 NIP6(((struct sockaddr_in6 *) addr)->sin6_addr),
140 htons(((struct sockaddr_in6 *) addr)->sin6_port)); 140 ntohs(((struct sockaddr_in6 *) addr)->sin6_port));
141 break; 141 break;
142 142
143 default: 143 default:
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index 35d5ba1d4f4..ce265983637 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -72,10 +72,8 @@ static inline void msg_set_bits(struct tipc_msg *m, u32 w,
72 u32 pos, u32 mask, u32 val) 72 u32 pos, u32 mask, u32 val)
73{ 73{
74 val = (val & mask) << pos; 74 val = (val & mask) << pos;
75 val = htonl(val); 75 m->hdr[w] &= ~htonl(mask << pos);
76 mask = htonl(mask << pos); 76 m->hdr[w] |= htonl(val);
77 m->hdr[w] &= ~mask;
78 m->hdr[w] |= val;
79} 77}
80 78
81/* 79/*