diff options
author | David S. Miller <davem@davemloft.net> | 2008-09-08 19:59:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-08 19:59:05 -0400 |
commit | 17dce5dfe38ae2fb359b61e855f5d8a3a8b7892b (patch) | |
tree | 88bb1fcf84f9ebfa4299c9a8dcd9e6330b358446 /net | |
parent | 712d6954e3998d0de2840d8130941e8042541246 (diff) | |
parent | 82a28c794f27aac17d7a3ebd7f14d731a11a5532 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
net/mac80211/mlme.c
Diffstat (limited to 'net')
38 files changed, 263 insertions, 177 deletions
diff --git a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c index 3ec1c636e620..6a6433daaf27 100644 --- a/net/bridge/br_ioctl.c +++ b/net/bridge/br_ioctl.c | |||
@@ -188,15 +188,21 @@ static int old_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
188 | return 0; | 188 | return 0; |
189 | 189 | ||
190 | case BRCTL_SET_BRIDGE_HELLO_TIME: | 190 | case BRCTL_SET_BRIDGE_HELLO_TIME: |
191 | { | ||
192 | unsigned long t = clock_t_to_jiffies(args[1]); | ||
191 | if (!capable(CAP_NET_ADMIN)) | 193 | if (!capable(CAP_NET_ADMIN)) |
192 | return -EPERM; | 194 | return -EPERM; |
193 | 195 | ||
196 | if (t < HZ) | ||
197 | return -EINVAL; | ||
198 | |||
194 | spin_lock_bh(&br->lock); | 199 | spin_lock_bh(&br->lock); |
195 | br->bridge_hello_time = clock_t_to_jiffies(args[1]); | 200 | br->bridge_hello_time = t; |
196 | if (br_is_root_bridge(br)) | 201 | if (br_is_root_bridge(br)) |
197 | br->hello_time = br->bridge_hello_time; | 202 | br->hello_time = br->bridge_hello_time; |
198 | spin_unlock_bh(&br->lock); | 203 | spin_unlock_bh(&br->lock); |
199 | return 0; | 204 | return 0; |
205 | } | ||
200 | 206 | ||
201 | case BRCTL_SET_BRIDGE_MAX_AGE: | 207 | case BRCTL_SET_BRIDGE_MAX_AGE: |
202 | if (!capable(CAP_NET_ADMIN)) | 208 | if (!capable(CAP_NET_ADMIN)) |
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c index 27d6a511c8c1..158dee8b4965 100644 --- a/net/bridge/br_sysfs_br.c +++ b/net/bridge/br_sysfs_br.c | |||
@@ -29,11 +29,12 @@ | |||
29 | */ | 29 | */ |
30 | static ssize_t store_bridge_parm(struct device *d, | 30 | static ssize_t store_bridge_parm(struct device *d, |
31 | const char *buf, size_t len, | 31 | const char *buf, size_t len, |
32 | void (*set)(struct net_bridge *, unsigned long)) | 32 | int (*set)(struct net_bridge *, unsigned long)) |
33 | { | 33 | { |
34 | struct net_bridge *br = to_bridge(d); | 34 | struct net_bridge *br = to_bridge(d); |
35 | char *endp; | 35 | char *endp; |
36 | unsigned long val; | 36 | unsigned long val; |
37 | int err; | ||
37 | 38 | ||
38 | if (!capable(CAP_NET_ADMIN)) | 39 | if (!capable(CAP_NET_ADMIN)) |
39 | return -EPERM; | 40 | return -EPERM; |
@@ -43,9 +44,9 @@ static ssize_t store_bridge_parm(struct device *d, | |||
43 | return -EINVAL; | 44 | return -EINVAL; |
44 | 45 | ||
45 | spin_lock_bh(&br->lock); | 46 | spin_lock_bh(&br->lock); |
46 | (*set)(br, val); | 47 | err = (*set)(br, val); |
47 | spin_unlock_bh(&br->lock); | 48 | spin_unlock_bh(&br->lock); |
48 | return len; | 49 | return err ? err : len; |
49 | } | 50 | } |
50 | 51 | ||
51 | 52 | ||
@@ -56,12 +57,13 @@ static ssize_t show_forward_delay(struct device *d, | |||
56 | return sprintf(buf, "%lu\n", jiffies_to_clock_t(br->forward_delay)); | 57 | return sprintf(buf, "%lu\n", jiffies_to_clock_t(br->forward_delay)); |
57 | } | 58 | } |
58 | 59 | ||
59 | static void set_forward_delay(struct net_bridge *br, unsigned long val) | 60 | static int set_forward_delay(struct net_bridge *br, unsigned long val) |
60 | { | 61 | { |
61 | unsigned long delay = clock_t_to_jiffies(val); | 62 | unsigned long delay = clock_t_to_jiffies(val); |
62 | br->forward_delay = delay; | 63 | br->forward_delay = delay; |
63 | if (br_is_root_bridge(br)) | 64 | if (br_is_root_bridge(br)) |
64 | br->bridge_forward_delay = delay; | 65 | br->bridge_forward_delay = delay; |
66 | return 0; | ||
65 | } | 67 | } |
66 | 68 | ||
67 | static ssize_t store_forward_delay(struct device *d, | 69 | static ssize_t store_forward_delay(struct device *d, |
@@ -80,12 +82,17 @@ static ssize_t show_hello_time(struct device *d, struct device_attribute *attr, | |||
80 | jiffies_to_clock_t(to_bridge(d)->hello_time)); | 82 | jiffies_to_clock_t(to_bridge(d)->hello_time)); |
81 | } | 83 | } |
82 | 84 | ||
83 | static void set_hello_time(struct net_bridge *br, unsigned long val) | 85 | static int set_hello_time(struct net_bridge *br, unsigned long val) |
84 | { | 86 | { |
85 | unsigned long t = clock_t_to_jiffies(val); | 87 | unsigned long t = clock_t_to_jiffies(val); |
88 | |||
89 | if (t < HZ) | ||
90 | return -EINVAL; | ||
91 | |||
86 | br->hello_time = t; | 92 | br->hello_time = t; |
87 | if (br_is_root_bridge(br)) | 93 | if (br_is_root_bridge(br)) |
88 | br->bridge_hello_time = t; | 94 | br->bridge_hello_time = t; |
95 | return 0; | ||
89 | } | 96 | } |
90 | 97 | ||
91 | static ssize_t store_hello_time(struct device *d, | 98 | static ssize_t store_hello_time(struct device *d, |
@@ -104,12 +111,13 @@ static ssize_t show_max_age(struct device *d, struct device_attribute *attr, | |||
104 | jiffies_to_clock_t(to_bridge(d)->max_age)); | 111 | jiffies_to_clock_t(to_bridge(d)->max_age)); |
105 | } | 112 | } |
106 | 113 | ||
107 | static void set_max_age(struct net_bridge *br, unsigned long val) | 114 | static int set_max_age(struct net_bridge *br, unsigned long val) |
108 | { | 115 | { |
109 | unsigned long t = clock_t_to_jiffies(val); | 116 | unsigned long t = clock_t_to_jiffies(val); |
110 | br->max_age = t; | 117 | br->max_age = t; |
111 | if (br_is_root_bridge(br)) | 118 | if (br_is_root_bridge(br)) |
112 | br->bridge_max_age = t; | 119 | br->bridge_max_age = t; |
120 | return 0; | ||
113 | } | 121 | } |
114 | 122 | ||
115 | static ssize_t store_max_age(struct device *d, struct device_attribute *attr, | 123 | static ssize_t store_max_age(struct device *d, struct device_attribute *attr, |
@@ -126,9 +134,10 @@ static ssize_t show_ageing_time(struct device *d, | |||
126 | return sprintf(buf, "%lu\n", jiffies_to_clock_t(br->ageing_time)); | 134 | return sprintf(buf, "%lu\n", jiffies_to_clock_t(br->ageing_time)); |
127 | } | 135 | } |
128 | 136 | ||
129 | static void set_ageing_time(struct net_bridge *br, unsigned long val) | 137 | static int set_ageing_time(struct net_bridge *br, unsigned long val) |
130 | { | 138 | { |
131 | br->ageing_time = clock_t_to_jiffies(val); | 139 | br->ageing_time = clock_t_to_jiffies(val); |
140 | return 0; | ||
132 | } | 141 | } |
133 | 142 | ||
134 | static ssize_t store_ageing_time(struct device *d, | 143 | static ssize_t store_ageing_time(struct device *d, |
@@ -180,9 +189,10 @@ static ssize_t show_priority(struct device *d, struct device_attribute *attr, | |||
180 | (br->bridge_id.prio[0] << 8) | br->bridge_id.prio[1]); | 189 | (br->bridge_id.prio[0] << 8) | br->bridge_id.prio[1]); |
181 | } | 190 | } |
182 | 191 | ||
183 | static void set_priority(struct net_bridge *br, unsigned long val) | 192 | static int set_priority(struct net_bridge *br, unsigned long val) |
184 | { | 193 | { |
185 | br_stp_set_bridge_priority(br, (u16) val); | 194 | br_stp_set_bridge_priority(br, (u16) val); |
195 | return 0; | ||
186 | } | 196 | } |
187 | 197 | ||
188 | static ssize_t store_priority(struct device *d, struct device_attribute *attr, | 198 | static ssize_t store_priority(struct device *d, struct device_attribute *attr, |
diff --git a/net/core/dev.c b/net/core/dev.c index abef86ec4cb0..f48d1b24f9ce 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1991,8 +1991,13 @@ static void net_tx_action(struct softirq_action *h) | |||
1991 | spin_unlock(root_lock); | 1991 | spin_unlock(root_lock); |
1992 | } else { | 1992 | } else { |
1993 | if (!test_bit(__QDISC_STATE_DEACTIVATED, | 1993 | if (!test_bit(__QDISC_STATE_DEACTIVATED, |
1994 | &q->state)) | 1994 | &q->state)) { |
1995 | __netif_reschedule(q); | 1995 | __netif_reschedule(q); |
1996 | } else { | ||
1997 | smp_mb__before_clear_bit(); | ||
1998 | clear_bit(__QDISC_STATE_SCHED, | ||
1999 | &q->state); | ||
2000 | } | ||
1996 | } | 2001 | } |
1997 | } | 2002 | } |
1998 | } | 2003 | } |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 91d3d96805d0..b12dae2b0b2d 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -1029,6 +1029,11 @@ skip: | |||
1029 | } | 1029 | } |
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | static inline bool inetdev_valid_mtu(unsigned mtu) | ||
1033 | { | ||
1034 | return mtu >= 68; | ||
1035 | } | ||
1036 | |||
1032 | /* Called only under RTNL semaphore */ | 1037 | /* Called only under RTNL semaphore */ |
1033 | 1038 | ||
1034 | static int inetdev_event(struct notifier_block *this, unsigned long event, | 1039 | static int inetdev_event(struct notifier_block *this, unsigned long event, |
@@ -1048,6 +1053,10 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, | |||
1048 | IN_DEV_CONF_SET(in_dev, NOXFRM, 1); | 1053 | IN_DEV_CONF_SET(in_dev, NOXFRM, 1); |
1049 | IN_DEV_CONF_SET(in_dev, NOPOLICY, 1); | 1054 | IN_DEV_CONF_SET(in_dev, NOPOLICY, 1); |
1050 | } | 1055 | } |
1056 | } else if (event == NETDEV_CHANGEMTU) { | ||
1057 | /* Re-enabling IP */ | ||
1058 | if (inetdev_valid_mtu(dev->mtu)) | ||
1059 | in_dev = inetdev_init(dev); | ||
1051 | } | 1060 | } |
1052 | goto out; | 1061 | goto out; |
1053 | } | 1062 | } |
@@ -1058,7 +1067,7 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, | |||
1058 | dev->ip_ptr = NULL; | 1067 | dev->ip_ptr = NULL; |
1059 | break; | 1068 | break; |
1060 | case NETDEV_UP: | 1069 | case NETDEV_UP: |
1061 | if (dev->mtu < 68) | 1070 | if (!inetdev_valid_mtu(dev->mtu)) |
1062 | break; | 1071 | break; |
1063 | if (dev->flags & IFF_LOOPBACK) { | 1072 | if (dev->flags & IFF_LOOPBACK) { |
1064 | struct in_ifaddr *ifa; | 1073 | struct in_ifaddr *ifa; |
@@ -1080,9 +1089,9 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, | |||
1080 | ip_mc_down(in_dev); | 1089 | ip_mc_down(in_dev); |
1081 | break; | 1090 | break; |
1082 | case NETDEV_CHANGEMTU: | 1091 | case NETDEV_CHANGEMTU: |
1083 | if (dev->mtu >= 68) | 1092 | if (inetdev_valid_mtu(dev->mtu)) |
1084 | break; | 1093 | break; |
1085 | /* MTU falled under 68, disable IP */ | 1094 | /* disable IP when MTU is not enough */ |
1086 | case NETDEV_UNREGISTER: | 1095 | case NETDEV_UNREGISTER: |
1087 | inetdev_destroy(in_dev); | 1096 | inetdev_destroy(in_dev); |
1088 | break; | 1097 | break; |
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c index d985bd613d25..743f011b9a84 100644 --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c | |||
@@ -409,3 +409,38 @@ out: | |||
409 | } | 409 | } |
410 | 410 | ||
411 | EXPORT_SYMBOL_GPL(inet_twdr_twcal_tick); | 411 | EXPORT_SYMBOL_GPL(inet_twdr_twcal_tick); |
412 | |||
413 | void inet_twsk_purge(struct net *net, struct inet_hashinfo *hashinfo, | ||
414 | struct inet_timewait_death_row *twdr, int family) | ||
415 | { | ||
416 | struct inet_timewait_sock *tw; | ||
417 | struct sock *sk; | ||
418 | struct hlist_node *node; | ||
419 | int h; | ||
420 | |||
421 | local_bh_disable(); | ||
422 | for (h = 0; h < (hashinfo->ehash_size); h++) { | ||
423 | struct inet_ehash_bucket *head = | ||
424 | inet_ehash_bucket(hashinfo, h); | ||
425 | rwlock_t *lock = inet_ehash_lockp(hashinfo, h); | ||
426 | restart: | ||
427 | write_lock(lock); | ||
428 | sk_for_each(sk, node, &head->twchain) { | ||
429 | |||
430 | tw = inet_twsk(sk); | ||
431 | if (!net_eq(twsk_net(tw), net) || | ||
432 | tw->tw_family != family) | ||
433 | continue; | ||
434 | |||
435 | atomic_inc(&tw->tw_refcnt); | ||
436 | write_unlock(lock); | ||
437 | inet_twsk_deschedule(tw, twdr); | ||
438 | inet_twsk_put(tw); | ||
439 | |||
440 | goto restart; | ||
441 | } | ||
442 | write_unlock(lock); | ||
443 | } | ||
444 | local_bh_enable(); | ||
445 | } | ||
446 | EXPORT_SYMBOL_GPL(inet_twsk_purge); | ||
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 37ca3843c40b..3dfbc21e555a 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -2388,6 +2388,7 @@ static int __net_init tcp_sk_init(struct net *net) | |||
2388 | static void __net_exit tcp_sk_exit(struct net *net) | 2388 | static void __net_exit tcp_sk_exit(struct net *net) |
2389 | { | 2389 | { |
2390 | inet_ctl_sock_destroy(net->ipv4.tcp_sock); | 2390 | inet_ctl_sock_destroy(net->ipv4.tcp_sock); |
2391 | inet_twsk_purge(net, &tcp_hashinfo, &tcp_death_row, AF_INET); | ||
2391 | } | 2392 | } |
2392 | 2393 | ||
2393 | static struct pernet_operations __net_initdata tcp_sk_ops = { | 2394 | static struct pernet_operations __net_initdata tcp_sk_ops = { |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 5b90b369ccb2..b585c850a89a 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -2148,6 +2148,7 @@ static int tcpv6_net_init(struct net *net) | |||
2148 | static void tcpv6_net_exit(struct net *net) | 2148 | static void tcpv6_net_exit(struct net *net) |
2149 | { | 2149 | { |
2150 | inet_ctl_sock_destroy(net->ipv6.tcp_sk); | 2150 | inet_ctl_sock_destroy(net->ipv6.tcp_sk); |
2151 | inet_twsk_purge(net, &tcp_hashinfo, &tcp_death_row, AF_INET6); | ||
2151 | } | 2152 | } |
2152 | 2153 | ||
2153 | static struct pernet_operations tcpv6_net_ops = { | 2154 | static struct pernet_operations tcpv6_net_ops = { |
diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c index 7439b63df5d0..cf82acec913a 100644 --- a/net/mac80211/debugfs_key.c +++ b/net/mac80211/debugfs_key.c | |||
@@ -265,7 +265,7 @@ void ieee80211_debugfs_key_add_default(struct ieee80211_sub_if_data *sdata) | |||
265 | key = sdata->default_key; | 265 | key = sdata->default_key; |
266 | if (key) { | 266 | if (key) { |
267 | sprintf(buf, "../keys/%d", key->debugfs.cnt); | 267 | sprintf(buf, "../keys/%d", key->debugfs.cnt); |
268 | sdata->debugfs.default_key = | 268 | sdata->common_debugfs.default_key = |
269 | debugfs_create_symlink("default_key", | 269 | debugfs_create_symlink("default_key", |
270 | sdata->debugfsdir, buf); | 270 | sdata->debugfsdir, buf); |
271 | } else | 271 | } else |
@@ -277,8 +277,8 @@ void ieee80211_debugfs_key_remove_default(struct ieee80211_sub_if_data *sdata) | |||
277 | if (!sdata) | 277 | if (!sdata) |
278 | return; | 278 | return; |
279 | 279 | ||
280 | debugfs_remove(sdata->debugfs.default_key); | 280 | debugfs_remove(sdata->common_debugfs.default_key); |
281 | sdata->debugfs.default_key = NULL; | 281 | sdata->common_debugfs.default_key = NULL; |
282 | } | 282 | } |
283 | 283 | ||
284 | void ieee80211_debugfs_key_sta_del(struct ieee80211_key *key, | 284 | void ieee80211_debugfs_key_sta_del(struct ieee80211_key *key, |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 570ae83c71b1..c68d4df11196 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -498,8 +498,10 @@ struct ieee80211_sub_if_data { | |||
498 | struct { | 498 | struct { |
499 | struct dentry *mode; | 499 | struct dentry *mode; |
500 | } monitor; | 500 | } monitor; |
501 | struct dentry *default_key; | ||
502 | } debugfs; | 501 | } debugfs; |
502 | struct { | ||
503 | struct dentry *default_key; | ||
504 | } common_debugfs; | ||
503 | 505 | ||
504 | #ifdef CONFIG_MAC80211_MESH | 506 | #ifdef CONFIG_MAC80211_MESH |
505 | struct dentry *mesh_stats_dir; | 507 | struct dentry *mesh_stats_dir; |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index c396c3522f7b..df12e746b03e 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -508,7 +508,6 @@ static void ieee80211_sta_send_associnfo(struct ieee80211_sub_if_data *sdata, | |||
508 | wireless_send_event(sdata->dev, IWEVASSOCREQIE, &wrqu, | 508 | wireless_send_event(sdata->dev, IWEVASSOCREQIE, &wrqu, |
509 | ifsta->assocreq_ies); | 509 | ifsta->assocreq_ies); |
510 | } | 510 | } |
511 | |||
512 | if (ifsta->assocresp_ies) { | 511 | if (ifsta->assocresp_ies) { |
513 | memset(&wrqu, 0, sizeof(wrqu)); | 512 | memset(&wrqu, 0, sizeof(wrqu)); |
514 | wrqu.data.length = ifsta->assocresp_ies_len; | 513 | wrqu.data.length = ifsta->assocresp_ies_len; |
diff --git a/net/netfilter/nf_conntrack_irc.c b/net/netfilter/nf_conntrack_irc.c index 1b1226d6653f..20633fdf7e6b 100644 --- a/net/netfilter/nf_conntrack_irc.c +++ b/net/netfilter/nf_conntrack_irc.c | |||
@@ -68,11 +68,21 @@ static const char *const dccprotos[] = { | |||
68 | static int parse_dcc(char *data, const char *data_end, u_int32_t *ip, | 68 | static int parse_dcc(char *data, const char *data_end, u_int32_t *ip, |
69 | u_int16_t *port, char **ad_beg_p, char **ad_end_p) | 69 | u_int16_t *port, char **ad_beg_p, char **ad_end_p) |
70 | { | 70 | { |
71 | char *tmp; | ||
72 | |||
71 | /* at least 12: "AAAAAAAA P\1\n" */ | 73 | /* at least 12: "AAAAAAAA P\1\n" */ |
72 | while (*data++ != ' ') | 74 | while (*data++ != ' ') |
73 | if (data > data_end - 12) | 75 | if (data > data_end - 12) |
74 | return -1; | 76 | return -1; |
75 | 77 | ||
78 | /* Make sure we have a newline character within the packet boundaries | ||
79 | * because simple_strtoul parses until the first invalid character. */ | ||
80 | for (tmp = data; tmp <= data_end; tmp++) | ||
81 | if (*tmp == '\n') | ||
82 | break; | ||
83 | if (tmp > data_end || *tmp != '\n') | ||
84 | return -1; | ||
85 | |||
76 | *ad_beg_p = data; | 86 | *ad_beg_p = data; |
77 | *ip = simple_strtoul(data, &data, 10); | 87 | *ip = simple_strtoul(data, &data, 10); |
78 | 88 | ||
diff --git a/net/netfilter/nf_conntrack_proto_gre.c b/net/netfilter/nf_conntrack_proto_gre.c index 654a4f7f12c6..9bd03967fea4 100644 --- a/net/netfilter/nf_conntrack_proto_gre.c +++ b/net/netfilter/nf_conntrack_proto_gre.c | |||
@@ -45,12 +45,12 @@ static LIST_HEAD(gre_keymap_list); | |||
45 | 45 | ||
46 | void nf_ct_gre_keymap_flush(void) | 46 | void nf_ct_gre_keymap_flush(void) |
47 | { | 47 | { |
48 | struct list_head *pos, *n; | 48 | struct nf_ct_gre_keymap *km, *tmp; |
49 | 49 | ||
50 | write_lock_bh(&nf_ct_gre_lock); | 50 | write_lock_bh(&nf_ct_gre_lock); |
51 | list_for_each_safe(pos, n, &gre_keymap_list) { | 51 | list_for_each_entry_safe(km, tmp, &gre_keymap_list, list) { |
52 | list_del(pos); | 52 | list_del(&km->list); |
53 | kfree(pos); | 53 | kfree(km); |
54 | } | 54 | } |
55 | write_unlock_bh(&nf_ct_gre_lock); | 55 | write_unlock_bh(&nf_ct_gre_lock); |
56 | } | 56 | } |
@@ -97,10 +97,14 @@ int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir, | |||
97 | kmp = &help->help.ct_pptp_info.keymap[dir]; | 97 | kmp = &help->help.ct_pptp_info.keymap[dir]; |
98 | if (*kmp) { | 98 | if (*kmp) { |
99 | /* check whether it's a retransmission */ | 99 | /* check whether it's a retransmission */ |
100 | read_lock_bh(&nf_ct_gre_lock); | ||
100 | list_for_each_entry(km, &gre_keymap_list, list) { | 101 | list_for_each_entry(km, &gre_keymap_list, list) { |
101 | if (gre_key_cmpfn(km, t) && km == *kmp) | 102 | if (gre_key_cmpfn(km, t) && km == *kmp) { |
103 | read_unlock_bh(&nf_ct_gre_lock); | ||
102 | return 0; | 104 | return 0; |
105 | } | ||
103 | } | 106 | } |
107 | read_unlock_bh(&nf_ct_gre_lock); | ||
104 | pr_debug("trying to override keymap_%s for ct %p\n", | 108 | pr_debug("trying to override keymap_%s for ct %p\n", |
105 | dir == IP_CT_DIR_REPLY ? "reply" : "orig", ct); | 109 | dir == IP_CT_DIR_REPLY ? "reply" : "orig", ct); |
106 | return -EEXIST; | 110 | return -EEXIST; |
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c index 2f9bbc058b48..1fa306be60fb 100644 --- a/net/netfilter/nf_conntrack_sip.c +++ b/net/netfilter/nf_conntrack_sip.c | |||
@@ -1193,7 +1193,6 @@ static const struct sip_handler sip_handlers[] = { | |||
1193 | static int process_sip_response(struct sk_buff *skb, | 1193 | static int process_sip_response(struct sk_buff *skb, |
1194 | const char **dptr, unsigned int *datalen) | 1194 | const char **dptr, unsigned int *datalen) |
1195 | { | 1195 | { |
1196 | static const struct sip_handler *handler; | ||
1197 | enum ip_conntrack_info ctinfo; | 1196 | enum ip_conntrack_info ctinfo; |
1198 | struct nf_conn *ct = nf_ct_get(skb, &ctinfo); | 1197 | struct nf_conn *ct = nf_ct_get(skb, &ctinfo); |
1199 | unsigned int matchoff, matchlen; | 1198 | unsigned int matchoff, matchlen; |
@@ -1214,6 +1213,8 @@ static int process_sip_response(struct sk_buff *skb, | |||
1214 | dataoff = matchoff + matchlen + 1; | 1213 | dataoff = matchoff + matchlen + 1; |
1215 | 1214 | ||
1216 | for (i = 0; i < ARRAY_SIZE(sip_handlers); i++) { | 1215 | for (i = 0; i < ARRAY_SIZE(sip_handlers); i++) { |
1216 | const struct sip_handler *handler; | ||
1217 | |||
1217 | handler = &sip_handlers[i]; | 1218 | handler = &sip_handlers[i]; |
1218 | if (handler->response == NULL) | 1219 | if (handler->response == NULL) |
1219 | continue; | 1220 | continue; |
@@ -1228,13 +1229,14 @@ static int process_sip_response(struct sk_buff *skb, | |||
1228 | static int process_sip_request(struct sk_buff *skb, | 1229 | static int process_sip_request(struct sk_buff *skb, |
1229 | const char **dptr, unsigned int *datalen) | 1230 | const char **dptr, unsigned int *datalen) |
1230 | { | 1231 | { |
1231 | static const struct sip_handler *handler; | ||
1232 | enum ip_conntrack_info ctinfo; | 1232 | enum ip_conntrack_info ctinfo; |
1233 | struct nf_conn *ct = nf_ct_get(skb, &ctinfo); | 1233 | struct nf_conn *ct = nf_ct_get(skb, &ctinfo); |
1234 | unsigned int matchoff, matchlen; | 1234 | unsigned int matchoff, matchlen; |
1235 | unsigned int cseq, i; | 1235 | unsigned int cseq, i; |
1236 | 1236 | ||
1237 | for (i = 0; i < ARRAY_SIZE(sip_handlers); i++) { | 1237 | for (i = 0; i < ARRAY_SIZE(sip_handlers); i++) { |
1238 | const struct sip_handler *handler; | ||
1239 | |||
1238 | handler = &sip_handlers[i]; | 1240 | handler = &sip_handlers[i]; |
1239 | if (handler->request == NULL) | 1241 | if (handler->request == NULL) |
1240 | continue; | 1242 | continue; |
diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c index 0f8c439b848a..5231f7aaac0e 100644 --- a/net/sunrpc/sysctl.c +++ b/net/sunrpc/sysctl.c | |||
@@ -60,24 +60,14 @@ static int proc_do_xprt(ctl_table *table, int write, struct file *file, | |||
60 | void __user *buffer, size_t *lenp, loff_t *ppos) | 60 | void __user *buffer, size_t *lenp, loff_t *ppos) |
61 | { | 61 | { |
62 | char tmpbuf[256]; | 62 | char tmpbuf[256]; |
63 | int len; | 63 | size_t len; |
64 | |||
64 | if ((*ppos && !write) || !*lenp) { | 65 | if ((*ppos && !write) || !*lenp) { |
65 | *lenp = 0; | 66 | *lenp = 0; |
66 | return 0; | 67 | return 0; |
67 | } | 68 | } |
68 | if (write) | 69 | len = svc_print_xprts(tmpbuf, sizeof(tmpbuf)); |
69 | return -EINVAL; | 70 | return simple_read_from_buffer(buffer, *lenp, ppos, tmpbuf, len); |
70 | else { | ||
71 | len = svc_print_xprts(tmpbuf, sizeof(tmpbuf)); | ||
72 | if (!access_ok(VERIFY_WRITE, buffer, len)) | ||
73 | return -EFAULT; | ||
74 | |||
75 | if (__copy_to_user(buffer, tmpbuf, len)) | ||
76 | return -EFAULT; | ||
77 | } | ||
78 | *lenp -= len; | ||
79 | *ppos += len; | ||
80 | return 0; | ||
81 | } | 71 | } |
82 | 72 | ||
83 | static int | 73 | static int |
diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c index b4b17f44cb29..74de31a06616 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | |||
@@ -443,18 +443,18 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp) | |||
443 | 443 | ||
444 | dprintk("svcrdma: rqstp=%p\n", rqstp); | 444 | dprintk("svcrdma: rqstp=%p\n", rqstp); |
445 | 445 | ||
446 | spin_lock_bh(&rdma_xprt->sc_read_complete_lock); | 446 | spin_lock_bh(&rdma_xprt->sc_rq_dto_lock); |
447 | if (!list_empty(&rdma_xprt->sc_read_complete_q)) { | 447 | if (!list_empty(&rdma_xprt->sc_read_complete_q)) { |
448 | ctxt = list_entry(rdma_xprt->sc_read_complete_q.next, | 448 | ctxt = list_entry(rdma_xprt->sc_read_complete_q.next, |
449 | struct svc_rdma_op_ctxt, | 449 | struct svc_rdma_op_ctxt, |
450 | dto_q); | 450 | dto_q); |
451 | list_del_init(&ctxt->dto_q); | 451 | list_del_init(&ctxt->dto_q); |
452 | } | 452 | } |
453 | spin_unlock_bh(&rdma_xprt->sc_read_complete_lock); | 453 | if (ctxt) { |
454 | if (ctxt) | 454 | spin_unlock_bh(&rdma_xprt->sc_rq_dto_lock); |
455 | return rdma_read_complete(rqstp, ctxt); | 455 | return rdma_read_complete(rqstp, ctxt); |
456 | } | ||
456 | 457 | ||
457 | spin_lock_bh(&rdma_xprt->sc_rq_dto_lock); | ||
458 | if (!list_empty(&rdma_xprt->sc_rq_dto_q)) { | 458 | if (!list_empty(&rdma_xprt->sc_rq_dto_q)) { |
459 | ctxt = list_entry(rdma_xprt->sc_rq_dto_q.next, | 459 | ctxt = list_entry(rdma_xprt->sc_rq_dto_q.next, |
460 | struct svc_rdma_op_ctxt, | 460 | struct svc_rdma_op_ctxt, |
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index 19ddc382b777..900cb69728c6 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c | |||
@@ -359,11 +359,11 @@ static void sq_cq_reap(struct svcxprt_rdma *xprt) | |||
359 | if (test_bit(RDMACTXT_F_LAST_CTXT, &ctxt->flags)) { | 359 | if (test_bit(RDMACTXT_F_LAST_CTXT, &ctxt->flags)) { |
360 | struct svc_rdma_op_ctxt *read_hdr = ctxt->read_hdr; | 360 | struct svc_rdma_op_ctxt *read_hdr = ctxt->read_hdr; |
361 | BUG_ON(!read_hdr); | 361 | BUG_ON(!read_hdr); |
362 | spin_lock_bh(&xprt->sc_rq_dto_lock); | ||
362 | set_bit(XPT_DATA, &xprt->sc_xprt.xpt_flags); | 363 | set_bit(XPT_DATA, &xprt->sc_xprt.xpt_flags); |
363 | spin_lock_bh(&xprt->sc_read_complete_lock); | ||
364 | list_add_tail(&read_hdr->dto_q, | 364 | list_add_tail(&read_hdr->dto_q, |
365 | &xprt->sc_read_complete_q); | 365 | &xprt->sc_read_complete_q); |
366 | spin_unlock_bh(&xprt->sc_read_complete_lock); | 366 | spin_unlock_bh(&xprt->sc_rq_dto_lock); |
367 | svc_xprt_enqueue(&xprt->sc_xprt); | 367 | svc_xprt_enqueue(&xprt->sc_xprt); |
368 | } | 368 | } |
369 | svc_rdma_put_context(ctxt, 0); | 369 | svc_rdma_put_context(ctxt, 0); |
@@ -428,7 +428,6 @@ static struct svcxprt_rdma *rdma_create_xprt(struct svc_serv *serv, | |||
428 | init_waitqueue_head(&cma_xprt->sc_send_wait); | 428 | init_waitqueue_head(&cma_xprt->sc_send_wait); |
429 | 429 | ||
430 | spin_lock_init(&cma_xprt->sc_lock); | 430 | spin_lock_init(&cma_xprt->sc_lock); |
431 | spin_lock_init(&cma_xprt->sc_read_complete_lock); | ||
432 | spin_lock_init(&cma_xprt->sc_rq_dto_lock); | 431 | spin_lock_init(&cma_xprt->sc_rq_dto_lock); |
433 | 432 | ||
434 | cma_xprt->sc_ord = svcrdma_ord; | 433 | cma_xprt->sc_ord = svcrdma_ord; |
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index b1ff16aa4bdb..3ddaff42d1bb 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c | |||
@@ -96,8 +96,8 @@ struct bcbearer { | |||
96 | struct media media; | 96 | struct media media; |
97 | struct bcbearer_pair bpairs[MAX_BEARERS]; | 97 | struct bcbearer_pair bpairs[MAX_BEARERS]; |
98 | struct bcbearer_pair bpairs_temp[TIPC_MAX_LINK_PRI + 1]; | 98 | struct bcbearer_pair bpairs_temp[TIPC_MAX_LINK_PRI + 1]; |
99 | struct node_map remains; | 99 | struct tipc_node_map remains; |
100 | struct node_map remains_new; | 100 | struct tipc_node_map remains_new; |
101 | }; | 101 | }; |
102 | 102 | ||
103 | /** | 103 | /** |
@@ -110,7 +110,7 @@ struct bcbearer { | |||
110 | 110 | ||
111 | struct bclink { | 111 | struct bclink { |
112 | struct link link; | 112 | struct link link; |
113 | struct node node; | 113 | struct tipc_node node; |
114 | }; | 114 | }; |
115 | 115 | ||
116 | 116 | ||
@@ -149,7 +149,7 @@ static void bcbuf_decr_acks(struct sk_buff *buf) | |||
149 | * Called with 'node' locked, bc_lock unlocked | 149 | * Called with 'node' locked, bc_lock unlocked |
150 | */ | 150 | */ |
151 | 151 | ||
152 | static void bclink_set_gap(struct node *n_ptr) | 152 | static void bclink_set_gap(struct tipc_node *n_ptr) |
153 | { | 153 | { |
154 | struct sk_buff *buf = n_ptr->bclink.deferred_head; | 154 | struct sk_buff *buf = n_ptr->bclink.deferred_head; |
155 | 155 | ||
@@ -202,7 +202,7 @@ static void bclink_retransmit_pkt(u32 after, u32 to) | |||
202 | * Node is locked, bc_lock unlocked. | 202 | * Node is locked, bc_lock unlocked. |
203 | */ | 203 | */ |
204 | 204 | ||
205 | void tipc_bclink_acknowledge(struct node *n_ptr, u32 acked) | 205 | void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked) |
206 | { | 206 | { |
207 | struct sk_buff *crs; | 207 | struct sk_buff *crs; |
208 | struct sk_buff *next; | 208 | struct sk_buff *next; |
@@ -250,7 +250,7 @@ void tipc_bclink_acknowledge(struct node *n_ptr, u32 acked) | |||
250 | * tipc_net_lock and node lock set | 250 | * tipc_net_lock and node lock set |
251 | */ | 251 | */ |
252 | 252 | ||
253 | static void bclink_send_ack(struct node *n_ptr) | 253 | static void bclink_send_ack(struct tipc_node *n_ptr) |
254 | { | 254 | { |
255 | struct link *l_ptr = n_ptr->active_links[n_ptr->addr & 1]; | 255 | struct link *l_ptr = n_ptr->active_links[n_ptr->addr & 1]; |
256 | 256 | ||
@@ -264,7 +264,7 @@ static void bclink_send_ack(struct node *n_ptr) | |||
264 | * tipc_net_lock and node lock set | 264 | * tipc_net_lock and node lock set |
265 | */ | 265 | */ |
266 | 266 | ||
267 | static void bclink_send_nack(struct node *n_ptr) | 267 | static void bclink_send_nack(struct tipc_node *n_ptr) |
268 | { | 268 | { |
269 | struct sk_buff *buf; | 269 | struct sk_buff *buf; |
270 | struct tipc_msg *msg; | 270 | struct tipc_msg *msg; |
@@ -308,7 +308,7 @@ static void bclink_send_nack(struct node *n_ptr) | |||
308 | * tipc_net_lock and node lock set | 308 | * tipc_net_lock and node lock set |
309 | */ | 309 | */ |
310 | 310 | ||
311 | void tipc_bclink_check_gap(struct node *n_ptr, u32 last_sent) | 311 | void tipc_bclink_check_gap(struct tipc_node *n_ptr, u32 last_sent) |
312 | { | 312 | { |
313 | if (!n_ptr->bclink.supported || | 313 | if (!n_ptr->bclink.supported || |
314 | less_eq(last_sent, mod(n_ptr->bclink.last_in))) | 314 | less_eq(last_sent, mod(n_ptr->bclink.last_in))) |
@@ -328,7 +328,7 @@ void tipc_bclink_check_gap(struct node *n_ptr, u32 last_sent) | |||
328 | 328 | ||
329 | static void tipc_bclink_peek_nack(u32 dest, u32 sender_tag, u32 gap_after, u32 gap_to) | 329 | static void tipc_bclink_peek_nack(u32 dest, u32 sender_tag, u32 gap_after, u32 gap_to) |
330 | { | 330 | { |
331 | struct node *n_ptr = tipc_node_find(dest); | 331 | struct tipc_node *n_ptr = tipc_node_find(dest); |
332 | u32 my_after, my_to; | 332 | u32 my_after, my_to; |
333 | 333 | ||
334 | if (unlikely(!n_ptr || !tipc_node_is_up(n_ptr))) | 334 | if (unlikely(!n_ptr || !tipc_node_is_up(n_ptr))) |
@@ -418,7 +418,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf) | |||
418 | static int rx_count = 0; | 418 | static int rx_count = 0; |
419 | #endif | 419 | #endif |
420 | struct tipc_msg *msg = buf_msg(buf); | 420 | struct tipc_msg *msg = buf_msg(buf); |
421 | struct node* node = tipc_node_find(msg_prevnode(msg)); | 421 | struct tipc_node* node = tipc_node_find(msg_prevnode(msg)); |
422 | u32 next_in; | 422 | u32 next_in; |
423 | u32 seqno; | 423 | u32 seqno; |
424 | struct sk_buff *deferred; | 424 | struct sk_buff *deferred; |
@@ -538,7 +538,7 @@ u32 tipc_bclink_get_last_sent(void) | |||
538 | return last_sent; | 538 | return last_sent; |
539 | } | 539 | } |
540 | 540 | ||
541 | u32 tipc_bclink_acks_missing(struct node *n_ptr) | 541 | u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr) |
542 | { | 542 | { |
543 | return (n_ptr->bclink.supported && | 543 | return (n_ptr->bclink.supported && |
544 | (tipc_bclink_get_last_sent() != n_ptr->bclink.acked)); | 544 | (tipc_bclink_get_last_sent() != n_ptr->bclink.acked)); |
diff --git a/net/tipc/bcast.h b/net/tipc/bcast.h index a2416fa6b906..5aa024b99c55 100644 --- a/net/tipc/bcast.h +++ b/net/tipc/bcast.h | |||
@@ -41,12 +41,12 @@ | |||
41 | #define WSIZE 32 | 41 | #define WSIZE 32 |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * struct node_map - set of node identifiers | 44 | * struct tipc_node_map - set of node identifiers |
45 | * @count: # of nodes in set | 45 | * @count: # of nodes in set |
46 | * @map: bitmap of node identifiers that are in the set | 46 | * @map: bitmap of node identifiers that are in the set |
47 | */ | 47 | */ |
48 | 48 | ||
49 | struct node_map { | 49 | struct tipc_node_map { |
50 | u32 count; | 50 | u32 count; |
51 | u32 map[MAX_NODES / WSIZE]; | 51 | u32 map[MAX_NODES / WSIZE]; |
52 | }; | 52 | }; |
@@ -68,7 +68,7 @@ struct port_list { | |||
68 | }; | 68 | }; |
69 | 69 | ||
70 | 70 | ||
71 | struct node; | 71 | struct tipc_node; |
72 | 72 | ||
73 | extern char tipc_bclink_name[]; | 73 | extern char tipc_bclink_name[]; |
74 | 74 | ||
@@ -77,7 +77,7 @@ extern char tipc_bclink_name[]; | |||
77 | * nmap_add - add a node to a node map | 77 | * nmap_add - add a node to a node map |
78 | */ | 78 | */ |
79 | 79 | ||
80 | static inline void tipc_nmap_add(struct node_map *nm_ptr, u32 node) | 80 | static inline void tipc_nmap_add(struct tipc_node_map *nm_ptr, u32 node) |
81 | { | 81 | { |
82 | int n = tipc_node(node); | 82 | int n = tipc_node(node); |
83 | int w = n / WSIZE; | 83 | int w = n / WSIZE; |
@@ -93,7 +93,7 @@ static inline void tipc_nmap_add(struct node_map *nm_ptr, u32 node) | |||
93 | * nmap_remove - remove a node from a node map | 93 | * nmap_remove - remove a node from a node map |
94 | */ | 94 | */ |
95 | 95 | ||
96 | static inline void tipc_nmap_remove(struct node_map *nm_ptr, u32 node) | 96 | static inline void tipc_nmap_remove(struct tipc_node_map *nm_ptr, u32 node) |
97 | { | 97 | { |
98 | int n = tipc_node(node); | 98 | int n = tipc_node(node); |
99 | int w = n / WSIZE; | 99 | int w = n / WSIZE; |
@@ -109,7 +109,7 @@ static inline void tipc_nmap_remove(struct node_map *nm_ptr, u32 node) | |||
109 | * nmap_equal - test for equality of node maps | 109 | * nmap_equal - test for equality of node maps |
110 | */ | 110 | */ |
111 | 111 | ||
112 | static inline int tipc_nmap_equal(struct node_map *nm_a, struct node_map *nm_b) | 112 | static inline int tipc_nmap_equal(struct tipc_node_map *nm_a, struct tipc_node_map *nm_b) |
113 | { | 113 | { |
114 | return !memcmp(nm_a, nm_b, sizeof(*nm_a)); | 114 | return !memcmp(nm_a, nm_b, sizeof(*nm_a)); |
115 | } | 115 | } |
@@ -121,8 +121,8 @@ static inline int tipc_nmap_equal(struct node_map *nm_a, struct node_map *nm_b) | |||
121 | * @nm_diff: output node map A-B (i.e. nodes of A that are not in B) | 121 | * @nm_diff: output node map A-B (i.e. nodes of A that are not in B) |
122 | */ | 122 | */ |
123 | 123 | ||
124 | static inline void tipc_nmap_diff(struct node_map *nm_a, struct node_map *nm_b, | 124 | static inline void tipc_nmap_diff(struct tipc_node_map *nm_a, struct tipc_node_map *nm_b, |
125 | struct node_map *nm_diff) | 125 | struct tipc_node_map *nm_diff) |
126 | { | 126 | { |
127 | int stop = sizeof(nm_a->map) / sizeof(u32); | 127 | int stop = sizeof(nm_a->map) / sizeof(u32); |
128 | int w; | 128 | int w; |
@@ -195,12 +195,12 @@ static inline void tipc_port_list_free(struct port_list *pl_ptr) | |||
195 | 195 | ||
196 | int tipc_bclink_init(void); | 196 | int tipc_bclink_init(void); |
197 | void tipc_bclink_stop(void); | 197 | void tipc_bclink_stop(void); |
198 | void tipc_bclink_acknowledge(struct node *n_ptr, u32 acked); | 198 | void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked); |
199 | int tipc_bclink_send_msg(struct sk_buff *buf); | 199 | int tipc_bclink_send_msg(struct sk_buff *buf); |
200 | void tipc_bclink_recv_pkt(struct sk_buff *buf); | 200 | void tipc_bclink_recv_pkt(struct sk_buff *buf); |
201 | u32 tipc_bclink_get_last_sent(void); | 201 | u32 tipc_bclink_get_last_sent(void); |
202 | u32 tipc_bclink_acks_missing(struct node *n_ptr); | 202 | u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr); |
203 | void tipc_bclink_check_gap(struct node *n_ptr, u32 seqno); | 203 | void tipc_bclink_check_gap(struct tipc_node *n_ptr, u32 seqno); |
204 | int tipc_bclink_stats(char *stats_buf, const u32 buf_size); | 204 | int tipc_bclink_stats(char *stats_buf, const u32 buf_size); |
205 | int tipc_bclink_reset_stats(void); | 205 | int tipc_bclink_reset_stats(void); |
206 | int tipc_bclink_set_queue_limits(u32 limit); | 206 | int tipc_bclink_set_queue_limits(u32 limit); |
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 6a9aba3edd08..a7a36779b9b3 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c | |||
@@ -599,7 +599,7 @@ int tipc_block_bearer(const char *name) | |||
599 | spin_lock_bh(&b_ptr->publ.lock); | 599 | spin_lock_bh(&b_ptr->publ.lock); |
600 | b_ptr->publ.blocked = 1; | 600 | b_ptr->publ.blocked = 1; |
601 | list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) { | 601 | list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) { |
602 | struct node *n_ptr = l_ptr->owner; | 602 | struct tipc_node *n_ptr = l_ptr->owner; |
603 | 603 | ||
604 | spin_lock_bh(&n_ptr->lock); | 604 | spin_lock_bh(&n_ptr->lock); |
605 | tipc_link_reset(l_ptr); | 605 | tipc_link_reset(l_ptr); |
diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h index 6a36b6600e6c..ca5734892713 100644 --- a/net/tipc/bearer.h +++ b/net/tipc/bearer.h | |||
@@ -104,7 +104,7 @@ struct bearer { | |||
104 | u32 continue_count; | 104 | u32 continue_count; |
105 | int active; | 105 | int active; |
106 | char net_plane; | 106 | char net_plane; |
107 | struct node_map nodes; | 107 | struct tipc_node_map nodes; |
108 | }; | 108 | }; |
109 | 109 | ||
110 | struct bearer_name { | 110 | struct bearer_name { |
diff --git a/net/tipc/cluster.c b/net/tipc/cluster.c index 46ee6c58532d..689fdefe9d04 100644 --- a/net/tipc/cluster.c +++ b/net/tipc/cluster.c | |||
@@ -48,8 +48,8 @@ static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf, | |||
48 | u32 lower, u32 upper); | 48 | u32 lower, u32 upper); |
49 | static struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest); | 49 | static struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest); |
50 | 50 | ||
51 | struct node **tipc_local_nodes = NULL; | 51 | struct tipc_node **tipc_local_nodes = NULL; |
52 | struct node_map tipc_cltr_bcast_nodes = {0,{0,}}; | 52 | struct tipc_node_map tipc_cltr_bcast_nodes = {0,{0,}}; |
53 | u32 tipc_highest_allowed_slave = 0; | 53 | u32 tipc_highest_allowed_slave = 0; |
54 | 54 | ||
55 | struct cluster *tipc_cltr_create(u32 addr) | 55 | struct cluster *tipc_cltr_create(u32 addr) |
@@ -115,7 +115,7 @@ void tipc_cltr_delete(struct cluster *c_ptr) | |||
115 | 115 | ||
116 | u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr) | 116 | u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr) |
117 | { | 117 | { |
118 | struct node *n_ptr; | 118 | struct tipc_node *n_ptr; |
119 | u32 n_num = tipc_node(addr) + 1; | 119 | u32 n_num = tipc_node(addr) + 1; |
120 | 120 | ||
121 | if (!c_ptr) | 121 | if (!c_ptr) |
@@ -133,7 +133,7 @@ u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr) | |||
133 | return 0; | 133 | return 0; |
134 | } | 134 | } |
135 | 135 | ||
136 | void tipc_cltr_attach_node(struct cluster *c_ptr, struct node *n_ptr) | 136 | void tipc_cltr_attach_node(struct cluster *c_ptr, struct tipc_node *n_ptr) |
137 | { | 137 | { |
138 | u32 n_num = tipc_node(n_ptr->addr); | 138 | u32 n_num = tipc_node(n_ptr->addr); |
139 | u32 max_n_num = tipc_max_nodes; | 139 | u32 max_n_num = tipc_max_nodes; |
@@ -196,7 +196,7 @@ u32 tipc_cltr_select_router(struct cluster *c_ptr, u32 ref) | |||
196 | * Uses deterministic and fair algorithm. | 196 | * Uses deterministic and fair algorithm. |
197 | */ | 197 | */ |
198 | 198 | ||
199 | struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector) | 199 | struct tipc_node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector) |
200 | { | 200 | { |
201 | u32 n_num; | 201 | u32 n_num; |
202 | u32 mask = tipc_max_nodes; | 202 | u32 mask = tipc_max_nodes; |
@@ -379,7 +379,7 @@ void tipc_cltr_recv_routing_table(struct sk_buff *buf) | |||
379 | { | 379 | { |
380 | struct tipc_msg *msg = buf_msg(buf); | 380 | struct tipc_msg *msg = buf_msg(buf); |
381 | struct cluster *c_ptr; | 381 | struct cluster *c_ptr; |
382 | struct node *n_ptr; | 382 | struct tipc_node *n_ptr; |
383 | unchar *node_table; | 383 | unchar *node_table; |
384 | u32 table_size; | 384 | u32 table_size; |
385 | u32 router; | 385 | u32 router; |
@@ -499,7 +499,7 @@ static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf, | |||
499 | u32 lower, u32 upper) | 499 | u32 lower, u32 upper) |
500 | { | 500 | { |
501 | struct sk_buff *buf_copy; | 501 | struct sk_buff *buf_copy; |
502 | struct node *n_ptr; | 502 | struct tipc_node *n_ptr; |
503 | u32 n_num; | 503 | u32 n_num; |
504 | u32 tstop; | 504 | u32 tstop; |
505 | 505 | ||
@@ -534,7 +534,7 @@ void tipc_cltr_broadcast(struct sk_buff *buf) | |||
534 | { | 534 | { |
535 | struct sk_buff *buf_copy; | 535 | struct sk_buff *buf_copy; |
536 | struct cluster *c_ptr; | 536 | struct cluster *c_ptr; |
537 | struct node *n_ptr; | 537 | struct tipc_node *n_ptr; |
538 | u32 n_num; | 538 | u32 n_num; |
539 | u32 tstart; | 539 | u32 tstart; |
540 | u32 tstop; | 540 | u32 tstop; |
diff --git a/net/tipc/cluster.h b/net/tipc/cluster.h index 62df074afaec..333efb0b9c44 100644 --- a/net/tipc/cluster.h +++ b/net/tipc/cluster.h | |||
@@ -54,24 +54,24 @@ | |||
54 | struct cluster { | 54 | struct cluster { |
55 | u32 addr; | 55 | u32 addr; |
56 | struct _zone *owner; | 56 | struct _zone *owner; |
57 | struct node **nodes; | 57 | struct tipc_node **nodes; |
58 | u32 highest_node; | 58 | u32 highest_node; |
59 | u32 highest_slave; | 59 | u32 highest_slave; |
60 | }; | 60 | }; |
61 | 61 | ||
62 | 62 | ||
63 | extern struct node **tipc_local_nodes; | 63 | extern struct tipc_node **tipc_local_nodes; |
64 | extern u32 tipc_highest_allowed_slave; | 64 | extern u32 tipc_highest_allowed_slave; |
65 | extern struct node_map tipc_cltr_bcast_nodes; | 65 | extern struct tipc_node_map tipc_cltr_bcast_nodes; |
66 | 66 | ||
67 | void tipc_cltr_remove_as_router(struct cluster *c_ptr, u32 router); | 67 | void tipc_cltr_remove_as_router(struct cluster *c_ptr, u32 router); |
68 | void tipc_cltr_send_ext_routes(struct cluster *c_ptr, u32 dest); | 68 | void tipc_cltr_send_ext_routes(struct cluster *c_ptr, u32 dest); |
69 | struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector); | 69 | struct tipc_node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector); |
70 | u32 tipc_cltr_select_router(struct cluster *c_ptr, u32 ref); | 70 | u32 tipc_cltr_select_router(struct cluster *c_ptr, u32 ref); |
71 | void tipc_cltr_recv_routing_table(struct sk_buff *buf); | 71 | void tipc_cltr_recv_routing_table(struct sk_buff *buf); |
72 | struct cluster *tipc_cltr_create(u32 addr); | 72 | struct cluster *tipc_cltr_create(u32 addr); |
73 | void tipc_cltr_delete(struct cluster *c_ptr); | 73 | void tipc_cltr_delete(struct cluster *c_ptr); |
74 | void tipc_cltr_attach_node(struct cluster *c_ptr, struct node *n_ptr); | 74 | void tipc_cltr_attach_node(struct cluster *c_ptr, struct tipc_node *n_ptr); |
75 | void tipc_cltr_send_slave_routes(struct cluster *c_ptr, u32 dest); | 75 | void tipc_cltr_send_slave_routes(struct cluster *c_ptr, u32 dest); |
76 | void tipc_cltr_broadcast(struct sk_buff *buf); | 76 | void tipc_cltr_broadcast(struct sk_buff *buf); |
77 | int tipc_cltr_init(void); | 77 | int tipc_cltr_init(void); |
diff --git a/net/tipc/discover.c b/net/tipc/discover.c index 1657f0e795ff..74b7d1e28aec 100644 --- a/net/tipc/discover.c +++ b/net/tipc/discover.c | |||
@@ -193,7 +193,7 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr) | |||
193 | /* Always accept link here */ | 193 | /* Always accept link here */ |
194 | struct sk_buff *rbuf; | 194 | struct sk_buff *rbuf; |
195 | struct tipc_media_addr *addr; | 195 | struct tipc_media_addr *addr; |
196 | struct node *n_ptr = tipc_node_find(orig); | 196 | struct tipc_node *n_ptr = tipc_node_find(orig); |
197 | int link_fully_up; | 197 | int link_fully_up; |
198 | 198 | ||
199 | dbg(" in own cluster\n"); | 199 | dbg(" in own cluster\n"); |
diff --git a/net/tipc/link.c b/net/tipc/link.c index d60113ba4b1b..dd4c18b9a35b 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -1155,7 +1155,7 @@ int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf) | |||
1155 | int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector) | 1155 | int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector) |
1156 | { | 1156 | { |
1157 | struct link *l_ptr; | 1157 | struct link *l_ptr; |
1158 | struct node *n_ptr; | 1158 | struct tipc_node *n_ptr; |
1159 | int res = -ELINKCONG; | 1159 | int res = -ELINKCONG; |
1160 | 1160 | ||
1161 | read_lock_bh(&tipc_net_lock); | 1161 | read_lock_bh(&tipc_net_lock); |
@@ -1226,7 +1226,7 @@ static int link_send_buf_fast(struct link *l_ptr, struct sk_buff *buf, | |||
1226 | int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode) | 1226 | int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode) |
1227 | { | 1227 | { |
1228 | struct link *l_ptr; | 1228 | struct link *l_ptr; |
1229 | struct node *n_ptr; | 1229 | struct tipc_node *n_ptr; |
1230 | int res; | 1230 | int res; |
1231 | u32 selector = msg_origport(buf_msg(buf)) & 1; | 1231 | u32 selector = msg_origport(buf_msg(buf)) & 1; |
1232 | u32 dummy; | 1232 | u32 dummy; |
@@ -1270,7 +1270,7 @@ int tipc_link_send_sections_fast(struct port *sender, | |||
1270 | struct tipc_msg *hdr = &sender->publ.phdr; | 1270 | struct tipc_msg *hdr = &sender->publ.phdr; |
1271 | struct link *l_ptr; | 1271 | struct link *l_ptr; |
1272 | struct sk_buff *buf; | 1272 | struct sk_buff *buf; |
1273 | struct node *node; | 1273 | struct tipc_node *node; |
1274 | int res; | 1274 | int res; |
1275 | u32 selector = msg_origport(hdr) & 1; | 1275 | u32 selector = msg_origport(hdr) & 1; |
1276 | 1276 | ||
@@ -1364,7 +1364,7 @@ static int link_send_sections_long(struct port *sender, | |||
1364 | u32 destaddr) | 1364 | u32 destaddr) |
1365 | { | 1365 | { |
1366 | struct link *l_ptr; | 1366 | struct link *l_ptr; |
1367 | struct node *node; | 1367 | struct tipc_node *node; |
1368 | struct tipc_msg *hdr = &sender->publ.phdr; | 1368 | struct tipc_msg *hdr = &sender->publ.phdr; |
1369 | u32 dsz = msg_data_sz(hdr); | 1369 | u32 dsz = msg_data_sz(hdr); |
1370 | u32 max_pkt,fragm_sz,rest; | 1370 | u32 max_pkt,fragm_sz,rest; |
@@ -1636,7 +1636,7 @@ void tipc_link_push_queue(struct link *l_ptr) | |||
1636 | 1636 | ||
1637 | static void link_reset_all(unsigned long addr) | 1637 | static void link_reset_all(unsigned long addr) |
1638 | { | 1638 | { |
1639 | struct node *n_ptr; | 1639 | struct tipc_node *n_ptr; |
1640 | char addr_string[16]; | 1640 | char addr_string[16]; |
1641 | u32 i; | 1641 | u32 i; |
1642 | 1642 | ||
@@ -1682,7 +1682,7 @@ static void link_retransmit_failure(struct link *l_ptr, struct sk_buff *buf) | |||
1682 | 1682 | ||
1683 | /* Handle failure on broadcast link */ | 1683 | /* Handle failure on broadcast link */ |
1684 | 1684 | ||
1685 | struct node *n_ptr; | 1685 | struct tipc_node *n_ptr; |
1686 | char addr_string[16]; | 1686 | char addr_string[16]; |
1687 | 1687 | ||
1688 | tipc_printf(TIPC_OUTPUT, "Msg seq number: %u, ", msg_seqno(msg)); | 1688 | tipc_printf(TIPC_OUTPUT, "Msg seq number: %u, ", msg_seqno(msg)); |
@@ -1843,7 +1843,7 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *tb_ptr) | |||
1843 | read_lock_bh(&tipc_net_lock); | 1843 | read_lock_bh(&tipc_net_lock); |
1844 | while (head) { | 1844 | while (head) { |
1845 | struct bearer *b_ptr = (struct bearer *)tb_ptr; | 1845 | struct bearer *b_ptr = (struct bearer *)tb_ptr; |
1846 | struct node *n_ptr; | 1846 | struct tipc_node *n_ptr; |
1847 | struct link *l_ptr; | 1847 | struct link *l_ptr; |
1848 | struct sk_buff *crs; | 1848 | struct sk_buff *crs; |
1849 | struct sk_buff *buf = head; | 1849 | struct sk_buff *buf = head; |
@@ -2935,7 +2935,7 @@ void tipc_link_set_queue_limits(struct link *l_ptr, u32 window) | |||
2935 | * Returns pointer to link (or 0 if invalid link name). | 2935 | * Returns pointer to link (or 0 if invalid link name). |
2936 | */ | 2936 | */ |
2937 | 2937 | ||
2938 | static struct link *link_find_link(const char *name, struct node **node) | 2938 | static struct link *link_find_link(const char *name, struct tipc_node **node) |
2939 | { | 2939 | { |
2940 | struct link_name link_name_parts; | 2940 | struct link_name link_name_parts; |
2941 | struct bearer *b_ptr; | 2941 | struct bearer *b_ptr; |
@@ -2965,7 +2965,7 @@ struct sk_buff *tipc_link_cmd_config(const void *req_tlv_area, int req_tlv_space | |||
2965 | struct tipc_link_config *args; | 2965 | struct tipc_link_config *args; |
2966 | u32 new_value; | 2966 | u32 new_value; |
2967 | struct link *l_ptr; | 2967 | struct link *l_ptr; |
2968 | struct node *node; | 2968 | struct tipc_node *node; |
2969 | int res; | 2969 | int res; |
2970 | 2970 | ||
2971 | if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_LINK_CONFIG)) | 2971 | if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_LINK_CONFIG)) |
@@ -3043,7 +3043,7 @@ struct sk_buff *tipc_link_cmd_reset_stats(const void *req_tlv_area, int req_tlv_ | |||
3043 | { | 3043 | { |
3044 | char *link_name; | 3044 | char *link_name; |
3045 | struct link *l_ptr; | 3045 | struct link *l_ptr; |
3046 | struct node *node; | 3046 | struct tipc_node *node; |
3047 | 3047 | ||
3048 | if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_LINK_NAME)) | 3048 | if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_LINK_NAME)) |
3049 | return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); | 3049 | return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); |
@@ -3091,7 +3091,7 @@ static int tipc_link_stats(const char *name, char *buf, const u32 buf_size) | |||
3091 | { | 3091 | { |
3092 | struct print_buf pb; | 3092 | struct print_buf pb; |
3093 | struct link *l_ptr; | 3093 | struct link *l_ptr; |
3094 | struct node *node; | 3094 | struct tipc_node *node; |
3095 | char *status; | 3095 | char *status; |
3096 | u32 profile_total = 0; | 3096 | u32 profile_total = 0; |
3097 | 3097 | ||
@@ -3207,7 +3207,7 @@ int link_control(const char *name, u32 op, u32 val) | |||
3207 | int res = -EINVAL; | 3207 | int res = -EINVAL; |
3208 | struct link *l_ptr; | 3208 | struct link *l_ptr; |
3209 | u32 bearer_id; | 3209 | u32 bearer_id; |
3210 | struct node * node; | 3210 | struct tipc_node * node; |
3211 | u32 a; | 3211 | u32 a; |
3212 | 3212 | ||
3213 | a = link_name2addr(name, &bearer_id); | 3213 | a = link_name2addr(name, &bearer_id); |
@@ -3249,7 +3249,7 @@ int link_control(const char *name, u32 op, u32 val) | |||
3249 | 3249 | ||
3250 | u32 tipc_link_get_max_pkt(u32 dest, u32 selector) | 3250 | u32 tipc_link_get_max_pkt(u32 dest, u32 selector) |
3251 | { | 3251 | { |
3252 | struct node *n_ptr; | 3252 | struct tipc_node *n_ptr; |
3253 | struct link *l_ptr; | 3253 | struct link *l_ptr; |
3254 | u32 res = MAX_PKT_DEFAULT; | 3254 | u32 res = MAX_PKT_DEFAULT; |
3255 | 3255 | ||
diff --git a/net/tipc/link.h b/net/tipc/link.h index 52f3e7c1871f..6a51e38ad25c 100644 --- a/net/tipc/link.h +++ b/net/tipc/link.h | |||
@@ -116,7 +116,7 @@ struct link { | |||
116 | char name[TIPC_MAX_LINK_NAME]; | 116 | char name[TIPC_MAX_LINK_NAME]; |
117 | struct tipc_media_addr media_addr; | 117 | struct tipc_media_addr media_addr; |
118 | struct timer_list timer; | 118 | struct timer_list timer; |
119 | struct node *owner; | 119 | struct tipc_node *owner; |
120 | struct list_head link_list; | 120 | struct list_head link_list; |
121 | 121 | ||
122 | /* Management and link supervision data */ | 122 | /* Management and link supervision data */ |
diff --git a/net/tipc/name_table.h b/net/tipc/name_table.h index b9e7cd336d76..139882d4ed00 100644 --- a/net/tipc/name_table.h +++ b/net/tipc/name_table.h | |||
@@ -76,7 +76,7 @@ struct publication { | |||
76 | u32 node; | 76 | u32 node; |
77 | u32 ref; | 77 | u32 ref; |
78 | u32 key; | 78 | u32 key; |
79 | struct node_subscr subscr; | 79 | struct tipc_node_subscr subscr; |
80 | struct list_head local_list; | 80 | struct list_head local_list; |
81 | struct list_head pport_list; | 81 | struct list_head pport_list; |
82 | struct publication *node_list_next; | 82 | struct publication *node_list_next; |
diff --git a/net/tipc/net.c b/net/tipc/net.c index ec7b04fbdc43..7906608bf510 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c | |||
@@ -118,7 +118,7 @@ | |||
118 | DEFINE_RWLOCK(tipc_net_lock); | 118 | DEFINE_RWLOCK(tipc_net_lock); |
119 | struct network tipc_net = { NULL }; | 119 | struct network tipc_net = { NULL }; |
120 | 120 | ||
121 | struct node *tipc_net_select_remote_node(u32 addr, u32 ref) | 121 | struct tipc_node *tipc_net_select_remote_node(u32 addr, u32 ref) |
122 | { | 122 | { |
123 | return tipc_zone_select_remote_node(tipc_net.zones[tipc_zone(addr)], addr, ref); | 123 | return tipc_zone_select_remote_node(tipc_net.zones[tipc_zone(addr)], addr, ref); |
124 | } | 124 | } |
diff --git a/net/tipc/net.h b/net/tipc/net.h index d154ac2bda9a..de2b9ad8f646 100644 --- a/net/tipc/net.h +++ b/net/tipc/net.h | |||
@@ -55,7 +55,7 @@ extern rwlock_t tipc_net_lock; | |||
55 | void tipc_net_remove_as_router(u32 router); | 55 | void tipc_net_remove_as_router(u32 router); |
56 | void tipc_net_send_external_routes(u32 dest); | 56 | void tipc_net_send_external_routes(u32 dest); |
57 | void tipc_net_route_msg(struct sk_buff *buf); | 57 | void tipc_net_route_msg(struct sk_buff *buf); |
58 | struct node *tipc_net_select_remote_node(u32 addr, u32 ref); | 58 | struct tipc_node *tipc_net_select_remote_node(u32 addr, u32 ref); |
59 | u32 tipc_net_select_router(u32 addr, u32 ref); | 59 | u32 tipc_net_select_router(u32 addr, u32 ref); |
60 | 60 | ||
61 | int tipc_net_start(u32 addr); | 61 | int tipc_net_start(u32 addr); |
diff --git a/net/tipc/node.c b/net/tipc/node.c index ee952ad60218..20d98c56e152 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -46,11 +46,11 @@ | |||
46 | #include "bearer.h" | 46 | #include "bearer.h" |
47 | #include "name_distr.h" | 47 | #include "name_distr.h" |
48 | 48 | ||
49 | void node_print(struct print_buf *buf, struct node *n_ptr, char *str); | 49 | void node_print(struct print_buf *buf, struct tipc_node *n_ptr, char *str); |
50 | static void node_lost_contact(struct node *n_ptr); | 50 | static void node_lost_contact(struct tipc_node *n_ptr); |
51 | static void node_established_contact(struct node *n_ptr); | 51 | static void node_established_contact(struct tipc_node *n_ptr); |
52 | 52 | ||
53 | struct node *tipc_nodes = NULL; /* sorted list of nodes within cluster */ | 53 | struct tipc_node *tipc_nodes = NULL; /* sorted list of nodes within cluster */ |
54 | 54 | ||
55 | static DEFINE_SPINLOCK(node_create_lock); | 55 | static DEFINE_SPINLOCK(node_create_lock); |
56 | 56 | ||
@@ -66,11 +66,11 @@ u32 tipc_own_tag = 0; | |||
66 | * but this is a non-trivial change.) | 66 | * but this is a non-trivial change.) |
67 | */ | 67 | */ |
68 | 68 | ||
69 | struct node *tipc_node_create(u32 addr) | 69 | struct tipc_node *tipc_node_create(u32 addr) |
70 | { | 70 | { |
71 | struct cluster *c_ptr; | 71 | struct cluster *c_ptr; |
72 | struct node *n_ptr; | 72 | struct tipc_node *n_ptr; |
73 | struct node **curr_node; | 73 | struct tipc_node **curr_node; |
74 | 74 | ||
75 | spin_lock_bh(&node_create_lock); | 75 | spin_lock_bh(&node_create_lock); |
76 | 76 | ||
@@ -120,7 +120,7 @@ struct node *tipc_node_create(u32 addr) | |||
120 | return n_ptr; | 120 | return n_ptr; |
121 | } | 121 | } |
122 | 122 | ||
123 | void tipc_node_delete(struct node *n_ptr) | 123 | void tipc_node_delete(struct tipc_node *n_ptr) |
124 | { | 124 | { |
125 | if (!n_ptr) | 125 | if (!n_ptr) |
126 | return; | 126 | return; |
@@ -146,7 +146,7 @@ void tipc_node_delete(struct node *n_ptr) | |||
146 | * Link becomes active (alone or shared) or standby, depending on its priority. | 146 | * Link becomes active (alone or shared) or standby, depending on its priority. |
147 | */ | 147 | */ |
148 | 148 | ||
149 | void tipc_node_link_up(struct node *n_ptr, struct link *l_ptr) | 149 | void tipc_node_link_up(struct tipc_node *n_ptr, struct link *l_ptr) |
150 | { | 150 | { |
151 | struct link **active = &n_ptr->active_links[0]; | 151 | struct link **active = &n_ptr->active_links[0]; |
152 | 152 | ||
@@ -180,7 +180,7 @@ void tipc_node_link_up(struct node *n_ptr, struct link *l_ptr) | |||
180 | * node_select_active_links - select active link | 180 | * node_select_active_links - select active link |
181 | */ | 181 | */ |
182 | 182 | ||
183 | static void node_select_active_links(struct node *n_ptr) | 183 | static void node_select_active_links(struct tipc_node *n_ptr) |
184 | { | 184 | { |
185 | struct link **active = &n_ptr->active_links[0]; | 185 | struct link **active = &n_ptr->active_links[0]; |
186 | u32 i; | 186 | u32 i; |
@@ -208,7 +208,7 @@ static void node_select_active_links(struct node *n_ptr) | |||
208 | * tipc_node_link_down - handle loss of link | 208 | * tipc_node_link_down - handle loss of link |
209 | */ | 209 | */ |
210 | 210 | ||
211 | void tipc_node_link_down(struct node *n_ptr, struct link *l_ptr) | 211 | void tipc_node_link_down(struct tipc_node *n_ptr, struct link *l_ptr) |
212 | { | 212 | { |
213 | struct link **active; | 213 | struct link **active; |
214 | 214 | ||
@@ -235,30 +235,30 @@ void tipc_node_link_down(struct node *n_ptr, struct link *l_ptr) | |||
235 | node_lost_contact(n_ptr); | 235 | node_lost_contact(n_ptr); |
236 | } | 236 | } |
237 | 237 | ||
238 | int tipc_node_has_active_links(struct node *n_ptr) | 238 | int tipc_node_has_active_links(struct tipc_node *n_ptr) |
239 | { | 239 | { |
240 | return (n_ptr && | 240 | return (n_ptr && |
241 | ((n_ptr->active_links[0]) || (n_ptr->active_links[1]))); | 241 | ((n_ptr->active_links[0]) || (n_ptr->active_links[1]))); |
242 | } | 242 | } |
243 | 243 | ||
244 | int tipc_node_has_redundant_links(struct node *n_ptr) | 244 | int tipc_node_has_redundant_links(struct tipc_node *n_ptr) |
245 | { | 245 | { |
246 | return (n_ptr->working_links > 1); | 246 | return (n_ptr->working_links > 1); |
247 | } | 247 | } |
248 | 248 | ||
249 | static int tipc_node_has_active_routes(struct node *n_ptr) | 249 | static int tipc_node_has_active_routes(struct tipc_node *n_ptr) |
250 | { | 250 | { |
251 | return (n_ptr && (n_ptr->last_router >= 0)); | 251 | return (n_ptr && (n_ptr->last_router >= 0)); |
252 | } | 252 | } |
253 | 253 | ||
254 | int tipc_node_is_up(struct node *n_ptr) | 254 | int tipc_node_is_up(struct tipc_node *n_ptr) |
255 | { | 255 | { |
256 | return (tipc_node_has_active_links(n_ptr) || tipc_node_has_active_routes(n_ptr)); | 256 | return (tipc_node_has_active_links(n_ptr) || tipc_node_has_active_routes(n_ptr)); |
257 | } | 257 | } |
258 | 258 | ||
259 | struct node *tipc_node_attach_link(struct link *l_ptr) | 259 | struct tipc_node *tipc_node_attach_link(struct link *l_ptr) |
260 | { | 260 | { |
261 | struct node *n_ptr = tipc_node_find(l_ptr->addr); | 261 | struct tipc_node *n_ptr = tipc_node_find(l_ptr->addr); |
262 | 262 | ||
263 | if (!n_ptr) | 263 | if (!n_ptr) |
264 | n_ptr = tipc_node_create(l_ptr->addr); | 264 | n_ptr = tipc_node_create(l_ptr->addr); |
@@ -285,7 +285,7 @@ struct node *tipc_node_attach_link(struct link *l_ptr) | |||
285 | return NULL; | 285 | return NULL; |
286 | } | 286 | } |
287 | 287 | ||
288 | void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr) | 288 | void tipc_node_detach_link(struct tipc_node *n_ptr, struct link *l_ptr) |
289 | { | 289 | { |
290 | n_ptr->links[l_ptr->b_ptr->identity] = NULL; | 290 | n_ptr->links[l_ptr->b_ptr->identity] = NULL; |
291 | tipc_net.zones[tipc_zone(l_ptr->addr)]->links--; | 291 | tipc_net.zones[tipc_zone(l_ptr->addr)]->links--; |
@@ -338,7 +338,7 @@ void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr) | |||
338 | * | 338 | * |
339 | */ | 339 | */ |
340 | 340 | ||
341 | static void node_established_contact(struct node *n_ptr) | 341 | static void node_established_contact(struct tipc_node *n_ptr) |
342 | { | 342 | { |
343 | struct cluster *c_ptr; | 343 | struct cluster *c_ptr; |
344 | 344 | ||
@@ -384,10 +384,10 @@ static void node_established_contact(struct node *n_ptr) | |||
384 | tipc_highest_allowed_slave); | 384 | tipc_highest_allowed_slave); |
385 | } | 385 | } |
386 | 386 | ||
387 | static void node_lost_contact(struct node *n_ptr) | 387 | static void node_lost_contact(struct tipc_node *n_ptr) |
388 | { | 388 | { |
389 | struct cluster *c_ptr; | 389 | struct cluster *c_ptr; |
390 | struct node_subscr *ns, *tns; | 390 | struct tipc_node_subscr *ns, *tns; |
391 | char addr_string[16]; | 391 | char addr_string[16]; |
392 | u32 i; | 392 | u32 i; |
393 | 393 | ||
@@ -466,9 +466,9 @@ static void node_lost_contact(struct node *n_ptr) | |||
466 | * Called by when cluster local lookup has failed. | 466 | * Called by when cluster local lookup has failed. |
467 | */ | 467 | */ |
468 | 468 | ||
469 | struct node *tipc_node_select_next_hop(u32 addr, u32 selector) | 469 | struct tipc_node *tipc_node_select_next_hop(u32 addr, u32 selector) |
470 | { | 470 | { |
471 | struct node *n_ptr; | 471 | struct tipc_node *n_ptr; |
472 | u32 router_addr; | 472 | u32 router_addr; |
473 | 473 | ||
474 | if (!tipc_addr_domain_valid(addr)) | 474 | if (!tipc_addr_domain_valid(addr)) |
@@ -513,7 +513,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector) | |||
513 | * Uses a deterministic and fair algorithm for selecting router node. | 513 | * Uses a deterministic and fair algorithm for selecting router node. |
514 | */ | 514 | */ |
515 | 515 | ||
516 | u32 tipc_node_select_router(struct node *n_ptr, u32 ref) | 516 | u32 tipc_node_select_router(struct tipc_node *n_ptr, u32 ref) |
517 | { | 517 | { |
518 | u32 ulim; | 518 | u32 ulim; |
519 | u32 mask; | 519 | u32 mask; |
@@ -551,7 +551,7 @@ u32 tipc_node_select_router(struct node *n_ptr, u32 ref) | |||
551 | return tipc_addr(own_zone(), own_cluster(), r); | 551 | return tipc_addr(own_zone(), own_cluster(), r); |
552 | } | 552 | } |
553 | 553 | ||
554 | void tipc_node_add_router(struct node *n_ptr, u32 router) | 554 | void tipc_node_add_router(struct tipc_node *n_ptr, u32 router) |
555 | { | 555 | { |
556 | u32 r_num = tipc_node(router); | 556 | u32 r_num = tipc_node(router); |
557 | 557 | ||
@@ -562,7 +562,7 @@ void tipc_node_add_router(struct node *n_ptr, u32 router) | |||
562 | !n_ptr->routers[n_ptr->last_router]); | 562 | !n_ptr->routers[n_ptr->last_router]); |
563 | } | 563 | } |
564 | 564 | ||
565 | void tipc_node_remove_router(struct node *n_ptr, u32 router) | 565 | void tipc_node_remove_router(struct tipc_node *n_ptr, u32 router) |
566 | { | 566 | { |
567 | u32 r_num = tipc_node(router); | 567 | u32 r_num = tipc_node(router); |
568 | 568 | ||
@@ -580,7 +580,7 @@ void tipc_node_remove_router(struct node *n_ptr, u32 router) | |||
580 | } | 580 | } |
581 | 581 | ||
582 | #if 0 | 582 | #if 0 |
583 | void node_print(struct print_buf *buf, struct node *n_ptr, char *str) | 583 | void node_print(struct print_buf *buf, struct tipc_node *n_ptr, char *str) |
584 | { | 584 | { |
585 | u32 i; | 585 | u32 i; |
586 | 586 | ||
@@ -597,7 +597,7 @@ void node_print(struct print_buf *buf, struct node *n_ptr, char *str) | |||
597 | 597 | ||
598 | u32 tipc_available_nodes(const u32 domain) | 598 | u32 tipc_available_nodes(const u32 domain) |
599 | { | 599 | { |
600 | struct node *n_ptr; | 600 | struct tipc_node *n_ptr; |
601 | u32 cnt = 0; | 601 | u32 cnt = 0; |
602 | 602 | ||
603 | read_lock_bh(&tipc_net_lock); | 603 | read_lock_bh(&tipc_net_lock); |
@@ -615,7 +615,7 @@ struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space) | |||
615 | { | 615 | { |
616 | u32 domain; | 616 | u32 domain; |
617 | struct sk_buff *buf; | 617 | struct sk_buff *buf; |
618 | struct node *n_ptr; | 618 | struct tipc_node *n_ptr; |
619 | struct tipc_node_info node_info; | 619 | struct tipc_node_info node_info; |
620 | u32 payload_size; | 620 | u32 payload_size; |
621 | 621 | ||
@@ -667,7 +667,7 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space) | |||
667 | { | 667 | { |
668 | u32 domain; | 668 | u32 domain; |
669 | struct sk_buff *buf; | 669 | struct sk_buff *buf; |
670 | struct node *n_ptr; | 670 | struct tipc_node *n_ptr; |
671 | struct tipc_link_info link_info; | 671 | struct tipc_link_info link_info; |
672 | u32 payload_size; | 672 | u32 payload_size; |
673 | 673 | ||
diff --git a/net/tipc/node.h b/net/tipc/node.h index cd1882654bbb..6f990da5d143 100644 --- a/net/tipc/node.h +++ b/net/tipc/node.h | |||
@@ -43,7 +43,7 @@ | |||
43 | #include "bearer.h" | 43 | #include "bearer.h" |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * struct node - TIPC node structure | 46 | * struct tipc_node - TIPC node structure |
47 | * @addr: network address of node | 47 | * @addr: network address of node |
48 | * @lock: spinlock governing access to structure | 48 | * @lock: spinlock governing access to structure |
49 | * @owner: pointer to cluster that node belongs to | 49 | * @owner: pointer to cluster that node belongs to |
@@ -68,11 +68,11 @@ | |||
68 | * @defragm: list of partially reassembled b'cast message fragments from node | 68 | * @defragm: list of partially reassembled b'cast message fragments from node |
69 | */ | 69 | */ |
70 | 70 | ||
71 | struct node { | 71 | struct tipc_node { |
72 | u32 addr; | 72 | u32 addr; |
73 | spinlock_t lock; | 73 | spinlock_t lock; |
74 | struct cluster *owner; | 74 | struct cluster *owner; |
75 | struct node *next; | 75 | struct tipc_node *next; |
76 | struct list_head nsub; | 76 | struct list_head nsub; |
77 | struct link *active_links[2]; | 77 | struct link *active_links[2]; |
78 | struct link *links[MAX_BEARERS]; | 78 | struct link *links[MAX_BEARERS]; |
@@ -94,26 +94,26 @@ struct node { | |||
94 | } bclink; | 94 | } bclink; |
95 | }; | 95 | }; |
96 | 96 | ||
97 | extern struct node *tipc_nodes; | 97 | extern struct tipc_node *tipc_nodes; |
98 | extern u32 tipc_own_tag; | 98 | extern u32 tipc_own_tag; |
99 | 99 | ||
100 | struct node *tipc_node_create(u32 addr); | 100 | struct tipc_node *tipc_node_create(u32 addr); |
101 | void tipc_node_delete(struct node *n_ptr); | 101 | void tipc_node_delete(struct tipc_node *n_ptr); |
102 | struct node *tipc_node_attach_link(struct link *l_ptr); | 102 | struct tipc_node *tipc_node_attach_link(struct link *l_ptr); |
103 | void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr); | 103 | void tipc_node_detach_link(struct tipc_node *n_ptr, struct link *l_ptr); |
104 | void tipc_node_link_down(struct node *n_ptr, struct link *l_ptr); | 104 | void tipc_node_link_down(struct tipc_node *n_ptr, struct link *l_ptr); |
105 | void tipc_node_link_up(struct node *n_ptr, struct link *l_ptr); | 105 | void tipc_node_link_up(struct tipc_node *n_ptr, struct link *l_ptr); |
106 | int tipc_node_has_active_links(struct node *n_ptr); | 106 | int tipc_node_has_active_links(struct tipc_node *n_ptr); |
107 | int tipc_node_has_redundant_links(struct node *n_ptr); | 107 | int tipc_node_has_redundant_links(struct tipc_node *n_ptr); |
108 | u32 tipc_node_select_router(struct node *n_ptr, u32 ref); | 108 | u32 tipc_node_select_router(struct tipc_node *n_ptr, u32 ref); |
109 | struct node *tipc_node_select_next_hop(u32 addr, u32 selector); | 109 | struct tipc_node *tipc_node_select_next_hop(u32 addr, u32 selector); |
110 | int tipc_node_is_up(struct node *n_ptr); | 110 | int tipc_node_is_up(struct tipc_node *n_ptr); |
111 | void tipc_node_add_router(struct node *n_ptr, u32 router); | 111 | void tipc_node_add_router(struct tipc_node *n_ptr, u32 router); |
112 | void tipc_node_remove_router(struct node *n_ptr, u32 router); | 112 | void tipc_node_remove_router(struct tipc_node *n_ptr, u32 router); |
113 | struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space); | 113 | struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space); |
114 | struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space); | 114 | struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space); |
115 | 115 | ||
116 | static inline struct node *tipc_node_find(u32 addr) | 116 | static inline struct tipc_node *tipc_node_find(u32 addr) |
117 | { | 117 | { |
118 | if (likely(in_own_cluster(addr))) | 118 | if (likely(in_own_cluster(addr))) |
119 | return tipc_local_nodes[tipc_node(addr)]; | 119 | return tipc_local_nodes[tipc_node(addr)]; |
@@ -126,19 +126,19 @@ static inline struct node *tipc_node_find(u32 addr) | |||
126 | return NULL; | 126 | return NULL; |
127 | } | 127 | } |
128 | 128 | ||
129 | static inline struct node *tipc_node_select(u32 addr, u32 selector) | 129 | static inline struct tipc_node *tipc_node_select(u32 addr, u32 selector) |
130 | { | 130 | { |
131 | if (likely(in_own_cluster(addr))) | 131 | if (likely(in_own_cluster(addr))) |
132 | return tipc_local_nodes[tipc_node(addr)]; | 132 | return tipc_local_nodes[tipc_node(addr)]; |
133 | return tipc_node_select_next_hop(addr, selector); | 133 | return tipc_node_select_next_hop(addr, selector); |
134 | } | 134 | } |
135 | 135 | ||
136 | static inline void tipc_node_lock(struct node *n_ptr) | 136 | static inline void tipc_node_lock(struct tipc_node *n_ptr) |
137 | { | 137 | { |
138 | spin_lock_bh(&n_ptr->lock); | 138 | spin_lock_bh(&n_ptr->lock); |
139 | } | 139 | } |
140 | 140 | ||
141 | static inline void tipc_node_unlock(struct node *n_ptr) | 141 | static inline void tipc_node_unlock(struct tipc_node *n_ptr) |
142 | { | 142 | { |
143 | spin_unlock_bh(&n_ptr->lock); | 143 | spin_unlock_bh(&n_ptr->lock); |
144 | } | 144 | } |
diff --git a/net/tipc/node_subscr.c b/net/tipc/node_subscr.c index 8ecbd0fb6103..19194d476a9e 100644 --- a/net/tipc/node_subscr.c +++ b/net/tipc/node_subscr.c | |||
@@ -44,7 +44,7 @@ | |||
44 | * tipc_nodesub_subscribe - create "node down" subscription for specified node | 44 | * tipc_nodesub_subscribe - create "node down" subscription for specified node |
45 | */ | 45 | */ |
46 | 46 | ||
47 | void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr, | 47 | void tipc_nodesub_subscribe(struct tipc_node_subscr *node_sub, u32 addr, |
48 | void *usr_handle, net_ev_handler handle_down) | 48 | void *usr_handle, net_ev_handler handle_down) |
49 | { | 49 | { |
50 | if (addr == tipc_own_addr) { | 50 | if (addr == tipc_own_addr) { |
@@ -69,7 +69,7 @@ void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr, | |||
69 | * tipc_nodesub_unsubscribe - cancel "node down" subscription (if any) | 69 | * tipc_nodesub_unsubscribe - cancel "node down" subscription (if any) |
70 | */ | 70 | */ |
71 | 71 | ||
72 | void tipc_nodesub_unsubscribe(struct node_subscr *node_sub) | 72 | void tipc_nodesub_unsubscribe(struct tipc_node_subscr *node_sub) |
73 | { | 73 | { |
74 | if (!node_sub->node) | 74 | if (!node_sub->node) |
75 | return; | 75 | return; |
diff --git a/net/tipc/node_subscr.h b/net/tipc/node_subscr.h index 5f3f5859b84c..006ed739f515 100644 --- a/net/tipc/node_subscr.h +++ b/net/tipc/node_subscr.h | |||
@@ -42,22 +42,22 @@ | |||
42 | typedef void (*net_ev_handler) (void *usr_handle); | 42 | typedef void (*net_ev_handler) (void *usr_handle); |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * struct node_subscr - "node down" subscription entry | 45 | * struct tipc_node_subscr - "node down" subscription entry |
46 | * @node: ptr to node structure of interest (or NULL, if none) | 46 | * @node: ptr to node structure of interest (or NULL, if none) |
47 | * @handle_node_down: routine to invoke when node fails | 47 | * @handle_node_down: routine to invoke when node fails |
48 | * @usr_handle: argument to pass to routine when node fails | 48 | * @usr_handle: argument to pass to routine when node fails |
49 | * @nodesub_list: adjacent entries in list of subscriptions for the node | 49 | * @nodesub_list: adjacent entries in list of subscriptions for the node |
50 | */ | 50 | */ |
51 | 51 | ||
52 | struct node_subscr { | 52 | struct tipc_node_subscr { |
53 | struct node *node; | 53 | struct tipc_node *node; |
54 | net_ev_handler handle_node_down; | 54 | net_ev_handler handle_node_down; |
55 | void *usr_handle; | 55 | void *usr_handle; |
56 | struct list_head nodesub_list; | 56 | struct list_head nodesub_list; |
57 | }; | 57 | }; |
58 | 58 | ||
59 | void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr, | 59 | void tipc_nodesub_subscribe(struct tipc_node_subscr *node_sub, u32 addr, |
60 | void *usr_handle, net_ev_handler handle_down); | 60 | void *usr_handle, net_ev_handler handle_down); |
61 | void tipc_nodesub_unsubscribe(struct node_subscr *node_sub); | 61 | void tipc_nodesub_unsubscribe(struct tipc_node_subscr *node_sub); |
62 | 62 | ||
63 | #endif | 63 | #endif |
diff --git a/net/tipc/port.h b/net/tipc/port.h index e5f8c16429bd..ff31ee4a1dc3 100644 --- a/net/tipc/port.h +++ b/net/tipc/port.h | |||
@@ -105,7 +105,7 @@ struct port { | |||
105 | u32 probing_interval; | 105 | u32 probing_interval; |
106 | u32 last_in_seqno; | 106 | u32 last_in_seqno; |
107 | struct timer_list timer; | 107 | struct timer_list timer; |
108 | struct node_subscr subscription; | 108 | struct tipc_node_subscr subscription; |
109 | }; | 109 | }; |
110 | 110 | ||
111 | extern spinlock_t tipc_port_list_lock; | 111 | extern spinlock_t tipc_port_list_lock; |
diff --git a/net/tipc/zone.c b/net/tipc/zone.c index 3506f8563441..2c01ba2d86bf 100644 --- a/net/tipc/zone.c +++ b/net/tipc/zone.c | |||
@@ -111,10 +111,10 @@ void tipc_zone_send_external_routes(struct _zone *z_ptr, u32 dest) | |||
111 | } | 111 | } |
112 | } | 112 | } |
113 | 113 | ||
114 | struct node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref) | 114 | struct tipc_node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref) |
115 | { | 115 | { |
116 | struct cluster *c_ptr; | 116 | struct cluster *c_ptr; |
117 | struct node *n_ptr; | 117 | struct tipc_node *n_ptr; |
118 | u32 c_num; | 118 | u32 c_num; |
119 | 119 | ||
120 | if (!z_ptr) | 120 | if (!z_ptr) |
diff --git a/net/tipc/zone.h b/net/tipc/zone.h index 6e7a08df8af5..7bdc3406ba9b 100644 --- a/net/tipc/zone.h +++ b/net/tipc/zone.h | |||
@@ -54,7 +54,7 @@ struct _zone { | |||
54 | u32 links; | 54 | u32 links; |
55 | }; | 55 | }; |
56 | 56 | ||
57 | struct node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref); | 57 | struct tipc_node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref); |
58 | u32 tipc_zone_select_router(struct _zone *z_ptr, u32 addr, u32 ref); | 58 | u32 tipc_zone_select_router(struct _zone *z_ptr, u32 addr, u32 ref); |
59 | void tipc_zone_remove_as_router(struct _zone *z_ptr, u32 router); | 59 | void tipc_zone_remove_as_router(struct _zone *z_ptr, u32 router); |
60 | void tipc_zone_send_external_routes(struct _zone *z_ptr, u32 dest); | 60 | void tipc_zone_send_external_routes(struct _zone *z_ptr, u32 dest); |
diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig index ab015c62d561..833b024f8f66 100644 --- a/net/wireless/Kconfig +++ b/net/wireless/Kconfig | |||
@@ -39,4 +39,5 @@ config WIRELESS_EXT_SYSFS | |||
39 | files in /sys/class/net/*/wireless/. The same information | 39 | files in /sys/class/net/*/wireless/. The same information |
40 | is available via the ioctls as well. | 40 | is available via the ioctls as well. |
41 | 41 | ||
42 | Say Y if you have programs using it (we don't know of any). | 42 | Say Y if you have programs using it, like old versions of |
43 | hal. | ||
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 841b32a2e680..46914b79d850 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -1731,8 +1731,7 @@ restart: | |||
1731 | * We can't enlist stable bundles either. | 1731 | * We can't enlist stable bundles either. |
1732 | */ | 1732 | */ |
1733 | write_unlock_bh(&policy->lock); | 1733 | write_unlock_bh(&policy->lock); |
1734 | if (dst) | 1734 | dst_free(dst); |
1735 | dst_free(dst); | ||
1736 | 1735 | ||
1737 | if (pol_dead) | 1736 | if (pol_dead) |
1738 | XFRM_INC_STATS(LINUX_MIB_XFRMOUTPOLDEAD); | 1737 | XFRM_INC_STATS(LINUX_MIB_XFRMOUTPOLDEAD); |
@@ -1748,8 +1747,7 @@ restart: | |||
1748 | err = xfrm_dst_update_origin(dst, fl); | 1747 | err = xfrm_dst_update_origin(dst, fl); |
1749 | if (unlikely(err)) { | 1748 | if (unlikely(err)) { |
1750 | write_unlock_bh(&policy->lock); | 1749 | write_unlock_bh(&policy->lock); |
1751 | if (dst) | 1750 | dst_free(dst); |
1752 | dst_free(dst); | ||
1753 | XFRM_INC_STATS(LINUX_MIB_XFRMOUTBUNDLECHECKERROR); | 1751 | XFRM_INC_STATS(LINUX_MIB_XFRMOUTBUNDLECHECKERROR); |
1754 | goto error; | 1752 | goto error; |
1755 | } | 1753 | } |
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 4c6914ef7d92..7bd62f61593f 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -780,11 +780,13 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | |||
780 | { | 780 | { |
781 | unsigned int h; | 781 | unsigned int h; |
782 | struct hlist_node *entry; | 782 | struct hlist_node *entry; |
783 | struct xfrm_state *x, *x0; | 783 | struct xfrm_state *x, *x0, *to_put; |
784 | int acquire_in_progress = 0; | 784 | int acquire_in_progress = 0; |
785 | int error = 0; | 785 | int error = 0; |
786 | struct xfrm_state *best = NULL; | 786 | struct xfrm_state *best = NULL; |
787 | 787 | ||
788 | to_put = NULL; | ||
789 | |||
788 | spin_lock_bh(&xfrm_state_lock); | 790 | spin_lock_bh(&xfrm_state_lock); |
789 | h = xfrm_dst_hash(daddr, saddr, tmpl->reqid, family); | 791 | h = xfrm_dst_hash(daddr, saddr, tmpl->reqid, family); |
790 | hlist_for_each_entry(x, entry, xfrm_state_bydst+h, bydst) { | 792 | hlist_for_each_entry(x, entry, xfrm_state_bydst+h, bydst) { |
@@ -833,7 +835,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | |||
833 | if (tmpl->id.spi && | 835 | if (tmpl->id.spi && |
834 | (x0 = __xfrm_state_lookup(daddr, tmpl->id.spi, | 836 | (x0 = __xfrm_state_lookup(daddr, tmpl->id.spi, |
835 | tmpl->id.proto, family)) != NULL) { | 837 | tmpl->id.proto, family)) != NULL) { |
836 | xfrm_state_put(x0); | 838 | to_put = x0; |
837 | error = -EEXIST; | 839 | error = -EEXIST; |
838 | goto out; | 840 | goto out; |
839 | } | 841 | } |
@@ -849,7 +851,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | |||
849 | error = security_xfrm_state_alloc_acquire(x, pol->security, fl->secid); | 851 | error = security_xfrm_state_alloc_acquire(x, pol->security, fl->secid); |
850 | if (error) { | 852 | if (error) { |
851 | x->km.state = XFRM_STATE_DEAD; | 853 | x->km.state = XFRM_STATE_DEAD; |
852 | xfrm_state_put(x); | 854 | to_put = x; |
853 | x = NULL; | 855 | x = NULL; |
854 | goto out; | 856 | goto out; |
855 | } | 857 | } |
@@ -870,7 +872,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | |||
870 | xfrm_hash_grow_check(x->bydst.next != NULL); | 872 | xfrm_hash_grow_check(x->bydst.next != NULL); |
871 | } else { | 873 | } else { |
872 | x->km.state = XFRM_STATE_DEAD; | 874 | x->km.state = XFRM_STATE_DEAD; |
873 | xfrm_state_put(x); | 875 | to_put = x; |
874 | x = NULL; | 876 | x = NULL; |
875 | error = -ESRCH; | 877 | error = -ESRCH; |
876 | } | 878 | } |
@@ -881,6 +883,8 @@ out: | |||
881 | else | 883 | else |
882 | *err = acquire_in_progress ? -EAGAIN : error; | 884 | *err = acquire_in_progress ? -EAGAIN : error; |
883 | spin_unlock_bh(&xfrm_state_lock); | 885 | spin_unlock_bh(&xfrm_state_lock); |
886 | if (to_put) | ||
887 | xfrm_state_put(to_put); | ||
884 | return x; | 888 | return x; |
885 | } | 889 | } |
886 | 890 | ||
@@ -1067,18 +1071,20 @@ static struct xfrm_state *__xfrm_find_acq_byseq(u32 seq); | |||
1067 | 1071 | ||
1068 | int xfrm_state_add(struct xfrm_state *x) | 1072 | int xfrm_state_add(struct xfrm_state *x) |
1069 | { | 1073 | { |
1070 | struct xfrm_state *x1; | 1074 | struct xfrm_state *x1, *to_put; |
1071 | int family; | 1075 | int family; |
1072 | int err; | 1076 | int err; |
1073 | int use_spi = xfrm_id_proto_match(x->id.proto, IPSEC_PROTO_ANY); | 1077 | int use_spi = xfrm_id_proto_match(x->id.proto, IPSEC_PROTO_ANY); |
1074 | 1078 | ||
1075 | family = x->props.family; | 1079 | family = x->props.family; |
1076 | 1080 | ||
1081 | to_put = NULL; | ||
1082 | |||
1077 | spin_lock_bh(&xfrm_state_lock); | 1083 | spin_lock_bh(&xfrm_state_lock); |
1078 | 1084 | ||
1079 | x1 = __xfrm_state_locate(x, use_spi, family); | 1085 | x1 = __xfrm_state_locate(x, use_spi, family); |
1080 | if (x1) { | 1086 | if (x1) { |
1081 | xfrm_state_put(x1); | 1087 | to_put = x1; |
1082 | x1 = NULL; | 1088 | x1 = NULL; |
1083 | err = -EEXIST; | 1089 | err = -EEXIST; |
1084 | goto out; | 1090 | goto out; |
@@ -1088,7 +1094,7 @@ int xfrm_state_add(struct xfrm_state *x) | |||
1088 | x1 = __xfrm_find_acq_byseq(x->km.seq); | 1094 | x1 = __xfrm_find_acq_byseq(x->km.seq); |
1089 | if (x1 && ((x1->id.proto != x->id.proto) || | 1095 | if (x1 && ((x1->id.proto != x->id.proto) || |
1090 | xfrm_addr_cmp(&x1->id.daddr, &x->id.daddr, family))) { | 1096 | xfrm_addr_cmp(&x1->id.daddr, &x->id.daddr, family))) { |
1091 | xfrm_state_put(x1); | 1097 | to_put = x1; |
1092 | x1 = NULL; | 1098 | x1 = NULL; |
1093 | } | 1099 | } |
1094 | } | 1100 | } |
@@ -1110,6 +1116,9 @@ out: | |||
1110 | xfrm_state_put(x1); | 1116 | xfrm_state_put(x1); |
1111 | } | 1117 | } |
1112 | 1118 | ||
1119 | if (to_put) | ||
1120 | xfrm_state_put(to_put); | ||
1121 | |||
1113 | return err; | 1122 | return err; |
1114 | } | 1123 | } |
1115 | EXPORT_SYMBOL(xfrm_state_add); | 1124 | EXPORT_SYMBOL(xfrm_state_add); |
@@ -1269,10 +1278,12 @@ EXPORT_SYMBOL(xfrm_state_migrate); | |||
1269 | 1278 | ||
1270 | int xfrm_state_update(struct xfrm_state *x) | 1279 | int xfrm_state_update(struct xfrm_state *x) |
1271 | { | 1280 | { |
1272 | struct xfrm_state *x1; | 1281 | struct xfrm_state *x1, *to_put; |
1273 | int err; | 1282 | int err; |
1274 | int use_spi = xfrm_id_proto_match(x->id.proto, IPSEC_PROTO_ANY); | 1283 | int use_spi = xfrm_id_proto_match(x->id.proto, IPSEC_PROTO_ANY); |
1275 | 1284 | ||
1285 | to_put = NULL; | ||
1286 | |||
1276 | spin_lock_bh(&xfrm_state_lock); | 1287 | spin_lock_bh(&xfrm_state_lock); |
1277 | x1 = __xfrm_state_locate(x, use_spi, x->props.family); | 1288 | x1 = __xfrm_state_locate(x, use_spi, x->props.family); |
1278 | 1289 | ||
@@ -1281,7 +1292,7 @@ int xfrm_state_update(struct xfrm_state *x) | |||
1281 | goto out; | 1292 | goto out; |
1282 | 1293 | ||
1283 | if (xfrm_state_kern(x1)) { | 1294 | if (xfrm_state_kern(x1)) { |
1284 | xfrm_state_put(x1); | 1295 | to_put = x1; |
1285 | err = -EEXIST; | 1296 | err = -EEXIST; |
1286 | goto out; | 1297 | goto out; |
1287 | } | 1298 | } |
@@ -1295,6 +1306,9 @@ int xfrm_state_update(struct xfrm_state *x) | |||
1295 | out: | 1306 | out: |
1296 | spin_unlock_bh(&xfrm_state_lock); | 1307 | spin_unlock_bh(&xfrm_state_lock); |
1297 | 1308 | ||
1309 | if (to_put) | ||
1310 | xfrm_state_put(to_put); | ||
1311 | |||
1298 | if (err) | 1312 | if (err) |
1299 | return err; | 1313 | return err; |
1300 | 1314 | ||