aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/8021q/vlan_dev.c2
-rw-r--r--net/9p/trans_fd.c2
-rw-r--r--net/atm/clip.c19
-rw-r--r--net/atm/lec.c4
-rw-r--r--net/bridge/br_fdb.c2
-rw-r--r--net/core/netpoll.c6
-rw-r--r--net/core/sock.c4
-rw-r--r--net/ipv4/af_inet.c2
-rw-r--r--net/ipv4/esp4.c2
-rw-r--r--net/ipv4/fib_trie.c7
-rw-r--r--net/ipv4/ip_fragment.c2
-rw-r--r--net/ipv4/ip_sockglue.c2
-rw-r--r--net/ipv4/ipconfig.c9
-rw-r--r--net/ipv4/netfilter/ipt_recent.c2
-rw-r--r--net/ipv4/tcp.c4
-rw-r--r--net/ipv4/tcp_output.c2
-rw-r--r--net/ipv6/Kconfig5
-rw-r--r--net/ipv6/ndisc.c2
-rw-r--r--net/netfilter/nf_conntrack_h323_main.c2
-rw-r--r--net/sched/cls_u32.c8
-rw-r--r--net/sched/em_u32.c2
-rw-r--r--net/sched/sch_htb.c13
-rw-r--r--net/sctp/input.c2
-rw-r--r--net/sctp/ipv6.c32
-rw-r--r--net/sctp/protocol.c139
-rw-r--r--net/socket.c7
-rw-r--r--net/sunrpc/auth_gss/gss_mech_switch.c2
-rw-r--r--net/sunrpc/svc_xprt.c2
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_recvfrom.c2
29 files changed, 178 insertions, 111 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 77f04e49a1a0..8fbcefe10c9f 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -382,7 +382,7 @@ static int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
382 vlan_dev_info(dev)->cnt_encap_on_xmit++; 382 vlan_dev_info(dev)->cnt_encap_on_xmit++;
383 383
384 pr_debug("%s: proto to encap: 0x%hx\n", 384 pr_debug("%s: proto to encap: 0x%hx\n",
385 __FUNCTION__, htons(veth->h_vlan_proto)); 385 __FUNCTION__, ntohs(veth->h_vlan_proto));
386 /* Construct the second two bytes. This field looks something 386 /* Construct the second two bytes. This field looks something
387 * like: 387 * like:
388 * usr_priority: 3 bits (high bits) 388 * usr_priority: 3 bits (high bits)
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index 1aa9d5175398..4e8d4e724b96 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -861,7 +861,6 @@ static void p9_mux_free_request(struct p9_conn *m, struct p9_req *req)
861 861
862static void p9_mux_flush_cb(struct p9_req *freq, void *a) 862static void p9_mux_flush_cb(struct p9_req *freq, void *a)
863{ 863{
864 p9_conn_req_callback cb;
865 int tag; 864 int tag;
866 struct p9_conn *m; 865 struct p9_conn *m;
867 struct p9_req *req, *rreq, *rptr; 866 struct p9_req *req, *rreq, *rptr;
@@ -872,7 +871,6 @@ static void p9_mux_flush_cb(struct p9_req *freq, void *a)
872 freq->tcall->params.tflush.oldtag); 871 freq->tcall->params.tflush.oldtag);
873 872
874 spin_lock(&m->lock); 873 spin_lock(&m->lock);
875 cb = NULL;
876 tag = freq->tcall->params.tflush.oldtag; 874 tag = freq->tcall->params.tflush.oldtag;
877 req = NULL; 875 req = NULL;
878 list_for_each_entry_safe(rreq, rptr, &m->req_list, req_list) { 876 list_for_each_entry_safe(rreq, rptr, &m->req_list, req_list) {
diff --git a/net/atm/clip.c b/net/atm/clip.c
index d30167c0b48e..2ab1e36098fd 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -947,6 +947,8 @@ static const struct file_operations arp_seq_fops = {
947}; 947};
948#endif 948#endif
949 949
950static void atm_clip_exit_noproc(void);
951
950static int __init atm_clip_init(void) 952static int __init atm_clip_init(void)
951{ 953{
952 neigh_table_init_no_netlink(&clip_tbl); 954 neigh_table_init_no_netlink(&clip_tbl);
@@ -963,18 +965,22 @@ static int __init atm_clip_init(void)
963 struct proc_dir_entry *p; 965 struct proc_dir_entry *p;
964 966
965 p = proc_create("arp", S_IRUGO, atm_proc_root, &arp_seq_fops); 967 p = proc_create("arp", S_IRUGO, atm_proc_root, &arp_seq_fops);
968 if (!p) {
969 printk(KERN_ERR "Unable to initialize "
970 "/proc/net/atm/arp\n");
971 atm_clip_exit_noproc();
972 return -ENOMEM;
973 }
966 } 974 }
967#endif 975#endif
968 976
969 return 0; 977 return 0;
970} 978}
971 979
972static void __exit atm_clip_exit(void) 980static void atm_clip_exit_noproc(void)
973{ 981{
974 struct net_device *dev, *next; 982 struct net_device *dev, *next;
975 983
976 remove_proc_entry("arp", atm_proc_root);
977
978 unregister_inetaddr_notifier(&clip_inet_notifier); 984 unregister_inetaddr_notifier(&clip_inet_notifier);
979 unregister_netdevice_notifier(&clip_dev_notifier); 985 unregister_netdevice_notifier(&clip_dev_notifier);
980 986
@@ -1005,6 +1011,13 @@ static void __exit atm_clip_exit(void)
1005 clip_tbl_hook = NULL; 1011 clip_tbl_hook = NULL;
1006} 1012}
1007 1013
1014static void __exit atm_clip_exit(void)
1015{
1016 remove_proc_entry("arp", atm_proc_root);
1017
1018 atm_clip_exit_noproc();
1019}
1020
1008module_init(atm_clip_init); 1021module_init(atm_clip_init);
1009module_exit(atm_clip_exit); 1022module_exit(atm_clip_exit);
1010MODULE_AUTHOR("Werner Almesberger"); 1023MODULE_AUTHOR("Werner Almesberger");
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 0e450d12f035..a2efa7ff41f1 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -1250,6 +1250,10 @@ static int __init lane_module_init(void)
1250 struct proc_dir_entry *p; 1250 struct proc_dir_entry *p;
1251 1251
1252 p = proc_create("lec", S_IRUGO, atm_proc_root, &lec_seq_fops); 1252 p = proc_create("lec", S_IRUGO, atm_proc_root, &lec_seq_fops);
1253 if (!p) {
1254 printk(KERN_ERR "Unable to initialize /proc/net/atm/lec\n");
1255 return -ENOMEM;
1256 }
1253#endif 1257#endif
1254 1258
1255 register_atm_ioctl(&lane_ioctl_ops); 1259 register_atm_ioctl(&lane_ioctl_ops);
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index bc40377136a2..9326c377822e 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -136,7 +136,7 @@ void br_fdb_cleanup(unsigned long _data)
136 this_timer = f->ageing_timer + delay; 136 this_timer = f->ageing_timer + delay;
137 if (time_before_eq(this_timer, jiffies)) 137 if (time_before_eq(this_timer, jiffies))
138 fdb_delete(f); 138 fdb_delete(f);
139 else if (this_timer < next_timer) 139 else if (time_before(this_timer, next_timer))
140 next_timer = this_timer; 140 next_timer = this_timer;
141 } 141 }
142 } 142 }
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 4b7e756181c9..c635de52526c 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -215,10 +215,12 @@ static void zap_completion_queue(void)
215 while (clist != NULL) { 215 while (clist != NULL) {
216 struct sk_buff *skb = clist; 216 struct sk_buff *skb = clist;
217 clist = clist->next; 217 clist = clist->next;
218 if (skb->destructor) 218 if (skb->destructor) {
219 atomic_inc(&skb->users);
219 dev_kfree_skb_any(skb); /* put this one back */ 220 dev_kfree_skb_any(skb); /* put this one back */
220 else 221 } else {
221 __kfree_skb(skb); 222 __kfree_skb(skb);
223 }
222 } 224 }
223 } 225 }
224 226
diff --git a/net/core/sock.c b/net/core/sock.c
index 09cb3a74de7f..2654c147c004 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1621,7 +1621,7 @@ static void sock_def_readable(struct sock *sk, int len)
1621{ 1621{
1622 read_lock(&sk->sk_callback_lock); 1622 read_lock(&sk->sk_callback_lock);
1623 if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 1623 if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
1624 wake_up_interruptible(sk->sk_sleep); 1624 wake_up_interruptible_sync(sk->sk_sleep);
1625 sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN); 1625 sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN);
1626 read_unlock(&sk->sk_callback_lock); 1626 read_unlock(&sk->sk_callback_lock);
1627} 1627}
@@ -1635,7 +1635,7 @@ static void sock_def_write_space(struct sock *sk)
1635 */ 1635 */
1636 if ((atomic_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf) { 1636 if ((atomic_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf) {
1637 if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) 1637 if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
1638 wake_up_interruptible(sk->sk_sleep); 1638 wake_up_interruptible_sync(sk->sk_sleep);
1639 1639
1640 /* Should agree with poll, otherwise some programs break */ 1640 /* Should agree with poll, otherwise some programs break */
1641 if (sock_writeable(sk)) 1641 if (sock_writeable(sk))
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 09ca5293d08f..0d109504ed86 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -458,7 +458,7 @@ int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
458 err = -EADDRNOTAVAIL; 458 err = -EADDRNOTAVAIL;
459 if (!sysctl_ip_nonlocal_bind && 459 if (!sysctl_ip_nonlocal_bind &&
460 !inet->freebind && 460 !inet->freebind &&
461 addr->sin_addr.s_addr != INADDR_ANY && 461 addr->sin_addr.s_addr != htonl(INADDR_ANY) &&
462 chk_addr_ret != RTN_LOCAL && 462 chk_addr_ret != RTN_LOCAL &&
463 chk_addr_ret != RTN_MULTICAST && 463 chk_addr_ret != RTN_MULTICAST &&
464 chk_addr_ret != RTN_BROADCAST) 464 chk_addr_ret != RTN_BROADCAST)
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index 091e6709f831..f3ceca31aa45 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -168,7 +168,7 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb)
168 struct xfrm_encap_tmpl *encap = x->encap; 168 struct xfrm_encap_tmpl *encap = x->encap;
169 struct udphdr *uh; 169 struct udphdr *uh;
170 __be32 *udpdata32; 170 __be32 *udpdata32;
171 unsigned int sport, dport; 171 __be16 sport, dport;
172 int encap_type; 172 int encap_type;
173 173
174 spin_lock_bh(&x->lock); 174 spin_lock_bh(&x->lock);
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 1ff446d0fa8b..f6cdc012eec5 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -177,10 +177,13 @@ static inline struct tnode *node_parent_rcu(struct node *node)
177 return rcu_dereference(ret); 177 return rcu_dereference(ret);
178} 178}
179 179
180/* Same as rcu_assign_pointer
181 * but that macro() assumes that value is a pointer.
182 */
180static inline void node_set_parent(struct node *node, struct tnode *ptr) 183static inline void node_set_parent(struct node *node, struct tnode *ptr)
181{ 184{
182 rcu_assign_pointer(node->parent, 185 smp_wmb();
183 (unsigned long)ptr | NODE_TYPE(node)); 186 node->parent = (unsigned long)ptr | NODE_TYPE(node);
184} 187}
185 188
186static inline struct node *tnode_get_child(struct tnode *tn, unsigned int i) 189static inline struct node *tnode_get_child(struct tnode *tn, unsigned int i)
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index a2e92f9709db..3b2e5adca838 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -568,7 +568,7 @@ int ip_defrag(struct sk_buff *skb, u32 user)
568 568
569 IP_INC_STATS_BH(IPSTATS_MIB_REASMREQDS); 569 IP_INC_STATS_BH(IPSTATS_MIB_REASMREQDS);
570 570
571 net = skb->dev->nd_net; 571 net = skb->dev ? skb->dev->nd_net : skb->dst->dev->nd_net;
572 /* Start by cleaning up the memory. */ 572 /* Start by cleaning up the memory. */
573 if (atomic_read(&net->ipv4.frags.mem) > net->ipv4.frags.high_thresh) 573 if (atomic_read(&net->ipv4.frags.mem) > net->ipv4.frags.high_thresh)
574 ip_evictor(net); 574 ip_evictor(net);
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index de0572c88859..f72457b4b0a7 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -583,7 +583,7 @@ static int do_ip_setsockopt(struct sock *sk, int level,
583 } 583 }
584 584
585 if (!mreq.imr_ifindex) { 585 if (!mreq.imr_ifindex) {
586 if (mreq.imr_address.s_addr == INADDR_ANY) { 586 if (mreq.imr_address.s_addr == htonl(INADDR_ANY)) {
587 inet->mc_index = 0; 587 inet->mc_index = 0;
588 inet->mc_addr = 0; 588 inet->mc_addr = 0;
589 err = 0; 589 err = 0;
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 5dd938579eeb..7c992fbbc2c3 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -103,6 +103,7 @@
103 - '3' from resolv.h */ 103 - '3' from resolv.h */
104 104
105#define NONE __constant_htonl(INADDR_NONE) 105#define NONE __constant_htonl(INADDR_NONE)
106#define ANY __constant_htonl(INADDR_ANY)
106 107
107/* 108/*
108 * Public IP configuration 109 * Public IP configuration
@@ -1479,19 +1480,19 @@ static int __init ip_auto_config_setup(char *addrs)
1479 DBG(("IP-Config: Parameter #%d: `%s'\n", num, ip)); 1480 DBG(("IP-Config: Parameter #%d: `%s'\n", num, ip));
1480 switch (num) { 1481 switch (num) {
1481 case 0: 1482 case 0:
1482 if ((ic_myaddr = in_aton(ip)) == INADDR_ANY) 1483 if ((ic_myaddr = in_aton(ip)) == ANY)
1483 ic_myaddr = NONE; 1484 ic_myaddr = NONE;
1484 break; 1485 break;
1485 case 1: 1486 case 1:
1486 if ((ic_servaddr = in_aton(ip)) == INADDR_ANY) 1487 if ((ic_servaddr = in_aton(ip)) == ANY)
1487 ic_servaddr = NONE; 1488 ic_servaddr = NONE;
1488 break; 1489 break;
1489 case 2: 1490 case 2:
1490 if ((ic_gateway = in_aton(ip)) == INADDR_ANY) 1491 if ((ic_gateway = in_aton(ip)) == ANY)
1491 ic_gateway = NONE; 1492 ic_gateway = NONE;
1492 break; 1493 break;
1493 case 3: 1494 case 3:
1494 if ((ic_netmask = in_aton(ip)) == INADDR_ANY) 1495 if ((ic_netmask = in_aton(ip)) == ANY)
1495 ic_netmask = NONE; 1496 ic_netmask = NONE;
1496 break; 1497 break;
1497 case 4: 1498 case 4:
diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c
index 68cbe3ca01ce..8e8f0425a8ed 100644
--- a/net/ipv4/netfilter/ipt_recent.c
+++ b/net/ipv4/netfilter/ipt_recent.c
@@ -252,6 +252,8 @@ recent_mt_check(const char *tablename, const void *ip,
252 if ((info->check_set & (IPT_RECENT_SET | IPT_RECENT_REMOVE)) && 252 if ((info->check_set & (IPT_RECENT_SET | IPT_RECENT_REMOVE)) &&
253 (info->seconds || info->hit_count)) 253 (info->seconds || info->hit_count))
254 return false; 254 return false;
255 if (info->hit_count > ip_pkt_list_tot)
256 return false;
255 if (info->name[0] == '\0' || 257 if (info->name[0] == '\0' ||
256 strnlen(info->name, IPT_RECENT_NAME_LEN) == IPT_RECENT_NAME_LEN) 258 strnlen(info->name, IPT_RECENT_NAME_LEN) == IPT_RECENT_NAME_LEN)
257 return false; 259 return false;
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 071e83a894ad..39b629ac2404 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -735,7 +735,7 @@ new_segment:
735 if (!(psize -= copy)) 735 if (!(psize -= copy))
736 goto out; 736 goto out;
737 737
738 if (skb->len < mss_now || (flags & MSG_OOB)) 738 if (skb->len < size_goal || (flags & MSG_OOB))
739 continue; 739 continue;
740 740
741 if (forced_push(tp)) { 741 if (forced_push(tp)) {
@@ -981,7 +981,7 @@ new_segment:
981 if ((seglen -= copy) == 0 && iovlen == 0) 981 if ((seglen -= copy) == 0 && iovlen == 0)
982 goto out; 982 goto out;
983 983
984 if (skb->len < mss_now || (flags & MSG_OOB)) 984 if (skb->len < size_goal || (flags & MSG_OOB))
985 continue; 985 continue;
986 986
987 if (forced_push(tp)) { 987 if (forced_push(tp)) {
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 01578f544ad6..72b9350006fe 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -255,7 +255,7 @@ static u16 tcp_select_window(struct sock *sk)
255 * 255 *
256 * Relax Will Robinson. 256 * Relax Will Robinson.
257 */ 257 */
258 new_win = cur_win; 258 new_win = ALIGN(cur_win, 1 << tp->rx_opt.rcv_wscale);
259 } 259 }
260 tp->rcv_wnd = new_win; 260 tp->rcv_wnd = new_win;
261 tp->rcv_wup = tp->rcv_nxt; 261 tp->rcv_wup = tp->rcv_nxt;
diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig
index 58219dfffef8..47263e45bacb 100644
--- a/net/ipv6/Kconfig
+++ b/net/ipv6/Kconfig
@@ -179,11 +179,12 @@ config IPV6_SIT
179 Saying M here will produce a module called sit.ko. If unsure, say Y. 179 Saying M here will produce a module called sit.ko. If unsure, say Y.
180 180
181config IPV6_TUNNEL 181config IPV6_TUNNEL
182 tristate "IPv6: IPv6-in-IPv6 tunnel" 182 tristate "IPv6: IP-in-IPv6 tunnel (RFC2473)"
183 select INET6_TUNNEL 183 select INET6_TUNNEL
184 depends on IPV6 184 depends on IPV6
185 ---help--- 185 ---help---
186 Support for IPv6-in-IPv6 tunnels described in RFC 2473. 186 Support for IPv6-in-IPv6 and IPv4-in-IPv6 tunnels described in
187 RFC 2473.
187 188
188 If unsure, say N. 189 If unsure, say N.
189 190
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 0d33a7d32125..51557c27a0cd 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1420,7 +1420,6 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
1420 u8 *opt; 1420 u8 *opt;
1421 int rd_len; 1421 int rd_len;
1422 int err; 1422 int err;
1423 int hlen;
1424 u8 ha_buf[MAX_ADDR_LEN], *ha = NULL; 1423 u8 ha_buf[MAX_ADDR_LEN], *ha = NULL;
1425 1424
1426 dev = skb->dev; 1425 dev = skb->dev;
@@ -1491,7 +1490,6 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
1491 return; 1490 return;
1492 } 1491 }
1493 1492
1494 hlen = 0;
1495 1493
1496 skb_reserve(buff, LL_RESERVED_SPACE(dev)); 1494 skb_reserve(buff, LL_RESERVED_SPACE(dev));
1497 ip6_nd_hdr(sk, buff, dev, &saddr_buf, &ipv6_hdr(skb)->saddr, 1495 ip6_nd_hdr(sk, buff, dev, &saddr_buf, &ipv6_hdr(skb)->saddr,
diff --git a/net/netfilter/nf_conntrack_h323_main.c b/net/netfilter/nf_conntrack_h323_main.c
index 62137879e6aa..898f1922b5b8 100644
--- a/net/netfilter/nf_conntrack_h323_main.c
+++ b/net/netfilter/nf_conntrack_h323_main.c
@@ -842,7 +842,7 @@ static int process_setup(struct sk_buff *skb, struct nf_conn *ct,
842 842
843 set_h225_addr = rcu_dereference(set_h225_addr_hook); 843 set_h225_addr = rcu_dereference(set_h225_addr_hook);
844 if ((setup->options & eSetup_UUIE_destCallSignalAddress) && 844 if ((setup->options & eSetup_UUIE_destCallSignalAddress) &&
845 (set_h225_addr) && ct->status && IPS_NAT_MASK && 845 (set_h225_addr) && ct->status & IPS_NAT_MASK &&
846 get_h225_addr(ct, *data, &setup->destCallSignalAddress, 846 get_h225_addr(ct, *data, &setup->destCallSignalAddress,
847 &addr, &port) && 847 &addr, &port) &&
848 memcmp(&addr, &ct->tuplehash[!dir].tuple.src.u3, sizeof(addr))) { 848 memcmp(&addr, &ct->tuplehash[!dir].tuple.src.u3, sizeof(addr))) {
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index b18fa95ef248..c5c16b4b6e98 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -89,7 +89,7 @@ static const struct tcf_ext_map u32_ext_map = {
89 89
90static struct tc_u_common *u32_list; 90static struct tc_u_common *u32_list;
91 91
92static __inline__ unsigned u32_hash_fold(u32 key, struct tc_u32_sel *sel, u8 fshift) 92static __inline__ unsigned u32_hash_fold(__be32 key, struct tc_u32_sel *sel, u8 fshift)
93{ 93{
94 unsigned h = ntohl(key & sel->hmask)>>fshift; 94 unsigned h = ntohl(key & sel->hmask)>>fshift;
95 95
@@ -137,7 +137,7 @@ next_knode:
137 137
138 for (i = n->sel.nkeys; i>0; i--, key++) { 138 for (i = n->sel.nkeys; i>0; i--, key++) {
139 139
140 if ((*(u32*)(ptr+key->off+(off2&key->offmask))^key->val)&key->mask) { 140 if ((*(__be32*)(ptr+key->off+(off2&key->offmask))^key->val)&key->mask) {
141 n = n->next; 141 n = n->next;
142 goto next_knode; 142 goto next_knode;
143 } 143 }
@@ -182,7 +182,7 @@ check_terminal:
182 ht = n->ht_down; 182 ht = n->ht_down;
183 sel = 0; 183 sel = 0;
184 if (ht->divisor) 184 if (ht->divisor)
185 sel = ht->divisor&u32_hash_fold(*(u32*)(ptr+n->sel.hoff), &n->sel,n->fshift); 185 sel = ht->divisor&u32_hash_fold(*(__be32*)(ptr+n->sel.hoff), &n->sel,n->fshift);
186 186
187 if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT))) 187 if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT)))
188 goto next_ht; 188 goto next_ht;
@@ -190,7 +190,7 @@ check_terminal:
190 if (n->sel.flags&(TC_U32_OFFSET|TC_U32_VAROFFSET)) { 190 if (n->sel.flags&(TC_U32_OFFSET|TC_U32_VAROFFSET)) {
191 off2 = n->sel.off + 3; 191 off2 = n->sel.off + 3;
192 if (n->sel.flags&TC_U32_VAROFFSET) 192 if (n->sel.flags&TC_U32_VAROFFSET)
193 off2 += ntohs(n->sel.offmask & *(u16*)(ptr+n->sel.offoff)) >>n->sel.offshift; 193 off2 += ntohs(n->sel.offmask & *(__be16*)(ptr+n->sel.offoff)) >>n->sel.offshift;
194 off2 &= ~3; 194 off2 &= ~3;
195 } 195 }
196 if (n->sel.flags&TC_U32_EAT) { 196 if (n->sel.flags&TC_U32_EAT) {
diff --git a/net/sched/em_u32.c b/net/sched/em_u32.c
index 112796e4a7c4..953f1479f7da 100644
--- a/net/sched/em_u32.c
+++ b/net/sched/em_u32.c
@@ -35,7 +35,7 @@ static int em_u32_match(struct sk_buff *skb, struct tcf_ematch *em,
35 if (!tcf_valid_offset(skb, ptr, sizeof(u32))) 35 if (!tcf_valid_offset(skb, ptr, sizeof(u32)))
36 return 0; 36 return 0;
37 37
38 return !(((*(u32*) ptr) ^ key->val) & key->mask); 38 return !(((*(__be32*) ptr) ^ key->val) & key->mask);
39} 39}
40 40
41static struct tcf_ematch_ops em_u32_ops = { 41static struct tcf_ematch_ops em_u32_ops = {
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 795c761ad99f..66148cc4759e 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -711,9 +711,11 @@ static void htb_charge_class(struct htb_sched *q, struct htb_class *cl,
711 */ 711 */
712static psched_time_t htb_do_events(struct htb_sched *q, int level) 712static psched_time_t htb_do_events(struct htb_sched *q, int level)
713{ 713{
714 int i; 714 /* don't run for longer than 2 jiffies; 2 is used instead of
715 715 1 to simplify things when jiffy is going to be incremented
716 for (i = 0; i < 500; i++) { 716 too soon */
717 unsigned long stop_at = jiffies + 2;
718 while (time_before(jiffies, stop_at)) {
717 struct htb_class *cl; 719 struct htb_class *cl;
718 long diff; 720 long diff;
719 struct rb_node *p = rb_first(&q->wait_pq[level]); 721 struct rb_node *p = rb_first(&q->wait_pq[level]);
@@ -731,9 +733,8 @@ static psched_time_t htb_do_events(struct htb_sched *q, int level)
731 if (cl->cmode != HTB_CAN_SEND) 733 if (cl->cmode != HTB_CAN_SEND)
732 htb_add_to_wait_tree(q, cl, diff); 734 htb_add_to_wait_tree(q, cl, diff);
733 } 735 }
734 if (net_ratelimit()) 736 /* too much load - let's continue on next jiffie */
735 printk(KERN_WARNING "htb: too many events !\n"); 737 return q->now + PSCHED_TICKS_PER_SEC / HZ;
736 return q->now + PSCHED_TICKS_PER_SEC / 10;
737} 738}
738 739
739/* Returns class->node+prio from id-tree where classe's id is >= id. NULL 740/* Returns class->node+prio from id-tree where classe's id is >= id. NULL
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 57fe2f81eca8..812ff1756c3e 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -944,7 +944,7 @@ static struct sctp_association *__sctp_rcv_init_lookup(struct sk_buff *skb,
944static struct sctp_association *__sctp_rcv_asconf_lookup( 944static struct sctp_association *__sctp_rcv_asconf_lookup(
945 sctp_chunkhdr_t *ch, 945 sctp_chunkhdr_t *ch,
946 const union sctp_addr *laddr, 946 const union sctp_addr *laddr,
947 __be32 peer_port, 947 __be16 peer_port,
948 struct sctp_transport **transportp) 948 struct sctp_transport **transportp)
949{ 949{
950 sctp_addip_chunk_t *asconf = (struct sctp_addip_chunk *)ch; 950 sctp_addip_chunk_t *asconf = (struct sctp_addip_chunk *)ch;
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 9aa0733aee87..b1e05d719f9b 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -1014,15 +1014,24 @@ static struct sctp_pf sctp_pf_inet6 = {
1014}; 1014};
1015 1015
1016/* Initialize IPv6 support and register with socket layer. */ 1016/* Initialize IPv6 support and register with socket layer. */
1017int sctp_v6_init(void) 1017void sctp_v6_pf_init(void)
1018{ 1018{
1019 int rc;
1020
1021 /* Register the SCTP specific PF_INET6 functions. */ 1019 /* Register the SCTP specific PF_INET6 functions. */
1022 sctp_register_pf(&sctp_pf_inet6, PF_INET6); 1020 sctp_register_pf(&sctp_pf_inet6, PF_INET6);
1023 1021
1024 /* Register the SCTP specific AF_INET6 functions. */ 1022 /* Register the SCTP specific AF_INET6 functions. */
1025 sctp_register_af(&sctp_af_inet6); 1023 sctp_register_af(&sctp_af_inet6);
1024}
1025
1026void sctp_v6_pf_exit(void)
1027{
1028 list_del(&sctp_af_inet6.list);
1029}
1030
1031/* Initialize IPv6 support and register with socket layer. */
1032int sctp_v6_protosw_init(void)
1033{
1034 int rc;
1026 1035
1027 rc = proto_register(&sctpv6_prot, 1); 1036 rc = proto_register(&sctpv6_prot, 1);
1028 if (rc) 1037 if (rc)
@@ -1035,6 +1044,14 @@ int sctp_v6_init(void)
1035 return 0; 1044 return 0;
1036} 1045}
1037 1046
1047void sctp_v6_protosw_exit(void)
1048{
1049 inet6_unregister_protosw(&sctpv6_seqpacket_protosw);
1050 inet6_unregister_protosw(&sctpv6_stream_protosw);
1051 proto_unregister(&sctpv6_prot);
1052}
1053
1054
1038/* Register with inet6 layer. */ 1055/* Register with inet6 layer. */
1039int sctp_v6_add_protocol(void) 1056int sctp_v6_add_protocol(void)
1040{ 1057{
@@ -1047,15 +1064,6 @@ int sctp_v6_add_protocol(void)
1047 return 0; 1064 return 0;
1048} 1065}
1049 1066
1050/* IPv6 specific exit support. */
1051void sctp_v6_exit(void)
1052{
1053 inet6_unregister_protosw(&sctpv6_seqpacket_protosw);
1054 inet6_unregister_protosw(&sctpv6_stream_protosw);
1055 proto_unregister(&sctpv6_prot);
1056 list_del(&sctp_af_inet6.list);
1057}
1058
1059/* Unregister with inet6 layer. */ 1067/* Unregister with inet6 layer. */
1060void sctp_v6_del_protocol(void) 1068void sctp_v6_del_protocol(void)
1061{ 1069{
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index ad0a4069b95b..f90091a1b9ce 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -337,14 +337,14 @@ static int sctp_v4_cmp_addr(const union sctp_addr *addr1,
337static void sctp_v4_inaddr_any(union sctp_addr *addr, __be16 port) 337static void sctp_v4_inaddr_any(union sctp_addr *addr, __be16 port)
338{ 338{
339 addr->v4.sin_family = AF_INET; 339 addr->v4.sin_family = AF_INET;
340 addr->v4.sin_addr.s_addr = INADDR_ANY; 340 addr->v4.sin_addr.s_addr = htonl(INADDR_ANY);
341 addr->v4.sin_port = port; 341 addr->v4.sin_port = port;
342} 342}
343 343
344/* Is this a wildcard address? */ 344/* Is this a wildcard address? */
345static int sctp_v4_is_any(const union sctp_addr *addr) 345static int sctp_v4_is_any(const union sctp_addr *addr)
346{ 346{
347 return INADDR_ANY == addr->v4.sin_addr.s_addr; 347 return htonl(INADDR_ANY) == addr->v4.sin_addr.s_addr;
348} 348}
349 349
350/* This function checks if the address is a valid address to be used for 350/* This function checks if the address is a valid address to be used for
@@ -375,7 +375,7 @@ static int sctp_v4_available(union sctp_addr *addr, struct sctp_sock *sp)
375 int ret = inet_addr_type(&init_net, addr->v4.sin_addr.s_addr); 375 int ret = inet_addr_type(&init_net, addr->v4.sin_addr.s_addr);
376 376
377 377
378 if (addr->v4.sin_addr.s_addr != INADDR_ANY && 378 if (addr->v4.sin_addr.s_addr != htonl(INADDR_ANY) &&
379 ret != RTN_LOCAL && 379 ret != RTN_LOCAL &&
380 !sp->inet.freebind && 380 !sp->inet.freebind &&
381 !sysctl_ip_nonlocal_bind) 381 !sysctl_ip_nonlocal_bind)
@@ -785,8 +785,8 @@ static int sctp_inet_cmp_addr(const union sctp_addr *addr1,
785 /* PF_INET only supports AF_INET addresses. */ 785 /* PF_INET only supports AF_INET addresses. */
786 if (addr1->sa.sa_family != addr2->sa.sa_family) 786 if (addr1->sa.sa_family != addr2->sa.sa_family)
787 return 0; 787 return 0;
788 if (INADDR_ANY == addr1->v4.sin_addr.s_addr || 788 if (htonl(INADDR_ANY) == addr1->v4.sin_addr.s_addr ||
789 INADDR_ANY == addr2->v4.sin_addr.s_addr) 789 htonl(INADDR_ANY) == addr2->v4.sin_addr.s_addr)
790 return 1; 790 return 1;
791 if (addr1->v4.sin_addr.s_addr == addr2->v4.sin_addr.s_addr) 791 if (addr1->v4.sin_addr.s_addr == addr2->v4.sin_addr.s_addr)
792 return 1; 792 return 1;
@@ -992,6 +992,58 @@ static void cleanup_sctp_mibs(void)
992 free_percpu(sctp_statistics[1]); 992 free_percpu(sctp_statistics[1]);
993} 993}
994 994
995static void sctp_v4_pf_init(void)
996{
997 /* Initialize the SCTP specific PF functions. */
998 sctp_register_pf(&sctp_pf_inet, PF_INET);
999 sctp_register_af(&sctp_af_inet);
1000}
1001
1002static void sctp_v4_pf_exit(void)
1003{
1004 list_del(&sctp_af_inet.list);
1005}
1006
1007static int sctp_v4_protosw_init(void)
1008{
1009 int rc;
1010
1011 rc = proto_register(&sctp_prot, 1);
1012 if (rc)
1013 return rc;
1014
1015 /* Register SCTP(UDP and TCP style) with socket layer. */
1016 inet_register_protosw(&sctp_seqpacket_protosw);
1017 inet_register_protosw(&sctp_stream_protosw);
1018
1019 return 0;
1020}
1021
1022static void sctp_v4_protosw_exit(void)
1023{
1024 inet_unregister_protosw(&sctp_stream_protosw);
1025 inet_unregister_protosw(&sctp_seqpacket_protosw);
1026 proto_unregister(&sctp_prot);
1027}
1028
1029static int sctp_v4_add_protocol(void)
1030{
1031 /* Register notifier for inet address additions/deletions. */
1032 register_inetaddr_notifier(&sctp_inetaddr_notifier);
1033
1034 /* Register SCTP with inet layer. */
1035 if (inet_add_protocol(&sctp_protocol, IPPROTO_SCTP) < 0)
1036 return -EAGAIN;
1037
1038 return 0;
1039}
1040
1041static void sctp_v4_del_protocol(void)
1042{
1043 inet_del_protocol(&sctp_protocol, IPPROTO_SCTP);
1044 unregister_inetaddr_notifier(&sctp_inetaddr_notifier);
1045}
1046
995/* Initialize the universe into something sensible. */ 1047/* Initialize the universe into something sensible. */
996SCTP_STATIC __init int sctp_init(void) 1048SCTP_STATIC __init int sctp_init(void)
997{ 1049{
@@ -1035,8 +1087,6 @@ SCTP_STATIC __init int sctp_init(void)
1035 /* Initialize object count debugging. */ 1087 /* Initialize object count debugging. */
1036 sctp_dbg_objcnt_init(); 1088 sctp_dbg_objcnt_init();
1037 1089
1038 /* Initialize the SCTP specific PF functions. */
1039 sctp_register_pf(&sctp_pf_inet, PF_INET);
1040 /* 1090 /*
1041 * 14. Suggested SCTP Protocol Parameter Values 1091 * 14. Suggested SCTP Protocol Parameter Values
1042 */ 1092 */
@@ -1194,19 +1244,22 @@ SCTP_STATIC __init int sctp_init(void)
1194 sctp_sysctl_register(); 1244 sctp_sysctl_register();
1195 1245
1196 INIT_LIST_HEAD(&sctp_address_families); 1246 INIT_LIST_HEAD(&sctp_address_families);
1197 sctp_register_af(&sctp_af_inet); 1247 sctp_v4_pf_init();
1248 sctp_v6_pf_init();
1198 1249
1199 status = proto_register(&sctp_prot, 1); 1250 /* Initialize the local address list. */
1200 if (status) 1251 INIT_LIST_HEAD(&sctp_local_addr_list);
1201 goto err_proto_register; 1252 spin_lock_init(&sctp_local_addr_lock);
1253 sctp_get_local_addr_list();
1202 1254
1203 /* Register SCTP(UDP and TCP style) with socket layer. */ 1255 status = sctp_v4_protosw_init();
1204 inet_register_protosw(&sctp_seqpacket_protosw);
1205 inet_register_protosw(&sctp_stream_protosw);
1206 1256
1207 status = sctp_v6_init();
1208 if (status) 1257 if (status)
1209 goto err_v6_init; 1258 goto err_protosw_init;
1259
1260 status = sctp_v6_protosw_init();
1261 if (status)
1262 goto err_v6_protosw_init;
1210 1263
1211 /* Initialize the control inode/socket for handling OOTB packets. */ 1264 /* Initialize the control inode/socket for handling OOTB packets. */
1212 if ((status = sctp_ctl_sock_init())) { 1265 if ((status = sctp_ctl_sock_init())) {
@@ -1215,19 +1268,9 @@ SCTP_STATIC __init int sctp_init(void)
1215 goto err_ctl_sock_init; 1268 goto err_ctl_sock_init;
1216 } 1269 }
1217 1270
1218 /* Initialize the local address list. */ 1271 status = sctp_v4_add_protocol();
1219 INIT_LIST_HEAD(&sctp_local_addr_list); 1272 if (status)
1220 spin_lock_init(&sctp_local_addr_lock);
1221 sctp_get_local_addr_list();
1222
1223 /* Register notifier for inet address additions/deletions. */
1224 register_inetaddr_notifier(&sctp_inetaddr_notifier);
1225
1226 /* Register SCTP with inet layer. */
1227 if (inet_add_protocol(&sctp_protocol, IPPROTO_SCTP) < 0) {
1228 status = -EAGAIN;
1229 goto err_add_protocol; 1273 goto err_add_protocol;
1230 }
1231 1274
1232 /* Register SCTP with inet6 layer. */ 1275 /* Register SCTP with inet6 layer. */
1233 status = sctp_v6_add_protocol(); 1276 status = sctp_v6_add_protocol();
@@ -1238,18 +1281,18 @@ SCTP_STATIC __init int sctp_init(void)
1238out: 1281out:
1239 return status; 1282 return status;
1240err_v6_add_protocol: 1283err_v6_add_protocol:
1241 inet_del_protocol(&sctp_protocol, IPPROTO_SCTP); 1284 sctp_v6_del_protocol();
1242 unregister_inetaddr_notifier(&sctp_inetaddr_notifier);
1243err_add_protocol: 1285err_add_protocol:
1244 sctp_free_local_addr_list(); 1286 sctp_v4_del_protocol();
1245 sock_release(sctp_ctl_socket); 1287 sock_release(sctp_ctl_socket);
1246err_ctl_sock_init: 1288err_ctl_sock_init:
1247 sctp_v6_exit(); 1289 sctp_v6_protosw_exit();
1248err_v6_init: 1290err_v6_protosw_init:
1249 inet_unregister_protosw(&sctp_stream_protosw); 1291 sctp_v4_protosw_exit();
1250 inet_unregister_protosw(&sctp_seqpacket_protosw); 1292err_protosw_init:
1251 proto_unregister(&sctp_prot); 1293 sctp_free_local_addr_list();
1252err_proto_register: 1294 sctp_v4_pf_exit();
1295 sctp_v6_pf_exit();
1253 sctp_sysctl_unregister(); 1296 sctp_sysctl_unregister();
1254 list_del(&sctp_af_inet.list); 1297 list_del(&sctp_af_inet.list);
1255 free_pages((unsigned long)sctp_port_hashtable, 1298 free_pages((unsigned long)sctp_port_hashtable,
@@ -1282,23 +1325,21 @@ SCTP_STATIC __exit void sctp_exit(void)
1282 1325
1283 /* Unregister with inet6/inet layers. */ 1326 /* Unregister with inet6/inet layers. */
1284 sctp_v6_del_protocol(); 1327 sctp_v6_del_protocol();
1285 inet_del_protocol(&sctp_protocol, IPPROTO_SCTP); 1328 sctp_v4_del_protocol();
1286
1287 /* Unregister notifier for inet address additions/deletions. */
1288 unregister_inetaddr_notifier(&sctp_inetaddr_notifier);
1289
1290 /* Free the local address list. */
1291 sctp_free_local_addr_list();
1292 1329
1293 /* Free the control endpoint. */ 1330 /* Free the control endpoint. */
1294 sock_release(sctp_ctl_socket); 1331 sock_release(sctp_ctl_socket);
1295 1332
1296 /* Cleanup v6 initializations. */ 1333 /* Free protosw registrations */
1297 sctp_v6_exit(); 1334 sctp_v6_protosw_exit();
1335 sctp_v4_protosw_exit();
1336
1337 /* Free the local address list. */
1338 sctp_free_local_addr_list();
1298 1339
1299 /* Unregister with socket layer. */ 1340 /* Unregister with socket layer. */
1300 inet_unregister_protosw(&sctp_stream_protosw); 1341 sctp_v6_pf_exit();
1301 inet_unregister_protosw(&sctp_seqpacket_protosw); 1342 sctp_v4_pf_exit();
1302 1343
1303 sctp_sysctl_unregister(); 1344 sctp_sysctl_unregister();
1304 list_del(&sctp_af_inet.list); 1345 list_del(&sctp_af_inet.list);
@@ -1317,8 +1358,6 @@ SCTP_STATIC __exit void sctp_exit(void)
1317 1358
1318 kmem_cache_destroy(sctp_chunk_cachep); 1359 kmem_cache_destroy(sctp_chunk_cachep);
1319 kmem_cache_destroy(sctp_bucket_cachep); 1360 kmem_cache_destroy(sctp_bucket_cachep);
1320
1321 proto_unregister(&sctp_prot);
1322} 1361}
1323 1362
1324module_init(sctp_init); 1363module_init(sctp_init);
diff --git a/net/socket.c b/net/socket.c
index b6d35cd72a50..9d3fbfbc8535 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -909,11 +909,10 @@ static long sock_ioctl(struct file *file, unsigned cmd, unsigned long arg)
909 if (!dlci_ioctl_hook) 909 if (!dlci_ioctl_hook)
910 request_module("dlci"); 910 request_module("dlci");
911 911
912 if (dlci_ioctl_hook) { 912 mutex_lock(&dlci_ioctl_mutex);
913 mutex_lock(&dlci_ioctl_mutex); 913 if (dlci_ioctl_hook)
914 err = dlci_ioctl_hook(cmd, argp); 914 err = dlci_ioctl_hook(cmd, argp);
915 mutex_unlock(&dlci_ioctl_mutex); 915 mutex_unlock(&dlci_ioctl_mutex);
916 }
917 break; 916 break;
918 default: 917 default:
919 err = sock->ops->ioctl(sock, cmd, arg); 918 err = sock->ops->ioctl(sock, cmd, arg);
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c
index 61801a069ff0..bce9d527af08 100644
--- a/net/sunrpc/auth_gss/gss_mech_switch.c
+++ b/net/sunrpc/auth_gss/gss_mech_switch.c
@@ -317,7 +317,7 @@ gss_delete_sec_context(struct gss_ctx **context_handle)
317 317
318 if (!*context_handle) 318 if (!*context_handle)
319 return(GSS_S_NO_CONTEXT); 319 return(GSS_S_NO_CONTEXT);
320 if ((*context_handle)->internal_ctx_id != 0) 320 if ((*context_handle)->internal_ctx_id)
321 (*context_handle)->mech_type->gm_ops 321 (*context_handle)->mech_type->gm_ops
322 ->gss_delete_sec_context((*context_handle) 322 ->gss_delete_sec_context((*context_handle)
323 ->internal_ctx_id); 323 ->internal_ctx_id);
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index ea377e06afae..332eb47539e1 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -185,7 +185,7 @@ int svc_create_xprt(struct svc_serv *serv, char *xprt_name, unsigned short port,
185 struct svc_xprt_class *xcl; 185 struct svc_xprt_class *xcl;
186 struct sockaddr_in sin = { 186 struct sockaddr_in sin = {
187 .sin_family = AF_INET, 187 .sin_family = AF_INET,
188 .sin_addr.s_addr = INADDR_ANY, 188 .sin_addr.s_addr = htonl(INADDR_ANY),
189 .sin_port = htons(port), 189 .sin_port = htons(port),
190 }; 190 };
191 dprintk("svc: creating transport %s[%d]\n", xprt_name, port); 191 dprintk("svc: creating transport %s[%d]\n", xprt_name, port);
diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
index ab54a736486e..971271602dd0 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
@@ -237,14 +237,12 @@ static void rdma_set_ctxt_sge(struct svc_rdma_op_ctxt *ctxt,
237 237
238static int rdma_read_max_sge(struct svcxprt_rdma *xprt, int sge_count) 238static int rdma_read_max_sge(struct svcxprt_rdma *xprt, int sge_count)
239{ 239{
240#ifdef RDMA_TRANSPORT_IWARP
241 if ((RDMA_TRANSPORT_IWARP == 240 if ((RDMA_TRANSPORT_IWARP ==
242 rdma_node_get_transport(xprt->sc_cm_id-> 241 rdma_node_get_transport(xprt->sc_cm_id->
243 device->node_type)) 242 device->node_type))
244 && sge_count > 1) 243 && sge_count > 1)
245 return 1; 244 return 1;
246 else 245 else
247#endif
248 return min_t(int, sge_count, xprt->sc_max_sge); 246 return min_t(int, sge_count, xprt->sc_max_sge);
249} 247}
250 248