aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-23 15:23:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-23 15:23:45 -0400
commitb0d19a378a409373244088511e889957645f2a44 (patch)
tree25275409eeea845f2e7617f12c8f28801ee4198f /net
parent0093cb1199ec551f179562ca9fbd6f64fb750645 (diff)
parentd7d313000ba2fc94a5383511a17ff38a39bab928 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: iwlwifi: Fix built-in compilation of iwlcore net: Unexport move_addr_to_{kernel,user} rt2x00: Select LEDS_CLASS. iwlwifi: Select LEDS_CLASS. leds: Do not guard NEW_LEDS with HAS_IOMEM [IPSEC]: Fix catch-22 with algorithm IDs above 31 time: Export set_normalized_timespec. tcp: Make use of before macro in tcp_input.c hamradio: Remove unneeded and deprecated cli()/sti() calls in dmascc.c [NETNS]: Remove empty ->init callback. [DCCP]: Convert do_gettimeofday() to getnstimeofday(). [NETNS]: Don't initialize err variable twice. [NETNS]: The ip6_fib_timer can work with garbage on net namespace stop. [IPV4]: Convert do_gettimeofday() to getnstimeofday(). [IPV4]: Make icmp_sk_init() static. [IPV6]: Make struct ip6_prohibit_entry_template static. tcp: Trivial fix to correct function name in a comment in net/ipv4/tcp.c [NET]: Expose netdevice dev_id through sysfs skbuff: fix missing kernel-doc notation [ROSE]: Fix soft lockup wrt. rose_node_list_lock
Diffstat (limited to 'net')
-rw-r--r--net/core/net-sysfs.c2
-rw-r--r--net/dccp/probe.c17
-rw-r--r--net/ipv4/icmp.c10
-rw-r--r--net/ipv4/ip_options.c12
-rw-r--r--net/ipv4/tcp.c2
-rw-r--r--net/ipv4/tcp_input.c2
-rw-r--r--net/ipv6/addrconf.c7
-rw-r--r--net/ipv6/ip6_fib.c2
-rw-r--r--net/ipv6/route.c5
-rw-r--r--net/key/af_key.c2
-rw-r--r--net/rose/rose_route.c2
-rw-r--r--net/socket.c3
-rw-r--r--net/xfrm/xfrm_policy.c2
-rw-r--r--net/xfrm/xfrm_user.c2
14 files changed, 28 insertions, 42 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 7635d3f72723..4e7b847347f7 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -87,6 +87,7 @@ static ssize_t netdev_store(struct device *dev, struct device_attribute *attr,
87 return ret; 87 return ret;
88} 88}
89 89
90NETDEVICE_SHOW(dev_id, fmt_hex);
90NETDEVICE_SHOW(addr_len, fmt_dec); 91NETDEVICE_SHOW(addr_len, fmt_dec);
91NETDEVICE_SHOW(iflink, fmt_dec); 92NETDEVICE_SHOW(iflink, fmt_dec);
92NETDEVICE_SHOW(ifindex, fmt_dec); 93NETDEVICE_SHOW(ifindex, fmt_dec);
@@ -210,6 +211,7 @@ static ssize_t store_tx_queue_len(struct device *dev,
210 211
211static struct device_attribute net_class_attributes[] = { 212static struct device_attribute net_class_attributes[] = {
212 __ATTR(addr_len, S_IRUGO, show_addr_len, NULL), 213 __ATTR(addr_len, S_IRUGO, show_addr_len, NULL),
214 __ATTR(dev_id, S_IRUGO, show_dev_id, NULL),
213 __ATTR(iflink, S_IRUGO, show_iflink, NULL), 215 __ATTR(iflink, S_IRUGO, show_iflink, NULL),
214 __ATTR(ifindex, S_IRUGO, show_ifindex, NULL), 216 __ATTR(ifindex, S_IRUGO, show_ifindex, NULL),
215 __ATTR(features, S_IRUGO, show_features, NULL), 217 __ATTR(features, S_IRUGO, show_features, NULL),
diff --git a/net/dccp/probe.c b/net/dccp/probe.c
index 7053bb827bc8..6e1df62bd7c9 100644
--- a/net/dccp/probe.c
+++ b/net/dccp/probe.c
@@ -46,29 +46,24 @@ struct {
46 struct kfifo *fifo; 46 struct kfifo *fifo;
47 spinlock_t lock; 47 spinlock_t lock;
48 wait_queue_head_t wait; 48 wait_queue_head_t wait;
49 struct timeval tstart; 49 struct timespec tstart;
50} dccpw; 50} dccpw;
51 51
52static void printl(const char *fmt, ...) 52static void printl(const char *fmt, ...)
53{ 53{
54 va_list args; 54 va_list args;
55 int len; 55 int len;
56 struct timeval now; 56 struct timespec now;
57 char tbuf[256]; 57 char tbuf[256];
58 58
59 va_start(args, fmt); 59 va_start(args, fmt);
60 do_gettimeofday(&now); 60 getnstimeofday(&now);
61 61
62 now.tv_sec -= dccpw.tstart.tv_sec; 62 now = timespec_sub(now, dccpw.tstart);
63 now.tv_usec -= dccpw.tstart.tv_usec;
64 if (now.tv_usec < 0) {
65 --now.tv_sec;
66 now.tv_usec += 1000000;
67 }
68 63
69 len = sprintf(tbuf, "%lu.%06lu ", 64 len = sprintf(tbuf, "%lu.%06lu ",
70 (unsigned long) now.tv_sec, 65 (unsigned long) now.tv_sec,
71 (unsigned long) now.tv_usec); 66 (unsigned long) now.tv_nsec / NSEC_PER_USEC);
72 len += vscnprintf(tbuf+len, sizeof(tbuf)-len, fmt, args); 67 len += vscnprintf(tbuf+len, sizeof(tbuf)-len, fmt, args);
73 va_end(args); 68 va_end(args);
74 69
@@ -119,7 +114,7 @@ static struct jprobe dccp_send_probe = {
119static int dccpprobe_open(struct inode *inode, struct file *file) 114static int dccpprobe_open(struct inode *inode, struct file *file)
120{ 115{
121 kfifo_reset(dccpw.fifo); 116 kfifo_reset(dccpw.fifo);
122 do_gettimeofday(&dccpw.tstart); 117 getnstimeofday(&dccpw.tstart);
123 return 0; 118 return 0;
124} 119}
125 120
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index f064031f2031..c67d00e8c600 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -847,7 +847,7 @@ static void icmp_echo(struct sk_buff *skb)
847 */ 847 */
848static void icmp_timestamp(struct sk_buff *skb) 848static void icmp_timestamp(struct sk_buff *skb)
849{ 849{
850 struct timeval tv; 850 struct timespec tv;
851 struct icmp_bxm icmp_param; 851 struct icmp_bxm icmp_param;
852 /* 852 /*
853 * Too short. 853 * Too short.
@@ -858,9 +858,9 @@ static void icmp_timestamp(struct sk_buff *skb)
858 /* 858 /*
859 * Fill in the current time as ms since midnight UT: 859 * Fill in the current time as ms since midnight UT:
860 */ 860 */
861 do_gettimeofday(&tv); 861 getnstimeofday(&tv);
862 icmp_param.data.times[1] = htonl((tv.tv_sec % 86400) * 1000 + 862 icmp_param.data.times[1] = htonl((tv.tv_sec % 86400) * MSEC_PER_SEC +
863 tv.tv_usec / 1000); 863 tv.tv_nsec / NSEC_PER_MSEC);
864 icmp_param.data.times[2] = icmp_param.data.times[1]; 864 icmp_param.data.times[2] = icmp_param.data.times[1];
865 if (skb_copy_bits(skb, 0, &icmp_param.data.times[0], 4)) 865 if (skb_copy_bits(skb, 0, &icmp_param.data.times[0], 4))
866 BUG(); 866 BUG();
@@ -1144,7 +1144,7 @@ static void __net_exit icmp_sk_exit(struct net *net)
1144 net->ipv4.icmp_sk = NULL; 1144 net->ipv4.icmp_sk = NULL;
1145} 1145}
1146 1146
1147int __net_init icmp_sk_init(struct net *net) 1147static int __net_init icmp_sk_init(struct net *net)
1148{ 1148{
1149 int i, err; 1149 int i, err;
1150 1150
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c
index d107543d3f81..33126ad2cfdc 100644
--- a/net/ipv4/ip_options.c
+++ b/net/ipv4/ip_options.c
@@ -55,10 +55,10 @@ void ip_options_build(struct sk_buff * skb, struct ip_options * opt,
55 if (opt->ts_needaddr) 55 if (opt->ts_needaddr)
56 ip_rt_get_source(iph+opt->ts+iph[opt->ts+2]-9, rt); 56 ip_rt_get_source(iph+opt->ts+iph[opt->ts+2]-9, rt);
57 if (opt->ts_needtime) { 57 if (opt->ts_needtime) {
58 struct timeval tv; 58 struct timespec tv;
59 __be32 midtime; 59 __be32 midtime;
60 do_gettimeofday(&tv); 60 getnstimeofday(&tv);
61 midtime = htonl((tv.tv_sec % 86400) * 1000 + tv.tv_usec / 1000); 61 midtime = htonl((tv.tv_sec % 86400) * MSEC_PER_SEC + tv.tv_nsec / NSEC_PER_MSEC);
62 memcpy(iph+opt->ts+iph[opt->ts+2]-5, &midtime, 4); 62 memcpy(iph+opt->ts+iph[opt->ts+2]-5, &midtime, 4);
63 } 63 }
64 return; 64 return;
@@ -406,10 +406,10 @@ int ip_options_compile(struct net *net,
406 break; 406 break;
407 } 407 }
408 if (timeptr) { 408 if (timeptr) {
409 struct timeval tv; 409 struct timespec tv;
410 __be32 midtime; 410 __be32 midtime;
411 do_gettimeofday(&tv); 411 getnstimeofday(&tv);
412 midtime = htonl((tv.tv_sec % 86400) * 1000 + tv.tv_usec / 1000); 412 midtime = htonl((tv.tv_sec % 86400) * MSEC_PER_SEC + tv.tv_nsec / NSEC_PER_MSEC);
413 memcpy(timeptr, &midtime, sizeof(__be32)); 413 memcpy(timeptr, &midtime, sizeof(__be32));
414 opt->is_changed = 1; 414 opt->is_changed = 1;
415 } 415 }
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 58ac838bf460..f88653138621 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1722,7 +1722,7 @@ static int tcp_close_state(struct sock *sk)
1722 1722
1723/* 1723/*
1724 * Shutdown the sending side of a connection. Much like close except 1724 * Shutdown the sending side of a connection. Much like close except
1725 * that we don't receive shut down or set_sock_flag(sk, SOCK_DEAD). 1725 * that we don't receive shut down or sock_set_flag(sk, SOCK_DEAD).
1726 */ 1726 */
1727 1727
1728void tcp_shutdown(struct sock *sk, int how) 1728void tcp_shutdown(struct sock *sk, int how)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index cdc051bfdb4d..ac9b8482f702 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2298,7 +2298,7 @@ static inline int tcp_packet_delayed(struct tcp_sock *tp)
2298{ 2298{
2299 return !tp->retrans_stamp || 2299 return !tp->retrans_stamp ||
2300 (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr && 2300 (tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr &&
2301 (__s32)(tp->rx_opt.rcv_tsecr - tp->retrans_stamp) < 0); 2301 before(tp->rx_opt.rcv_tsecr, tp->retrans_stamp));
2302} 2302}
2303 2303
2304/* Undo procedures. */ 2304/* Undo procedures. */
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 8a0fd4007bdb..e591e09e5e4e 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -4338,12 +4338,6 @@ int unregister_inet6addr_notifier(struct notifier_block *nb)
4338 4338
4339EXPORT_SYMBOL(unregister_inet6addr_notifier); 4339EXPORT_SYMBOL(unregister_inet6addr_notifier);
4340 4340
4341
4342static int addrconf_net_init(struct net *net)
4343{
4344 return 0;
4345}
4346
4347static void addrconf_net_exit(struct net *net) 4341static void addrconf_net_exit(struct net *net)
4348{ 4342{
4349 struct net_device *dev; 4343 struct net_device *dev;
@@ -4360,7 +4354,6 @@ static void addrconf_net_exit(struct net *net)
4360} 4354}
4361 4355
4362static struct pernet_operations addrconf_net_ops = { 4356static struct pernet_operations addrconf_net_ops = {
4363 .init = addrconf_net_init,
4364 .exit = addrconf_net_exit, 4357 .exit = addrconf_net_exit,
4365}; 4358};
4366 4359
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 50f3f8f8a59b..1ee4fa17c129 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -1543,7 +1543,7 @@ out_timer:
1543static void fib6_net_exit(struct net *net) 1543static void fib6_net_exit(struct net *net)
1544{ 1544{
1545 rt6_ifdown(net, NULL); 1545 rt6_ifdown(net, NULL);
1546 del_timer(net->ipv6.ip6_fib_timer); 1546 del_timer_sync(net->ipv6.ip6_fib_timer);
1547 kfree(net->ipv6.ip6_fib_timer); 1547 kfree(net->ipv6.ip6_fib_timer);
1548#ifdef CONFIG_IPV6_MULTIPLE_TABLES 1548#ifdef CONFIG_IPV6_MULTIPLE_TABLES
1549 kfree(net->ipv6.fib6_local_tbl); 1549 kfree(net->ipv6.fib6_local_tbl);
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 210a079cfc6f..a493ad9b8914 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -150,7 +150,7 @@ static struct rt6_info ip6_null_entry_template = {
150static int ip6_pkt_prohibit(struct sk_buff *skb); 150static int ip6_pkt_prohibit(struct sk_buff *skb);
151static int ip6_pkt_prohibit_out(struct sk_buff *skb); 151static int ip6_pkt_prohibit_out(struct sk_buff *skb);
152 152
153struct rt6_info ip6_prohibit_entry_template = { 153static struct rt6_info ip6_prohibit_entry_template = {
154 .u = { 154 .u = {
155 .dst = { 155 .dst = {
156 .__refcnt = ATOMIC_INIT(1), 156 .__refcnt = ATOMIC_INIT(1),
@@ -2614,9 +2614,8 @@ struct ctl_table *ipv6_route_sysctl_init(struct net *net)
2614 2614
2615static int ip6_route_net_init(struct net *net) 2615static int ip6_route_net_init(struct net *net)
2616{ 2616{
2617 int ret = 0; 2617 int ret = -ENOMEM;
2618 2618
2619 ret = -ENOMEM;
2620 net->ipv6.ip6_dst_ops = kmemdup(&ip6_dst_ops_template, 2619 net->ipv6.ip6_dst_ops = kmemdup(&ip6_dst_ops_template,
2621 sizeof(*net->ipv6.ip6_dst_ops), 2620 sizeof(*net->ipv6.ip6_dst_ops),
2622 GFP_KERNEL); 2621 GFP_KERNEL);
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 1fb0fe42a72e..81a8e5297ad1 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -1907,7 +1907,7 @@ parse_ipsecrequest(struct xfrm_policy *xp, struct sadb_x_ipsecrequest *rq)
1907 t->encap_family = xp->family; 1907 t->encap_family = xp->family;
1908 1908
1909 /* No way to set this via kame pfkey */ 1909 /* No way to set this via kame pfkey */
1910 t->aalgos = t->ealgos = t->calgos = ~0; 1910 t->allalgs = 1;
1911 xp->xfrm_nr++; 1911 xp->xfrm_nr++;
1912 return 0; 1912 return 0;
1913} 1913}
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index fb9359fb2358..5053a53ba24f 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -857,7 +857,6 @@ int rose_route_frame(struct sk_buff *skb, ax25_cb *ax25)
857 src_addr = (rose_address *)(skb->data + 9); 857 src_addr = (rose_address *)(skb->data + 9);
858 dest_addr = (rose_address *)(skb->data + 4); 858 dest_addr = (rose_address *)(skb->data + 4);
859 859
860 spin_lock_bh(&rose_node_list_lock);
861 spin_lock_bh(&rose_neigh_list_lock); 860 spin_lock_bh(&rose_neigh_list_lock);
862 spin_lock_bh(&rose_route_list_lock); 861 spin_lock_bh(&rose_route_list_lock);
863 862
@@ -1060,7 +1059,6 @@ int rose_route_frame(struct sk_buff *skb, ax25_cb *ax25)
1060out: 1059out:
1061 spin_unlock_bh(&rose_route_list_lock); 1060 spin_unlock_bh(&rose_route_list_lock);
1062 spin_unlock_bh(&rose_neigh_list_lock); 1061 spin_unlock_bh(&rose_neigh_list_lock);
1063 spin_unlock_bh(&rose_node_list_lock);
1064 1062
1065 return res; 1063 return res;
1066} 1064}
diff --git a/net/socket.c b/net/socket.c
index 9b5c917f8a6b..66c4a8cf6db9 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -2327,9 +2327,6 @@ int kernel_sock_shutdown(struct socket *sock, enum sock_shutdown_cmd how)
2327 return sock->ops->shutdown(sock, how); 2327 return sock->ops->shutdown(sock, how);
2328} 2328}
2329 2329
2330/* ABI emulation layers need these two */
2331EXPORT_SYMBOL(move_addr_to_kernel);
2332EXPORT_SYMBOL(move_addr_to_user);
2333EXPORT_SYMBOL(sock_create); 2330EXPORT_SYMBOL(sock_create);
2334EXPORT_SYMBOL(sock_create_kern); 2331EXPORT_SYMBOL(sock_create_kern);
2335EXPORT_SYMBOL(sock_create_lite); 2332EXPORT_SYMBOL(sock_create_lite);
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index ab4d0e598a2c..e0c0390613c0 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1819,7 +1819,7 @@ xfrm_state_ok(struct xfrm_tmpl *tmpl, struct xfrm_state *x,
1819 (x->id.spi == tmpl->id.spi || !tmpl->id.spi) && 1819 (x->id.spi == tmpl->id.spi || !tmpl->id.spi) &&
1820 (x->props.reqid == tmpl->reqid || !tmpl->reqid) && 1820 (x->props.reqid == tmpl->reqid || !tmpl->reqid) &&
1821 x->props.mode == tmpl->mode && 1821 x->props.mode == tmpl->mode &&
1822 ((tmpl->aalgos & (1<<x->props.aalgo)) || 1822 (tmpl->allalgs || (tmpl->aalgos & (1<<x->props.aalgo)) ||
1823 !(xfrm_id_proto_match(tmpl->id.proto, IPSEC_PROTO_ANY))) && 1823 !(xfrm_id_proto_match(tmpl->id.proto, IPSEC_PROTO_ANY))) &&
1824 !(x->props.mode != XFRM_MODE_TRANSPORT && 1824 !(x->props.mode != XFRM_MODE_TRANSPORT &&
1825 xfrm_state_addr_cmp(tmpl, x, family)); 1825 xfrm_state_addr_cmp(tmpl, x, family));
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 1810f5645bb5..22a30ae582a2 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -981,6 +981,8 @@ static void copy_templates(struct xfrm_policy *xp, struct xfrm_user_tmpl *ut,
981 t->aalgos = ut->aalgos; 981 t->aalgos = ut->aalgos;
982 t->ealgos = ut->ealgos; 982 t->ealgos = ut->ealgos;
983 t->calgos = ut->calgos; 983 t->calgos = ut->calgos;
984 /* If all masks are ~0, then we allow all algorithms. */
985 t->allalgs = !~(t->aalgos & t->ealgos & t->calgos);
984 t->encap_family = ut->family; 986 t->encap_family = ut->family;
985 } 987 }
986} 988}