aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/9p/mux.c4
-rw-r--r--net/core/dev.c20
-rw-r--r--net/core/flow.c5
-rw-r--r--net/core/net-sysfs.c2
-rw-r--r--net/core/net-sysfs.h8
-rw-r--r--net/core/skbuff.c9
-rw-r--r--net/core/sysctl_net_core.c17
-rw-r--r--net/dccp/proto.c33
-rw-r--r--net/ethernet/eth.c9
-rw-r--r--net/ieee80211/ieee80211_crypt_tkip.c11
-rw-r--r--net/ieee80211/ieee80211_crypt_wep.c2
-rw-r--r--net/ipv4/fib_frontend.c12
-rw-r--r--net/ipv4/ip_gre.c14
-rw-r--r--net/ipv4/ip_output.c2
-rw-r--r--net/ipv4/ipip.c2
-rw-r--r--net/ipv4/ipvs/ip_vs_xmit.c2
-rw-r--r--net/ipv4/proc.c8
-rw-r--r--net/ipv4/tcp_input.c2
-rw-r--r--net/ipv4/udp.c2
-rw-r--r--net/ipv6/ip6_output.c2
-rw-r--r--net/ipv6/ip6_tunnel.c2
-rw-r--r--net/ipv6/sit.c2
-rw-r--r--net/netlink/af_netlink.c16
-rw-r--r--net/sched/sch_prio.c4
-rw-r--r--net/sctp/auth.c4
-rw-r--r--net/sctp/sm_make_chunk.c8
-rw-r--r--net/sctp/ulpqueue.c34
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_crypto.c14
-rw-r--r--net/sunrpc/xdr.c4
-rw-r--r--net/xfrm/xfrm_algo.c9
30 files changed, 138 insertions, 125 deletions
diff --git a/net/9p/mux.c b/net/9p/mux.c
index f14014793be..c9f0805048e 100644
--- a/net/9p/mux.c
+++ b/net/9p/mux.c
@@ -222,8 +222,10 @@ static int p9_mux_poll_start(struct p9_conn *m)
222 } 222 }
223 223
224 if (i >= ARRAY_SIZE(p9_mux_poll_tasks)) { 224 if (i >= ARRAY_SIZE(p9_mux_poll_tasks)) {
225 if (vptlast == NULL) 225 if (vptlast == NULL) {
226 mutex_unlock(&p9_mux_task_lock);
226 return -ENOMEM; 227 return -ENOMEM;
228 }
227 229
228 P9_DPRINTK(P9_DEBUG_MUX, "put in proc %d\n", i); 230 P9_DPRINTK(P9_DEBUG_MUX, "put in proc %d\n", i);
229 list_add(&m->mux_list, &vptlast->mux_list); 231 list_add(&m->mux_list, &vptlast->mux_list);
diff --git a/net/core/dev.c b/net/core/dev.c
index 872658927e4..f1647d7dd14 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -120,6 +120,8 @@
120#include <linux/ctype.h> 120#include <linux/ctype.h>
121#include <linux/if_arp.h> 121#include <linux/if_arp.h>
122 122
123#include "net-sysfs.h"
124
123/* 125/*
124 * The list of packet types we will receive (as opposed to discard) 126 * The list of packet types we will receive (as opposed to discard)
125 * and the routines to invoke. 127 * and the routines to invoke.
@@ -249,10 +251,6 @@ static RAW_NOTIFIER_HEAD(netdev_chain);
249 251
250DEFINE_PER_CPU(struct softnet_data, softnet_data); 252DEFINE_PER_CPU(struct softnet_data, softnet_data);
251 253
252extern int netdev_kobject_init(void);
253extern int netdev_register_kobject(struct net_device *);
254extern void netdev_unregister_kobject(struct net_device *);
255
256#ifdef CONFIG_DEBUG_LOCK_ALLOC 254#ifdef CONFIG_DEBUG_LOCK_ALLOC
257/* 255/*
258 * register_netdevice() inits dev->_xmit_lock and sets lockdep class 256 * register_netdevice() inits dev->_xmit_lock and sets lockdep class
@@ -1007,17 +1005,20 @@ int dev_open(struct net_device *dev)
1007 * Call device private open method 1005 * Call device private open method
1008 */ 1006 */
1009 set_bit(__LINK_STATE_START, &dev->state); 1007 set_bit(__LINK_STATE_START, &dev->state);
1010 if (dev->open) { 1008
1009 if (dev->validate_addr)
1010 ret = dev->validate_addr(dev);
1011
1012 if (!ret && dev->open)
1011 ret = dev->open(dev); 1013 ret = dev->open(dev);
1012 if (ret)
1013 clear_bit(__LINK_STATE_START, &dev->state);
1014 }
1015 1014
1016 /* 1015 /*
1017 * If it went open OK then: 1016 * If it went open OK then:
1018 */ 1017 */
1019 1018
1020 if (!ret) { 1019 if (ret)
1020 clear_bit(__LINK_STATE_START, &dev->state);
1021 else {
1021 /* 1022 /*
1022 * Set the flags. 1023 * Set the flags.
1023 */ 1024 */
@@ -1038,6 +1039,7 @@ int dev_open(struct net_device *dev)
1038 */ 1039 */
1039 call_netdevice_notifiers(NETDEV_UP, dev); 1040 call_netdevice_notifiers(NETDEV_UP, dev);
1040 } 1041 }
1042
1041 return ret; 1043 return ret;
1042} 1044}
1043 1045
diff --git a/net/core/flow.c b/net/core/flow.c
index 0ab5234b17d..3ed2b4b1d6d 100644
--- a/net/core/flow.c
+++ b/net/core/flow.c
@@ -142,8 +142,6 @@ typedef u64 flow_compare_t;
142typedef u32 flow_compare_t; 142typedef u32 flow_compare_t;
143#endif 143#endif
144 144
145extern void flowi_is_missized(void);
146
147/* I hear what you're saying, use memcmp. But memcmp cannot make 145/* I hear what you're saying, use memcmp. But memcmp cannot make
148 * important assumptions that we can here, such as alignment and 146 * important assumptions that we can here, such as alignment and
149 * constant size. 147 * constant size.
@@ -153,8 +151,7 @@ static int flow_key_compare(struct flowi *key1, struct flowi *key2)
153 flow_compare_t *k1, *k1_lim, *k2; 151 flow_compare_t *k1, *k1_lim, *k2;
154 const int n_elem = sizeof(struct flowi) / sizeof(flow_compare_t); 152 const int n_elem = sizeof(struct flowi) / sizeof(flow_compare_t);
155 153
156 if (sizeof(struct flowi) % sizeof(flow_compare_t)) 154 BUILD_BUG_ON(sizeof(struct flowi) % sizeof(flow_compare_t));
157 flowi_is_missized();
158 155
159 k1 = (flow_compare_t *) key1; 156 k1 = (flow_compare_t *) key1;
160 k1_lim = k1 + n_elem; 157 k1_lim = k1 + n_elem;
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 6628e457ddc..61ead1d1113 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -18,6 +18,8 @@
18#include <linux/wireless.h> 18#include <linux/wireless.h>
19#include <net/iw_handler.h> 19#include <net/iw_handler.h>
20 20
21#include "net-sysfs.h"
22
21#ifdef CONFIG_SYSFS 23#ifdef CONFIG_SYSFS
22static const char fmt_hex[] = "%#x\n"; 24static const char fmt_hex[] = "%#x\n";
23static const char fmt_long_hex[] = "%#lx\n"; 25static const char fmt_long_hex[] = "%#lx\n";
diff --git a/net/core/net-sysfs.h b/net/core/net-sysfs.h
new file mode 100644
index 00000000000..f5f108db392
--- /dev/null
+++ b/net/core/net-sysfs.h
@@ -0,0 +1,8 @@
1#ifndef __NET_SYSFS_H__
2#define __NET_SYSFS_H__
3
4int netdev_kobject_init(void);
5int netdev_register_kobject(struct net_device *);
6void netdev_unregister_kobject(struct net_device *);
7
8#endif
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 4e2c84fcf27..7b7c6c44c2d 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2045,9 +2045,7 @@ skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len)
2045 if (copy > 0) { 2045 if (copy > 0) {
2046 if (copy > len) 2046 if (copy > len)
2047 copy = len; 2047 copy = len;
2048 sg_set_page(&sg[elt], virt_to_page(skb->data + offset)); 2048 sg_set_buf(sg, skb->data + offset, copy);
2049 sg[elt].offset = (unsigned long)(skb->data + offset) % PAGE_SIZE;
2050 sg[elt].length = copy;
2051 elt++; 2049 elt++;
2052 if ((len -= copy) == 0) 2050 if ((len -= copy) == 0)
2053 return elt; 2051 return elt;
@@ -2065,9 +2063,8 @@ skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len)
2065 2063
2066 if (copy > len) 2064 if (copy > len)
2067 copy = len; 2065 copy = len;
2068 sg_set_page(&sg[elt], frag->page); 2066 sg_set_page(&sg[elt], frag->page, copy,
2069 sg[elt].offset = frag->page_offset+offset-start; 2067 frag->page_offset+offset-start);
2070 sg[elt].length = copy;
2071 elt++; 2068 elt++;
2072 if (!(len -= copy)) 2069 if (!(len -= copy))
2073 return elt; 2070 return elt;
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 6d5ea976204..113cc728dc3 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -9,25 +9,12 @@
9#include <linux/sysctl.h> 9#include <linux/sysctl.h>
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/socket.h> 11#include <linux/socket.h>
12#include <linux/netdevice.h>
12#include <net/sock.h> 13#include <net/sock.h>
14#include <net/xfrm.h>
13 15
14#ifdef CONFIG_SYSCTL 16#ifdef CONFIG_SYSCTL
15 17
16extern int netdev_max_backlog;
17extern int weight_p;
18
19extern __u32 sysctl_wmem_max;
20extern __u32 sysctl_rmem_max;
21
22extern int sysctl_core_destroy_delay;
23
24#ifdef CONFIG_XFRM
25extern u32 sysctl_xfrm_aevent_etime;
26extern u32 sysctl_xfrm_aevent_rseqth;
27extern int sysctl_xfrm_larval_drop;
28extern u32 sysctl_xfrm_acq_expires;
29#endif
30
31ctl_table core_table[] = { 18ctl_table core_table[] = {
32#ifdef CONFIG_NET 19#ifdef CONFIG_NET
33 { 20 {
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index cc9bf1cb264..d8497392803 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -26,6 +26,7 @@
26#include <net/sock.h> 26#include <net/sock.h>
27#include <net/xfrm.h> 27#include <net/xfrm.h>
28 28
29#include <asm/ioctls.h>
29#include <asm/semaphore.h> 30#include <asm/semaphore.h>
30#include <linux/spinlock.h> 31#include <linux/spinlock.h>
31#include <linux/timer.h> 32#include <linux/timer.h>
@@ -378,8 +379,36 @@ EXPORT_SYMBOL_GPL(dccp_poll);
378 379
379int dccp_ioctl(struct sock *sk, int cmd, unsigned long arg) 380int dccp_ioctl(struct sock *sk, int cmd, unsigned long arg)
380{ 381{
381 dccp_pr_debug("entry\n"); 382 int rc = -ENOTCONN;
382 return -ENOIOCTLCMD; 383
384 lock_sock(sk);
385
386 if (sk->sk_state == DCCP_LISTEN)
387 goto out;
388
389 switch (cmd) {
390 case SIOCINQ: {
391 struct sk_buff *skb;
392 unsigned long amount = 0;
393
394 skb = skb_peek(&sk->sk_receive_queue);
395 if (skb != NULL) {
396 /*
397 * We will only return the amount of this packet since
398 * that is all that will be read.
399 */
400 amount = skb->len;
401 }
402 rc = put_user(amount, (int __user *)arg);
403 }
404 break;
405 default:
406 rc = -ENOIOCTLCMD;
407 break;
408 }
409out:
410 release_sock(sk);
411 return rc;
383} 412}
384 413
385EXPORT_SYMBOL_GPL(dccp_ioctl); 414EXPORT_SYMBOL_GPL(dccp_ioctl);
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index ed8a3d49487..6b2e454ae31 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -298,6 +298,14 @@ static int eth_change_mtu(struct net_device *dev, int new_mtu)
298 return 0; 298 return 0;
299} 299}
300 300
301static int eth_validate_addr(struct net_device *dev)
302{
303 if (!is_valid_ether_addr(dev->dev_addr))
304 return -EINVAL;
305
306 return 0;
307}
308
301const struct header_ops eth_header_ops ____cacheline_aligned = { 309const struct header_ops eth_header_ops ____cacheline_aligned = {
302 .create = eth_header, 310 .create = eth_header,
303 .parse = eth_header_parse, 311 .parse = eth_header_parse,
@@ -317,6 +325,7 @@ void ether_setup(struct net_device *dev)
317 325
318 dev->change_mtu = eth_change_mtu; 326 dev->change_mtu = eth_change_mtu;
319 dev->set_mac_address = eth_mac_addr; 327 dev->set_mac_address = eth_mac_addr;
328 dev->validate_addr = eth_validate_addr;
320 329
321 dev->type = ARPHRD_ETHER; 330 dev->type = ARPHRD_ETHER;
322 dev->hard_header_len = ETH_HLEN; 331 dev->hard_header_len = ETH_HLEN;
diff --git a/net/ieee80211/ieee80211_crypt_tkip.c b/net/ieee80211/ieee80211_crypt_tkip.c
index 811777682e2..4cce3534e40 100644
--- a/net/ieee80211/ieee80211_crypt_tkip.c
+++ b/net/ieee80211/ieee80211_crypt_tkip.c
@@ -25,7 +25,7 @@
25#include <net/ieee80211.h> 25#include <net/ieee80211.h>
26 26
27#include <linux/crypto.h> 27#include <linux/crypto.h>
28#include <asm/scatterlist.h> 28#include <linux/scatterlist.h>
29#include <linux/crc32.h> 29#include <linux/crc32.h>
30 30
31MODULE_AUTHOR("Jouni Malinen"); 31MODULE_AUTHOR("Jouni Malinen");
@@ -537,13 +537,8 @@ static int michael_mic(struct crypto_hash *tfm_michael, u8 * key, u8 * hdr,
537 return -1; 537 return -1;
538 } 538 }
539 sg_init_table(sg, 2); 539 sg_init_table(sg, 2);
540 sg_set_page(&sg[0], virt_to_page(hdr)); 540 sg_set_buf(&sg[0], hdr, 16);
541 sg[0].offset = offset_in_page(hdr); 541 sg_set_buf(&sg[1], data, data_len);
542 sg[0].length = 16;
543
544 sg_set_page(&sg[1], virt_to_page(data));
545 sg[1].offset = offset_in_page(data);
546 sg[1].length = data_len;
547 542
548 if (crypto_hash_setkey(tfm_michael, key, 8)) 543 if (crypto_hash_setkey(tfm_michael, key, 8))
549 return -1; 544 return -1;
diff --git a/net/ieee80211/ieee80211_crypt_wep.c b/net/ieee80211/ieee80211_crypt_wep.c
index 9693429489e..866fc04c44f 100644
--- a/net/ieee80211/ieee80211_crypt_wep.c
+++ b/net/ieee80211/ieee80211_crypt_wep.c
@@ -22,7 +22,7 @@
22#include <net/ieee80211.h> 22#include <net/ieee80211.h>
23 23
24#include <linux/crypto.h> 24#include <linux/crypto.h>
25#include <asm/scatterlist.h> 25#include <linux/scatterlist.h>
26#include <linux/crc32.h> 26#include <linux/crc32.h>
27 27
28MODULE_AUTHOR("Jouni Malinen"); 28MODULE_AUTHOR("Jouni Malinen");
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 78b514ba141..60123905dbb 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -128,13 +128,14 @@ struct net_device * ip_dev_find(__be32 addr)
128 struct flowi fl = { .nl_u = { .ip4_u = { .daddr = addr } } }; 128 struct flowi fl = { .nl_u = { .ip4_u = { .daddr = addr } } };
129 struct fib_result res; 129 struct fib_result res;
130 struct net_device *dev = NULL; 130 struct net_device *dev = NULL;
131 struct fib_table *local_table;
131 132
132#ifdef CONFIG_IP_MULTIPLE_TABLES 133#ifdef CONFIG_IP_MULTIPLE_TABLES
133 res.r = NULL; 134 res.r = NULL;
134#endif 135#endif
135 136
136 if (!ip_fib_local_table || 137 local_table = fib_get_table(RT_TABLE_LOCAL);
137 ip_fib_local_table->tb_lookup(ip_fib_local_table, &fl, &res)) 138 if (!local_table || local_table->tb_lookup(local_table, &fl, &res))
138 return NULL; 139 return NULL;
139 if (res.type != RTN_LOCAL) 140 if (res.type != RTN_LOCAL)
140 goto out; 141 goto out;
@@ -152,6 +153,7 @@ unsigned inet_addr_type(__be32 addr)
152 struct flowi fl = { .nl_u = { .ip4_u = { .daddr = addr } } }; 153 struct flowi fl = { .nl_u = { .ip4_u = { .daddr = addr } } };
153 struct fib_result res; 154 struct fib_result res;
154 unsigned ret = RTN_BROADCAST; 155 unsigned ret = RTN_BROADCAST;
156 struct fib_table *local_table;
155 157
156 if (ZERONET(addr) || BADCLASS(addr)) 158 if (ZERONET(addr) || BADCLASS(addr))
157 return RTN_BROADCAST; 159 return RTN_BROADCAST;
@@ -162,10 +164,10 @@ unsigned inet_addr_type(__be32 addr)
162 res.r = NULL; 164 res.r = NULL;
163#endif 165#endif
164 166
165 if (ip_fib_local_table) { 167 local_table = fib_get_table(RT_TABLE_LOCAL);
168 if (local_table) {
166 ret = RTN_UNICAST; 169 ret = RTN_UNICAST;
167 if (!ip_fib_local_table->tb_lookup(ip_fib_local_table, 170 if (!local_table->tb_lookup(local_table, &fl, &res)) {
168 &fl, &res)) {
169 ret = res.type; 171 ret = res.type;
170 fib_res_put(&res); 172 fib_res_put(&res);
171 } 173 }
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index f151900efaf..02b02a8d681 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -674,7 +674,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
674 struct rtable *rt; /* Route to the other host */ 674 struct rtable *rt; /* Route to the other host */
675 struct net_device *tdev; /* Device to other host */ 675 struct net_device *tdev; /* Device to other host */
676 struct iphdr *iph; /* Our new IP header */ 676 struct iphdr *iph; /* Our new IP header */
677 int max_headroom; /* The extra header space needed */ 677 unsigned int max_headroom; /* The extra header space needed */
678 int gre_hlen; 678 int gre_hlen;
679 __be32 dst; 679 __be32 dst;
680 int mtu; 680 int mtu;
@@ -1033,7 +1033,6 @@ static int ipgre_tunnel_change_mtu(struct net_device *dev, int new_mtu)
1033 return 0; 1033 return 0;
1034} 1034}
1035 1035
1036#ifdef CONFIG_NET_IPGRE_BROADCAST
1037/* Nice toy. Unfortunately, useless in real life :-) 1036/* Nice toy. Unfortunately, useless in real life :-)
1038 It allows to construct virtual multiprotocol broadcast "LAN" 1037 It allows to construct virtual multiprotocol broadcast "LAN"
1039 over the Internet, provided multicast routing is tuned. 1038 over the Internet, provided multicast routing is tuned.
@@ -1092,10 +1091,19 @@ static int ipgre_header(struct sk_buff *skb, struct net_device *dev,
1092 return -t->hlen; 1091 return -t->hlen;
1093} 1092}
1094 1093
1094static int ipgre_header_parse(const struct sk_buff *skb, unsigned char *haddr)
1095{
1096 struct iphdr *iph = (struct iphdr*) skb_mac_header(skb);
1097 memcpy(haddr, &iph->saddr, 4);
1098 return 4;
1099}
1100
1095static const struct header_ops ipgre_header_ops = { 1101static const struct header_ops ipgre_header_ops = {
1096 .create = ipgre_header, 1102 .create = ipgre_header,
1103 .parse = ipgre_header_parse,
1097}; 1104};
1098 1105
1106#ifdef CONFIG_NET_IPGRE_BROADCAST
1099static int ipgre_open(struct net_device *dev) 1107static int ipgre_open(struct net_device *dev)
1100{ 1108{
1101 struct ip_tunnel *t = netdev_priv(dev); 1109 struct ip_tunnel *t = netdev_priv(dev);
@@ -1197,6 +1205,8 @@ static int ipgre_tunnel_init(struct net_device *dev)
1197 dev->stop = ipgre_close; 1205 dev->stop = ipgre_close;
1198 } 1206 }
1199#endif 1207#endif
1208 } else {
1209 dev->header_ops = &ipgre_header_ops;
1200 } 1210 }
1201 1211
1202 if (!tdev && tunnel->parms.link) 1212 if (!tdev && tunnel->parms.link)
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index f508835ba71..e5f7dc2de30 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -161,7 +161,7 @@ static inline int ip_finish_output2(struct sk_buff *skb)
161 struct dst_entry *dst = skb->dst; 161 struct dst_entry *dst = skb->dst;
162 struct rtable *rt = (struct rtable *)dst; 162 struct rtable *rt = (struct rtable *)dst;
163 struct net_device *dev = dst->dev; 163 struct net_device *dev = dst->dev;
164 int hh_len = LL_RESERVED_SPACE(dev); 164 unsigned int hh_len = LL_RESERVED_SPACE(dev);
165 165
166 if (rt->rt_type == RTN_MULTICAST) 166 if (rt->rt_type == RTN_MULTICAST)
167 IP_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS); 167 IP_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS);
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 5cd5bbe1379..8c2b2b0741d 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -515,7 +515,7 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
515 struct net_device *tdev; /* Device to other host */ 515 struct net_device *tdev; /* Device to other host */
516 struct iphdr *old_iph = ip_hdr(skb); 516 struct iphdr *old_iph = ip_hdr(skb);
517 struct iphdr *iph; /* Our new IP header */ 517 struct iphdr *iph; /* Our new IP header */
518 int max_headroom; /* The extra header space needed */ 518 unsigned int max_headroom; /* The extra header space needed */
519 __be32 dst = tiph->daddr; 519 __be32 dst = tiph->daddr;
520 int mtu; 520 int mtu;
521 521
diff --git a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c
index d0a92dec105..7c074e386c1 100644
--- a/net/ipv4/ipvs/ip_vs_xmit.c
+++ b/net/ipv4/ipvs/ip_vs_xmit.c
@@ -325,7 +325,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
325 __be16 df = old_iph->frag_off; 325 __be16 df = old_iph->frag_off;
326 sk_buff_data_t old_transport_header = skb->transport_header; 326 sk_buff_data_t old_transport_header = skb->transport_header;
327 struct iphdr *iph; /* Our new IP header */ 327 struct iphdr *iph; /* Our new IP header */
328 int max_headroom; /* The extra header space needed */ 328 unsigned int max_headroom; /* The extra header space needed */
329 int mtu; 329 int mtu;
330 330
331 EnterFunction(10); 331 EnterFunction(10);
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index fd16cb8f8ab..9be0daa9c0e 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -121,14 +121,6 @@ static const struct snmp_mib snmp4_ipextstats_list[] = {
121 SNMP_MIB_SENTINEL 121 SNMP_MIB_SENTINEL
122}; 122};
123 123
124static const struct snmp_mib snmp4_icmp_list[] = {
125 SNMP_MIB_ITEM("InMsgs", ICMP_MIB_INMSGS),
126 SNMP_MIB_ITEM("InErrors", ICMP_MIB_INERRORS),
127 SNMP_MIB_ITEM("OutMsgs", ICMP_MIB_OUTMSGS),
128 SNMP_MIB_ITEM("OutErrors", ICMP_MIB_OUTERRORS),
129 SNMP_MIB_SENTINEL
130};
131
132static struct { 124static struct {
133 char *name; 125 char *name;
134 int index; 126 int index;
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 9288220b73a..3dbbb44b3e7 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3909,7 +3909,7 @@ tcp_collapse(struct sock *sk, struct sk_buff_head *list,
3909 3909
3910 while (before(start, end)) { 3910 while (before(start, end)) {
3911 struct sk_buff *nskb; 3911 struct sk_buff *nskb;
3912 int header = skb_headroom(skb); 3912 unsigned int header = skb_headroom(skb);
3913 int copy = SKB_MAX_ORDER(header, 0); 3913 int copy = SKB_MAX_ORDER(header, 0);
3914 3914
3915 /* Too big header? This can happen with IPv6. */ 3915 /* Too big header? This can happen with IPv6. */
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 35d2b0e9e10..4bc25b46f33 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1152,7 +1152,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[],
1152 return __udp4_lib_mcast_deliver(skb, uh, saddr, daddr, udptable); 1152 return __udp4_lib_mcast_deliver(skb, uh, saddr, daddr, udptable);
1153 1153
1154 sk = __udp4_lib_lookup(saddr, uh->source, daddr, uh->dest, 1154 sk = __udp4_lib_lookup(saddr, uh->source, daddr, uh->dest,
1155 skb->dev->ifindex, udptable ); 1155 inet_iif(skb), udptable);
1156 1156
1157 if (sk != NULL) { 1157 if (sk != NULL) {
1158 int ret = udp_queue_rcv_skb(sk, skb); 1158 int ret = udp_queue_rcv_skb(sk, skb);
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 13565dfb1b4..653fc0a8235 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -171,7 +171,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
171 u32 mtu; 171 u32 mtu;
172 172
173 if (opt) { 173 if (opt) {
174 int head_room; 174 unsigned int head_room;
175 175
176 /* First: exthdrs may take lots of space (~8K for now) 176 /* First: exthdrs may take lots of space (~8K for now)
177 MAX_HEADER is not enough. 177 MAX_HEADER is not enough.
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 2320cc27ff9..5383b33db8c 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -838,7 +838,7 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
838 struct dst_entry *dst; 838 struct dst_entry *dst;
839 struct net_device *tdev; 839 struct net_device *tdev;
840 int mtu; 840 int mtu;
841 int max_headroom = sizeof(struct ipv6hdr); 841 unsigned int max_headroom = sizeof(struct ipv6hdr);
842 u8 proto; 842 u8 proto;
843 int err = -1; 843 int err = -1;
844 int pkt_len; 844 int pkt_len;
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 466657a9a8b..71433d29d88 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -430,7 +430,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
430 struct rtable *rt; /* Route to the other host */ 430 struct rtable *rt; /* Route to the other host */
431 struct net_device *tdev; /* Device to other host */ 431 struct net_device *tdev; /* Device to other host */
432 struct iphdr *iph; /* Our new IP header */ 432 struct iphdr *iph; /* Our new IP header */
433 int max_headroom; /* The extra header space needed */ 433 unsigned int max_headroom; /* The extra header space needed */
434 __be32 dst = tiph->daddr; 434 __be32 dst = tiph->daddr;
435 int mtu; 435 int mtu;
436 struct in6_addr *addr6; 436 struct in6_addr *addr6;
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 98e313e5e59..325272925d0 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1565,7 +1565,11 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
1565 1565
1566 netlink_dump(sk); 1566 netlink_dump(sk);
1567 sock_put(sk); 1567 sock_put(sk);
1568 return 0; 1568
1569 /* We successfully started a dump, by returning -EINTR we
1570 * signal not to send ACK even if it was requested.
1571 */
1572 return -EINTR;
1569} 1573}
1570 1574
1571void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err) 1575void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err)
@@ -1619,17 +1623,21 @@ int netlink_rcv_skb(struct sk_buff *skb, int (*cb)(struct sk_buff *,
1619 1623
1620 /* Only requests are handled by the kernel */ 1624 /* Only requests are handled by the kernel */
1621 if (!(nlh->nlmsg_flags & NLM_F_REQUEST)) 1625 if (!(nlh->nlmsg_flags & NLM_F_REQUEST))
1622 goto skip; 1626 goto ack;
1623 1627
1624 /* Skip control messages */ 1628 /* Skip control messages */
1625 if (nlh->nlmsg_type < NLMSG_MIN_TYPE) 1629 if (nlh->nlmsg_type < NLMSG_MIN_TYPE)
1626 goto skip; 1630 goto ack;
1627 1631
1628 err = cb(skb, nlh); 1632 err = cb(skb, nlh);
1629skip: 1633 if (err == -EINTR)
1634 goto skip;
1635
1636ack:
1630 if (nlh->nlmsg_flags & NLM_F_ACK || err) 1637 if (nlh->nlmsg_flags & NLM_F_ACK || err)
1631 netlink_ack(skb, nlh, err); 1638 netlink_ack(skb, nlh, err);
1632 1639
1640skip:
1633 msglen = NLMSG_ALIGN(nlh->nlmsg_len); 1641 msglen = NLMSG_ALIGN(nlh->nlmsg_len);
1634 if (msglen > skb->len) 1642 if (msglen > skb->len)
1635 msglen = skb->len; 1643 msglen = skb->len;
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
index abd82fc3ec6..de894096e44 100644
--- a/net/sched/sch_prio.c
+++ b/net/sched/sch_prio.c
@@ -136,7 +136,7 @@ prio_dequeue(struct Qdisc* sch)
136 * pulling an skb. This way we avoid excessive requeues 136 * pulling an skb. This way we avoid excessive requeues
137 * for slower queues. 137 * for slower queues.
138 */ 138 */
139 if (!netif_subqueue_stopped(sch->dev, (q->mq ? prio : 0))) { 139 if (!__netif_subqueue_stopped(sch->dev, (q->mq ? prio : 0))) {
140 qdisc = q->queues[prio]; 140 qdisc = q->queues[prio];
141 skb = qdisc->dequeue(qdisc); 141 skb = qdisc->dequeue(qdisc);
142 if (skb) { 142 if (skb) {
@@ -165,7 +165,7 @@ static struct sk_buff *rr_dequeue(struct Qdisc* sch)
165 * for slower queues. If the queue is stopped, try the 165 * for slower queues. If the queue is stopped, try the
166 * next queue. 166 * next queue.
167 */ 167 */
168 if (!netif_subqueue_stopped(sch->dev, 168 if (!__netif_subqueue_stopped(sch->dev,
169 (q->mq ? q->curband : 0))) { 169 (q->mq ? q->curband : 0))) {
170 qdisc = q->queues[q->curband]; 170 qdisc = q->queues[q->curband];
171 skb = qdisc->dequeue(qdisc); 171 skb = qdisc->dequeue(qdisc);
diff --git a/net/sctp/auth.c b/net/sctp/auth.c
index cbd64b216cc..621113a109b 100644
--- a/net/sctp/auth.c
+++ b/net/sctp/auth.c
@@ -727,9 +727,7 @@ void sctp_auth_calculate_hmac(const struct sctp_association *asoc,
727 /* set up scatter list */ 727 /* set up scatter list */
728 end = skb_tail_pointer(skb); 728 end = skb_tail_pointer(skb);
729 sg_init_table(&sg, 1); 729 sg_init_table(&sg, 1);
730 sg_set_page(&sg, virt_to_page(auth)); 730 sg_set_buf(&sg, auth, end - (unsigned char *)auth);
731 sg.offset = (unsigned long)(auth) % PAGE_SIZE;
732 sg.length = end - (unsigned char *)auth;
733 731
734 desc.tfm = asoc->ep->auth_hmacs[hmac_id]; 732 desc.tfm = asoc->ep->auth_hmacs[hmac_id];
735 desc.flags = 0; 733 desc.flags = 0;
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 658476c4d58..c055212875f 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1514,9 +1514,7 @@ static sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
1514 1514
1515 /* Sign the message. */ 1515 /* Sign the message. */
1516 sg_init_table(&sg, 1); 1516 sg_init_table(&sg, 1);
1517 sg_set_page(&sg, virt_to_page(&cookie->c)); 1517 sg_set_buf(&sg, &cookie->c, bodysize);
1518 sg.offset = (unsigned long)(&cookie->c) % PAGE_SIZE;
1519 sg.length = bodysize;
1520 keylen = SCTP_SECRET_SIZE; 1518 keylen = SCTP_SECRET_SIZE;
1521 key = (char *)ep->secret_key[ep->current_key]; 1519 key = (char *)ep->secret_key[ep->current_key];
1522 desc.tfm = sctp_sk(ep->base.sk)->hmac; 1520 desc.tfm = sctp_sk(ep->base.sk)->hmac;
@@ -1587,9 +1585,7 @@ struct sctp_association *sctp_unpack_cookie(
1587 /* Check the signature. */ 1585 /* Check the signature. */
1588 keylen = SCTP_SECRET_SIZE; 1586 keylen = SCTP_SECRET_SIZE;
1589 sg_init_table(&sg, 1); 1587 sg_init_table(&sg, 1);
1590 sg_set_page(&sg, virt_to_page(bear_cookie)); 1588 sg_set_buf(&sg, bear_cookie, bodysize);
1591 sg.offset = (unsigned long)(bear_cookie) % PAGE_SIZE;
1592 sg.length = bodysize;
1593 key = (char *)ep->secret_key[ep->current_key]; 1589 key = (char *)ep->secret_key[ep->current_key];
1594 desc.tfm = sctp_sk(ep->base.sk)->hmac; 1590 desc.tfm = sctp_sk(ep->base.sk)->hmac;
1595 desc.flags = 0; 1591 desc.flags = 0;
diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
index b9370956b18..4be92d0a2ca 100644
--- a/net/sctp/ulpqueue.c
+++ b/net/sctp/ulpqueue.c
@@ -908,8 +908,8 @@ void sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn)
908 return; 908 return;
909} 909}
910 910
911/* Renege 'needed' bytes from the ordering queue. */ 911static __u16 sctp_ulpq_renege_list(struct sctp_ulpq *ulpq,
912static __u16 sctp_ulpq_renege_order(struct sctp_ulpq *ulpq, __u16 needed) 912 struct sk_buff_head *list, __u16 needed)
913{ 913{
914 __u16 freed = 0; 914 __u16 freed = 0;
915 __u32 tsn; 915 __u32 tsn;
@@ -919,7 +919,7 @@ static __u16 sctp_ulpq_renege_order(struct sctp_ulpq *ulpq, __u16 needed)
919 919
920 tsnmap = &ulpq->asoc->peer.tsn_map; 920 tsnmap = &ulpq->asoc->peer.tsn_map;
921 921
922 while ((skb = __skb_dequeue_tail(&ulpq->lobby)) != NULL) { 922 while ((skb = __skb_dequeue_tail(list)) != NULL) {
923 freed += skb_headlen(skb); 923 freed += skb_headlen(skb);
924 event = sctp_skb2event(skb); 924 event = sctp_skb2event(skb);
925 tsn = event->tsn; 925 tsn = event->tsn;
@@ -933,30 +933,16 @@ static __u16 sctp_ulpq_renege_order(struct sctp_ulpq *ulpq, __u16 needed)
933 return freed; 933 return freed;
934} 934}
935 935
936/* Renege 'needed' bytes from the ordering queue. */
937static __u16 sctp_ulpq_renege_order(struct sctp_ulpq *ulpq, __u16 needed)
938{
939 return sctp_ulpq_renege_list(ulpq, &ulpq->lobby, needed);
940}
941
936/* Renege 'needed' bytes from the reassembly queue. */ 942/* Renege 'needed' bytes from the reassembly queue. */
937static __u16 sctp_ulpq_renege_frags(struct sctp_ulpq *ulpq, __u16 needed) 943static __u16 sctp_ulpq_renege_frags(struct sctp_ulpq *ulpq, __u16 needed)
938{ 944{
939 __u16 freed = 0; 945 return sctp_ulpq_renege_list(ulpq, &ulpq->reasm, needed);
940 __u32 tsn;
941 struct sk_buff *skb;
942 struct sctp_ulpevent *event;
943 struct sctp_tsnmap *tsnmap;
944
945 tsnmap = &ulpq->asoc->peer.tsn_map;
946
947 /* Walk backwards through the list, reneges the newest tsns. */
948 while ((skb = __skb_dequeue_tail(&ulpq->reasm)) != NULL) {
949 freed += skb_headlen(skb);
950 event = sctp_skb2event(skb);
951 tsn = event->tsn;
952
953 sctp_ulpevent_free(event);
954 sctp_tsnmap_renege(tsnmap, tsn);
955 if (freed >= needed)
956 return freed;
957 }
958
959 return freed;
960} 946}
961 947
962/* Partial deliver the first message as there is pressure on rwnd. */ 948/* Partial deliver the first message as there is pressure on rwnd. */
diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c
index 32be431affc..24711be4b2d 100644
--- a/net/sunrpc/auth_gss/gss_krb5_crypto.c
+++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c
@@ -199,7 +199,7 @@ encryptor(struct scatterlist *sg, void *data)
199 } else { 199 } else {
200 in_page = sg_page(sg); 200 in_page = sg_page(sg);
201 } 201 }
202 sg_set_page(&desc->infrags[desc->fragno], in_page); 202 sg_assign_page(&desc->infrags[desc->fragno], in_page);
203 desc->fragno++; 203 desc->fragno++;
204 desc->fraglen += sg->length; 204 desc->fraglen += sg->length;
205 desc->pos += sg->length; 205 desc->pos += sg->length;
@@ -215,11 +215,10 @@ encryptor(struct scatterlist *sg, void *data)
215 if (ret) 215 if (ret)
216 return ret; 216 return ret;
217 if (fraglen) { 217 if (fraglen) {
218 sg_set_page(&desc->outfrags[0], sg_page(sg)); 218 sg_set_page(&desc->outfrags[0], sg_page(sg), fraglen,
219 desc->outfrags[0].offset = sg->offset + sg->length - fraglen; 219 sg->offset + sg->length - fraglen);
220 desc->outfrags[0].length = fraglen;
221 desc->infrags[0] = desc->outfrags[0]; 220 desc->infrags[0] = desc->outfrags[0];
222 sg_set_page(&desc->infrags[0], in_page); 221 sg_assign_page(&desc->infrags[0], in_page);
223 desc->fragno = 1; 222 desc->fragno = 1;
224 desc->fraglen = fraglen; 223 desc->fraglen = fraglen;
225 } else { 224 } else {
@@ -287,9 +286,8 @@ decryptor(struct scatterlist *sg, void *data)
287 if (ret) 286 if (ret)
288 return ret; 287 return ret;
289 if (fraglen) { 288 if (fraglen) {
290 sg_set_page(&desc->frags[0], sg_page(sg)); 289 sg_set_page(&desc->frags[0], sg_page(sg), fraglen,
291 desc->frags[0].offset = sg->offset + sg->length - fraglen; 290 sg->offset + sg->length - fraglen);
292 desc->frags[0].length = fraglen;
293 desc->fragno = 1; 291 desc->fragno = 1;
294 desc->fraglen = fraglen; 292 desc->fraglen = fraglen;
295 } else { 293 } else {
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
index 3d1f7cdf9dd..f38dac30481 100644
--- a/net/sunrpc/xdr.c
+++ b/net/sunrpc/xdr.c
@@ -1059,9 +1059,7 @@ xdr_process_buf(struct xdr_buf *buf, unsigned int offset, unsigned int len,
1059 do { 1059 do {
1060 if (thislen > page_len) 1060 if (thislen > page_len)
1061 thislen = page_len; 1061 thislen = page_len;
1062 sg_set_page(sg, buf->pages[i]); 1062 sg_set_page(sg, buf->pages[i], thislen, page_offset);
1063 sg->offset = page_offset;
1064 sg->length = thislen;
1065 ret = actor(sg, data); 1063 ret = actor(sg, data);
1066 if (ret) 1064 if (ret)
1067 goto out; 1065 goto out;
diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c
index 313d4bed3aa..fa45989a716 100644
--- a/net/xfrm/xfrm_algo.c
+++ b/net/xfrm/xfrm_algo.c
@@ -553,9 +553,7 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
553 if (copy > len) 553 if (copy > len)
554 copy = len; 554 copy = len;
555 555
556 sg_set_page(&sg, virt_to_page(skb->data + offset)); 556 sg_set_buf(&sg, skb->data + offset, copy);
557 sg.offset = (unsigned long)(skb->data + offset) % PAGE_SIZE;
558 sg.length = copy;
559 557
560 err = icv_update(desc, &sg, copy); 558 err = icv_update(desc, &sg, copy);
561 if (unlikely(err)) 559 if (unlikely(err))
@@ -578,9 +576,8 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
578 if (copy > len) 576 if (copy > len)
579 copy = len; 577 copy = len;
580 578
581 sg_set_page(&sg, frag->page); 579 sg_set_page(&sg, frag->page, copy,
582 sg.offset = frag->page_offset + offset-start; 580 frag->page_offset + offset-start);
583 sg.length = copy;
584 581
585 err = icv_update(desc, &sg, copy); 582 err = icv_update(desc, &sg, copy);
586 if (unlikely(err)) 583 if (unlikely(err))