diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-10-15 11:20:54 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-10-15 11:20:54 -0400 |
commit | df9b42963f2d010ae3163a894ce22cf6b27cd344 (patch) | |
tree | f42f826d9bb975766c1a79986c39e64c9a900908 /net/tipc | |
parent | 33766368f6532313571534f9112b1796d6651bbe (diff) | |
parent | c3e7724b6bc2f25e46c38dbe68f09d71fafeafb8 (diff) |
Merge remote-tracking branch 'wireless/master' into mac80211
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/bearer.c | 21 | ||||
-rw-r--r-- | net/tipc/config.c | 48 | ||||
-rw-r--r-- | net/tipc/core.c | 22 | ||||
-rw-r--r-- | net/tipc/core.h | 18 | ||||
-rw-r--r-- | net/tipc/eth_media.c | 29 | ||||
-rw-r--r-- | net/tipc/handler.c | 2 | ||||
-rw-r--r-- | net/tipc/link.c | 4 | ||||
-rw-r--r-- | net/tipc/name_table.c | 16 | ||||
-rw-r--r-- | net/tipc/net.c | 3 | ||||
-rw-r--r-- | net/tipc/net.h | 2 | ||||
-rw-r--r-- | net/tipc/netlink.c | 2 | ||||
-rw-r--r-- | net/tipc/socket.c | 1 | ||||
-rw-r--r-- | net/tipc/subscr.c | 4 |
13 files changed, 63 insertions, 109 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 09e71241265d..4ec5c80e8a7c 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c | |||
@@ -49,21 +49,6 @@ struct tipc_bearer tipc_bearers[MAX_BEARERS]; | |||
49 | static void bearer_disable(struct tipc_bearer *b_ptr); | 49 | static void bearer_disable(struct tipc_bearer *b_ptr); |
50 | 50 | ||
51 | /** | 51 | /** |
52 | * media_name_valid - validate media name | ||
53 | * | ||
54 | * Returns 1 if media name is valid, otherwise 0. | ||
55 | */ | ||
56 | static int media_name_valid(const char *name) | ||
57 | { | ||
58 | u32 len; | ||
59 | |||
60 | len = strlen(name); | ||
61 | if ((len + 1) > TIPC_MAX_MEDIA_NAME) | ||
62 | return 0; | ||
63 | return strspn(name, tipc_alphabet) == len; | ||
64 | } | ||
65 | |||
66 | /** | ||
67 | * tipc_media_find - locates specified media object by name | 52 | * tipc_media_find - locates specified media object by name |
68 | */ | 53 | */ |
69 | struct tipc_media *tipc_media_find(const char *name) | 54 | struct tipc_media *tipc_media_find(const char *name) |
@@ -102,7 +87,7 @@ int tipc_register_media(struct tipc_media *m_ptr) | |||
102 | 87 | ||
103 | write_lock_bh(&tipc_net_lock); | 88 | write_lock_bh(&tipc_net_lock); |
104 | 89 | ||
105 | if (!media_name_valid(m_ptr->name)) | 90 | if ((strlen(m_ptr->name) + 1) > TIPC_MAX_MEDIA_NAME) |
106 | goto exit; | 91 | goto exit; |
107 | if ((m_ptr->bcast_addr.media_id != m_ptr->type_id) || | 92 | if ((m_ptr->bcast_addr.media_id != m_ptr->type_id) || |
108 | !m_ptr->bcast_addr.broadcast) | 93 | !m_ptr->bcast_addr.broadcast) |
@@ -206,9 +191,7 @@ static int bearer_name_validate(const char *name, | |||
206 | 191 | ||
207 | /* validate component parts of bearer name */ | 192 | /* validate component parts of bearer name */ |
208 | if ((media_len <= 1) || (media_len > TIPC_MAX_MEDIA_NAME) || | 193 | if ((media_len <= 1) || (media_len > TIPC_MAX_MEDIA_NAME) || |
209 | (if_len <= 1) || (if_len > TIPC_MAX_IF_NAME) || | 194 | (if_len <= 1) || (if_len > TIPC_MAX_IF_NAME)) |
210 | (strspn(media_name, tipc_alphabet) != (media_len - 1)) || | ||
211 | (strspn(if_name, tipc_alphabet) != (if_len - 1))) | ||
212 | return 0; | 195 | return 0; |
213 | 196 | ||
214 | /* return bearer name components, if necessary */ | 197 | /* return bearer name components, if necessary */ |
diff --git a/net/tipc/config.c b/net/tipc/config.c index a056a3852f71..f67866c765dd 100644 --- a/net/tipc/config.c +++ b/net/tipc/config.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * net/tipc/config.c: TIPC configuration management code | 2 | * net/tipc/config.c: TIPC configuration management code |
3 | * | 3 | * |
4 | * Copyright (c) 2002-2006, Ericsson AB | 4 | * Copyright (c) 2002-2006, Ericsson AB |
5 | * Copyright (c) 2004-2007, 2010-2011, Wind River Systems | 5 | * Copyright (c) 2004-2007, 2010-2012, Wind River Systems |
6 | * All rights reserved. | 6 | * All rights reserved. |
7 | * | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without |
@@ -208,36 +208,6 @@ static struct sk_buff *cfg_set_remote_mng(void) | |||
208 | return tipc_cfg_reply_none(); | 208 | return tipc_cfg_reply_none(); |
209 | } | 209 | } |
210 | 210 | ||
211 | static struct sk_buff *cfg_set_max_publications(void) | ||
212 | { | ||
213 | u32 value; | ||
214 | |||
215 | if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED)) | ||
216 | return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); | ||
217 | |||
218 | value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area)); | ||
219 | if (value < 1 || value > 65535) | ||
220 | return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE | ||
221 | " (max publications must be 1-65535)"); | ||
222 | tipc_max_publications = value; | ||
223 | return tipc_cfg_reply_none(); | ||
224 | } | ||
225 | |||
226 | static struct sk_buff *cfg_set_max_subscriptions(void) | ||
227 | { | ||
228 | u32 value; | ||
229 | |||
230 | if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED)) | ||
231 | return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); | ||
232 | |||
233 | value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area)); | ||
234 | if (value < 1 || value > 65535) | ||
235 | return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE | ||
236 | " (max subscriptions must be 1-65535"); | ||
237 | tipc_max_subscriptions = value; | ||
238 | return tipc_cfg_reply_none(); | ||
239 | } | ||
240 | |||
241 | static struct sk_buff *cfg_set_max_ports(void) | 211 | static struct sk_buff *cfg_set_max_ports(void) |
242 | { | 212 | { |
243 | u32 value; | 213 | u32 value; |
@@ -357,12 +327,6 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area | |||
357 | case TIPC_CMD_SET_MAX_PORTS: | 327 | case TIPC_CMD_SET_MAX_PORTS: |
358 | rep_tlv_buf = cfg_set_max_ports(); | 328 | rep_tlv_buf = cfg_set_max_ports(); |
359 | break; | 329 | break; |
360 | case TIPC_CMD_SET_MAX_PUBL: | ||
361 | rep_tlv_buf = cfg_set_max_publications(); | ||
362 | break; | ||
363 | case TIPC_CMD_SET_MAX_SUBSCR: | ||
364 | rep_tlv_buf = cfg_set_max_subscriptions(); | ||
365 | break; | ||
366 | case TIPC_CMD_SET_NETID: | 330 | case TIPC_CMD_SET_NETID: |
367 | rep_tlv_buf = cfg_set_netid(); | 331 | rep_tlv_buf = cfg_set_netid(); |
368 | break; | 332 | break; |
@@ -372,12 +336,6 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area | |||
372 | case TIPC_CMD_GET_MAX_PORTS: | 336 | case TIPC_CMD_GET_MAX_PORTS: |
373 | rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_ports); | 337 | rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_ports); |
374 | break; | 338 | break; |
375 | case TIPC_CMD_GET_MAX_PUBL: | ||
376 | rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_publications); | ||
377 | break; | ||
378 | case TIPC_CMD_GET_MAX_SUBSCR: | ||
379 | rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_subscriptions); | ||
380 | break; | ||
381 | case TIPC_CMD_GET_NETID: | 339 | case TIPC_CMD_GET_NETID: |
382 | rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_net_id); | 340 | rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_net_id); |
383 | break; | 341 | break; |
@@ -393,6 +351,10 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area | |||
393 | case TIPC_CMD_GET_MAX_CLUSTERS: | 351 | case TIPC_CMD_GET_MAX_CLUSTERS: |
394 | case TIPC_CMD_SET_MAX_NODES: | 352 | case TIPC_CMD_SET_MAX_NODES: |
395 | case TIPC_CMD_GET_MAX_NODES: | 353 | case TIPC_CMD_GET_MAX_NODES: |
354 | case TIPC_CMD_SET_MAX_SUBSCR: | ||
355 | case TIPC_CMD_GET_MAX_SUBSCR: | ||
356 | case TIPC_CMD_SET_MAX_PUBL: | ||
357 | case TIPC_CMD_GET_MAX_PUBL: | ||
396 | case TIPC_CMD_SET_LOG_SIZE: | 358 | case TIPC_CMD_SET_LOG_SIZE: |
397 | case TIPC_CMD_DUMP_LOG: | 359 | case TIPC_CMD_DUMP_LOG: |
398 | rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED | 360 | rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED |
diff --git a/net/tipc/core.c b/net/tipc/core.c index 6586eac6a50e..bfe8af88469a 100644 --- a/net/tipc/core.c +++ b/net/tipc/core.c | |||
@@ -48,18 +48,13 @@ | |||
48 | 48 | ||
49 | 49 | ||
50 | /* global variables used by multiple sub-systems within TIPC */ | 50 | /* global variables used by multiple sub-systems within TIPC */ |
51 | int tipc_random; | 51 | int tipc_random __read_mostly; |
52 | |||
53 | const char tipc_alphabet[] = | ||
54 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_."; | ||
55 | 52 | ||
56 | /* configurable TIPC parameters */ | 53 | /* configurable TIPC parameters */ |
57 | u32 tipc_own_addr; | 54 | u32 tipc_own_addr __read_mostly; |
58 | int tipc_max_ports; | 55 | int tipc_max_ports __read_mostly; |
59 | int tipc_max_subscriptions; | 56 | int tipc_net_id __read_mostly; |
60 | int tipc_max_publications; | 57 | int tipc_remote_management __read_mostly; |
61 | int tipc_net_id; | ||
62 | int tipc_remote_management; | ||
63 | 58 | ||
64 | 59 | ||
65 | /** | 60 | /** |
@@ -101,9 +96,8 @@ int tipc_core_start_net(unsigned long addr) | |||
101 | { | 96 | { |
102 | int res; | 97 | int res; |
103 | 98 | ||
104 | res = tipc_net_start(addr); | 99 | tipc_net_start(addr); |
105 | if (!res) | 100 | res = tipc_eth_media_start(); |
106 | res = tipc_eth_media_start(); | ||
107 | if (res) | 101 | if (res) |
108 | tipc_core_stop_net(); | 102 | tipc_core_stop_net(); |
109 | return res; | 103 | return res; |
@@ -160,8 +154,6 @@ static int __init tipc_init(void) | |||
160 | 154 | ||
161 | tipc_own_addr = 0; | 155 | tipc_own_addr = 0; |
162 | tipc_remote_management = 1; | 156 | tipc_remote_management = 1; |
163 | tipc_max_publications = 10000; | ||
164 | tipc_max_subscriptions = 2000; | ||
165 | tipc_max_ports = CONFIG_TIPC_PORTS; | 157 | tipc_max_ports = CONFIG_TIPC_PORTS; |
166 | tipc_net_id = 4711; | 158 | tipc_net_id = 4711; |
167 | 159 | ||
diff --git a/net/tipc/core.h b/net/tipc/core.h index fd42e106c185..0207db04179a 100644 --- a/net/tipc/core.h +++ b/net/tipc/core.h | |||
@@ -60,7 +60,9 @@ | |||
60 | 60 | ||
61 | #define TIPC_MOD_VER "2.0.0" | 61 | #define TIPC_MOD_VER "2.0.0" |
62 | 62 | ||
63 | #define ULTRA_STRING_MAX_LEN 32768 | 63 | #define ULTRA_STRING_MAX_LEN 32768 |
64 | #define TIPC_MAX_SUBSCRIPTIONS 65535 | ||
65 | #define TIPC_MAX_PUBLICATIONS 65535 | ||
64 | 66 | ||
65 | struct tipc_msg; /* msg.h */ | 67 | struct tipc_msg; /* msg.h */ |
66 | 68 | ||
@@ -74,19 +76,15 @@ int tipc_snprintf(char *buf, int len, const char *fmt, ...); | |||
74 | /* | 76 | /* |
75 | * Global configuration variables | 77 | * Global configuration variables |
76 | */ | 78 | */ |
77 | extern u32 tipc_own_addr; | 79 | extern u32 tipc_own_addr __read_mostly; |
78 | extern int tipc_max_ports; | 80 | extern int tipc_max_ports __read_mostly; |
79 | extern int tipc_max_subscriptions; | 81 | extern int tipc_net_id __read_mostly; |
80 | extern int tipc_max_publications; | 82 | extern int tipc_remote_management __read_mostly; |
81 | extern int tipc_net_id; | ||
82 | extern int tipc_remote_management; | ||
83 | 83 | ||
84 | /* | 84 | /* |
85 | * Other global variables | 85 | * Other global variables |
86 | */ | 86 | */ |
87 | extern int tipc_random; | 87 | extern int tipc_random __read_mostly; |
88 | extern const char tipc_alphabet[]; | ||
89 | |||
90 | 88 | ||
91 | /* | 89 | /* |
92 | * Routines available to privileged subsystems | 90 | * Routines available to privileged subsystems |
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c index 90ac9bfa7abb..2132c1ef2951 100644 --- a/net/tipc/eth_media.c +++ b/net/tipc/eth_media.c | |||
@@ -46,19 +46,30 @@ | |||
46 | * @bearer: ptr to associated "generic" bearer structure | 46 | * @bearer: ptr to associated "generic" bearer structure |
47 | * @dev: ptr to associated Ethernet network device | 47 | * @dev: ptr to associated Ethernet network device |
48 | * @tipc_packet_type: used in binding TIPC to Ethernet driver | 48 | * @tipc_packet_type: used in binding TIPC to Ethernet driver |
49 | * @setup: work item used when enabling bearer | ||
49 | * @cleanup: work item used when disabling bearer | 50 | * @cleanup: work item used when disabling bearer |
50 | */ | 51 | */ |
51 | struct eth_bearer { | 52 | struct eth_bearer { |
52 | struct tipc_bearer *bearer; | 53 | struct tipc_bearer *bearer; |
53 | struct net_device *dev; | 54 | struct net_device *dev; |
54 | struct packet_type tipc_packet_type; | 55 | struct packet_type tipc_packet_type; |
56 | struct work_struct setup; | ||
55 | struct work_struct cleanup; | 57 | struct work_struct cleanup; |
56 | }; | 58 | }; |
57 | 59 | ||
58 | static struct tipc_media eth_media_info; | 60 | static struct tipc_media eth_media_info; |
59 | static struct eth_bearer eth_bearers[MAX_ETH_BEARERS]; | 61 | static struct eth_bearer eth_bearers[MAX_ETH_BEARERS]; |
60 | static int eth_started; | 62 | static int eth_started; |
61 | static struct notifier_block notifier; | 63 | |
64 | static int recv_notification(struct notifier_block *nb, unsigned long evt, | ||
65 | void *dv); | ||
66 | /* | ||
67 | * Network device notifier info | ||
68 | */ | ||
69 | static struct notifier_block notifier = { | ||
70 | .notifier_call = recv_notification, | ||
71 | .priority = 0 | ||
72 | }; | ||
62 | 73 | ||
63 | /** | 74 | /** |
64 | * eth_media_addr_set - initialize Ethernet media address structure | 75 | * eth_media_addr_set - initialize Ethernet media address structure |
@@ -134,6 +145,17 @@ static int recv_msg(struct sk_buff *buf, struct net_device *dev, | |||
134 | } | 145 | } |
135 | 146 | ||
136 | /** | 147 | /** |
148 | * setup_bearer - setup association between Ethernet bearer and interface | ||
149 | */ | ||
150 | static void setup_bearer(struct work_struct *work) | ||
151 | { | ||
152 | struct eth_bearer *eb_ptr = | ||
153 | container_of(work, struct eth_bearer, setup); | ||
154 | |||
155 | dev_add_pack(&eb_ptr->tipc_packet_type); | ||
156 | } | ||
157 | |||
158 | /** | ||
137 | * enable_bearer - attach TIPC bearer to an Ethernet interface | 159 | * enable_bearer - attach TIPC bearer to an Ethernet interface |
138 | */ | 160 | */ |
139 | static int enable_bearer(struct tipc_bearer *tb_ptr) | 161 | static int enable_bearer(struct tipc_bearer *tb_ptr) |
@@ -173,7 +195,8 @@ static int enable_bearer(struct tipc_bearer *tb_ptr) | |||
173 | eb_ptr->tipc_packet_type.func = recv_msg; | 195 | eb_ptr->tipc_packet_type.func = recv_msg; |
174 | eb_ptr->tipc_packet_type.af_packet_priv = eb_ptr; | 196 | eb_ptr->tipc_packet_type.af_packet_priv = eb_ptr; |
175 | INIT_LIST_HEAD(&(eb_ptr->tipc_packet_type.list)); | 197 | INIT_LIST_HEAD(&(eb_ptr->tipc_packet_type.list)); |
176 | dev_add_pack(&eb_ptr->tipc_packet_type); | 198 | INIT_WORK(&eb_ptr->setup, setup_bearer); |
199 | schedule_work(&eb_ptr->setup); | ||
177 | 200 | ||
178 | /* Associate TIPC bearer with Ethernet bearer */ | 201 | /* Associate TIPC bearer with Ethernet bearer */ |
179 | eb_ptr->bearer = tb_ptr; | 202 | eb_ptr->bearer = tb_ptr; |
@@ -357,8 +380,6 @@ int tipc_eth_media_start(void) | |||
357 | if (res) | 380 | if (res) |
358 | return res; | 381 | return res; |
359 | 382 | ||
360 | notifier.notifier_call = &recv_notification; | ||
361 | notifier.priority = 0; | ||
362 | res = register_netdevice_notifier(¬ifier); | 383 | res = register_netdevice_notifier(¬ifier); |
363 | if (!res) | 384 | if (!res) |
364 | eth_started = 1; | 385 | eth_started = 1; |
diff --git a/net/tipc/handler.c b/net/tipc/handler.c index 7a52d3922f3c..111ff8300ae5 100644 --- a/net/tipc/handler.c +++ b/net/tipc/handler.c | |||
@@ -45,7 +45,7 @@ struct queue_item { | |||
45 | static struct kmem_cache *tipc_queue_item_cache; | 45 | static struct kmem_cache *tipc_queue_item_cache; |
46 | static struct list_head signal_queue_head; | 46 | static struct list_head signal_queue_head; |
47 | static DEFINE_SPINLOCK(qitem_lock); | 47 | static DEFINE_SPINLOCK(qitem_lock); |
48 | static int handler_enabled; | 48 | static int handler_enabled __read_mostly; |
49 | 49 | ||
50 | static void process_signal_queue(unsigned long dummy); | 50 | static void process_signal_queue(unsigned long dummy); |
51 | 51 | ||
diff --git a/net/tipc/link.c b/net/tipc/link.c index 1c1e6151875e..a79c755cb417 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -210,9 +210,7 @@ static int link_name_validate(const char *name, | |||
210 | (z_local > 255) || (c_local > 4095) || (n_local > 4095) || | 210 | (z_local > 255) || (c_local > 4095) || (n_local > 4095) || |
211 | (z_peer > 255) || (c_peer > 4095) || (n_peer > 4095) || | 211 | (z_peer > 255) || (c_peer > 4095) || (n_peer > 4095) || |
212 | (if_local_len <= 1) || (if_local_len > TIPC_MAX_IF_NAME) || | 212 | (if_local_len <= 1) || (if_local_len > TIPC_MAX_IF_NAME) || |
213 | (if_peer_len <= 1) || (if_peer_len > TIPC_MAX_IF_NAME) || | 213 | (if_peer_len <= 1) || (if_peer_len > TIPC_MAX_IF_NAME)) |
214 | (strspn(if_local, tipc_alphabet) != (if_local_len - 1)) || | ||
215 | (strspn(if_peer, tipc_alphabet) != (if_peer_len - 1))) | ||
216 | return 0; | 214 | return 0; |
217 | 215 | ||
218 | /* return link name components, if necessary */ | 216 | /* return link name components, if necessary */ |
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c index 360c478b0b53..46754779fd3d 100644 --- a/net/tipc/name_table.c +++ b/net/tipc/name_table.c | |||
@@ -41,7 +41,7 @@ | |||
41 | #include "subscr.h" | 41 | #include "subscr.h" |
42 | #include "port.h" | 42 | #include "port.h" |
43 | 43 | ||
44 | static int tipc_nametbl_size = 1024; /* must be a power of 2 */ | 44 | #define TIPC_NAMETBL_SIZE 1024 /* must be a power of 2 */ |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * struct name_info - name sequence publication info | 47 | * struct name_info - name sequence publication info |
@@ -114,7 +114,7 @@ DEFINE_RWLOCK(tipc_nametbl_lock); | |||
114 | 114 | ||
115 | static int hash(int x) | 115 | static int hash(int x) |
116 | { | 116 | { |
117 | return x & (tipc_nametbl_size - 1); | 117 | return x & (TIPC_NAMETBL_SIZE - 1); |
118 | } | 118 | } |
119 | 119 | ||
120 | /** | 120 | /** |
@@ -667,9 +667,9 @@ struct publication *tipc_nametbl_publish(u32 type, u32 lower, u32 upper, | |||
667 | { | 667 | { |
668 | struct publication *publ; | 668 | struct publication *publ; |
669 | 669 | ||
670 | if (table.local_publ_count >= tipc_max_publications) { | 670 | if (table.local_publ_count >= TIPC_MAX_PUBLICATIONS) { |
671 | pr_warn("Publication failed, local publication limit reached (%u)\n", | 671 | pr_warn("Publication failed, local publication limit reached (%u)\n", |
672 | tipc_max_publications); | 672 | TIPC_MAX_PUBLICATIONS); |
673 | return NULL; | 673 | return NULL; |
674 | } | 674 | } |
675 | 675 | ||
@@ -783,7 +783,7 @@ static int subseq_list(struct sub_seq *sseq, char *buf, int len, u32 depth, | |||
783 | if (!list_is_last(&publ->zone_list, &info->zone_list)) | 783 | if (!list_is_last(&publ->zone_list, &info->zone_list)) |
784 | ret += tipc_snprintf(buf + ret, len - ret, | 784 | ret += tipc_snprintf(buf + ret, len - ret, |
785 | "\n%33s", " "); | 785 | "\n%33s", " "); |
786 | }; | 786 | } |
787 | 787 | ||
788 | ret += tipc_snprintf(buf + ret, len - ret, "\n"); | 788 | ret += tipc_snprintf(buf + ret, len - ret, "\n"); |
789 | return ret; | 789 | return ret; |
@@ -871,7 +871,7 @@ static int nametbl_list(char *buf, int len, u32 depth_info, | |||
871 | ret += nametbl_header(buf, len, depth); | 871 | ret += nametbl_header(buf, len, depth); |
872 | lowbound = 0; | 872 | lowbound = 0; |
873 | upbound = ~0; | 873 | upbound = ~0; |
874 | for (i = 0; i < tipc_nametbl_size; i++) { | 874 | for (i = 0; i < TIPC_NAMETBL_SIZE; i++) { |
875 | seq_head = &table.types[i]; | 875 | seq_head = &table.types[i]; |
876 | hlist_for_each_entry(seq, seq_node, seq_head, ns_list) { | 876 | hlist_for_each_entry(seq, seq_node, seq_head, ns_list) { |
877 | ret += nameseq_list(seq, buf + ret, len - ret, | 877 | ret += nameseq_list(seq, buf + ret, len - ret, |
@@ -935,7 +935,7 @@ struct sk_buff *tipc_nametbl_get(const void *req_tlv_area, int req_tlv_space) | |||
935 | 935 | ||
936 | int tipc_nametbl_init(void) | 936 | int tipc_nametbl_init(void) |
937 | { | 937 | { |
938 | table.types = kcalloc(tipc_nametbl_size, sizeof(struct hlist_head), | 938 | table.types = kcalloc(TIPC_NAMETBL_SIZE, sizeof(struct hlist_head), |
939 | GFP_ATOMIC); | 939 | GFP_ATOMIC); |
940 | if (!table.types) | 940 | if (!table.types) |
941 | return -ENOMEM; | 941 | return -ENOMEM; |
@@ -953,7 +953,7 @@ void tipc_nametbl_stop(void) | |||
953 | 953 | ||
954 | /* Verify name table is empty, then release it */ | 954 | /* Verify name table is empty, then release it */ |
955 | write_lock_bh(&tipc_nametbl_lock); | 955 | write_lock_bh(&tipc_nametbl_lock); |
956 | for (i = 0; i < tipc_nametbl_size; i++) { | 956 | for (i = 0; i < TIPC_NAMETBL_SIZE; i++) { |
957 | if (hlist_empty(&table.types[i])) | 957 | if (hlist_empty(&table.types[i])) |
958 | continue; | 958 | continue; |
959 | pr_err("nametbl_stop(): orphaned hash chain detected\n"); | 959 | pr_err("nametbl_stop(): orphaned hash chain detected\n"); |
diff --git a/net/tipc/net.c b/net/tipc/net.c index 5b5cea259caf..7d305ecc09c2 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c | |||
@@ -171,7 +171,7 @@ void tipc_net_route_msg(struct sk_buff *buf) | |||
171 | tipc_link_send(buf, dnode, msg_link_selector(msg)); | 171 | tipc_link_send(buf, dnode, msg_link_selector(msg)); |
172 | } | 172 | } |
173 | 173 | ||
174 | int tipc_net_start(u32 addr) | 174 | void tipc_net_start(u32 addr) |
175 | { | 175 | { |
176 | char addr_string[16]; | 176 | char addr_string[16]; |
177 | 177 | ||
@@ -187,7 +187,6 @@ int tipc_net_start(u32 addr) | |||
187 | pr_info("Started in network mode\n"); | 187 | pr_info("Started in network mode\n"); |
188 | pr_info("Own node address %s, network identity %u\n", | 188 | pr_info("Own node address %s, network identity %u\n", |
189 | tipc_addr_string_fill(addr_string, tipc_own_addr), tipc_net_id); | 189 | tipc_addr_string_fill(addr_string, tipc_own_addr), tipc_net_id); |
190 | return 0; | ||
191 | } | 190 | } |
192 | 191 | ||
193 | void tipc_net_stop(void) | 192 | void tipc_net_stop(void) |
diff --git a/net/tipc/net.h b/net/tipc/net.h index 9eb4b9e220eb..079daadb3f72 100644 --- a/net/tipc/net.h +++ b/net/tipc/net.h | |||
@@ -41,7 +41,7 @@ extern rwlock_t tipc_net_lock; | |||
41 | 41 | ||
42 | void tipc_net_route_msg(struct sk_buff *buf); | 42 | void tipc_net_route_msg(struct sk_buff *buf); |
43 | 43 | ||
44 | int tipc_net_start(u32 addr); | 44 | void tipc_net_start(u32 addr); |
45 | void tipc_net_stop(void); | 45 | void tipc_net_stop(void); |
46 | 46 | ||
47 | #endif | 47 | #endif |
diff --git a/net/tipc/netlink.c b/net/tipc/netlink.c index 47a839df27dc..6675914dc592 100644 --- a/net/tipc/netlink.c +++ b/net/tipc/netlink.c | |||
@@ -62,7 +62,7 @@ static int handle_cmd(struct sk_buff *skb, struct genl_info *info) | |||
62 | rep_nlh = nlmsg_hdr(rep_buf); | 62 | rep_nlh = nlmsg_hdr(rep_buf); |
63 | memcpy(rep_nlh, req_nlh, hdr_space); | 63 | memcpy(rep_nlh, req_nlh, hdr_space); |
64 | rep_nlh->nlmsg_len = rep_buf->len; | 64 | rep_nlh->nlmsg_len = rep_buf->len; |
65 | genlmsg_unicast(&init_net, rep_buf, NETLINK_CB(skb).pid); | 65 | genlmsg_unicast(&init_net, rep_buf, NETLINK_CB(skb).portid); |
66 | } | 66 | } |
67 | 67 | ||
68 | return 0; | 68 | return 0; |
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 09dc5b97e079..fd5f042dbff4 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -220,6 +220,7 @@ static int tipc_create(struct net *net, struct socket *sock, int protocol, | |||
220 | 220 | ||
221 | sock_init_data(sock, sk); | 221 | sock_init_data(sock, sk); |
222 | sk->sk_backlog_rcv = backlog_rcv; | 222 | sk->sk_backlog_rcv = backlog_rcv; |
223 | sk->sk_rcvbuf = TIPC_FLOW_CONTROL_WIN * 2 * TIPC_MAX_USER_MSG_SIZE * 2; | ||
223 | tipc_sk(sk)->p = tp_ptr; | 224 | tipc_sk(sk)->p = tp_ptr; |
224 | tipc_sk(sk)->conn_timeout = CONN_TIMEOUT_DEFAULT; | 225 | tipc_sk(sk)->conn_timeout = CONN_TIMEOUT_DEFAULT; |
225 | 226 | ||
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c index 5ed5965eb0be..0f7d0d007e22 100644 --- a/net/tipc/subscr.c +++ b/net/tipc/subscr.c | |||
@@ -304,9 +304,9 @@ static struct tipc_subscription *subscr_subscribe(struct tipc_subscr *s, | |||
304 | } | 304 | } |
305 | 305 | ||
306 | /* Refuse subscription if global limit exceeded */ | 306 | /* Refuse subscription if global limit exceeded */ |
307 | if (atomic_read(&topsrv.subscription_count) >= tipc_max_subscriptions) { | 307 | if (atomic_read(&topsrv.subscription_count) >= TIPC_MAX_SUBSCRIPTIONS) { |
308 | pr_warn("Subscription rejected, limit reached (%u)\n", | 308 | pr_warn("Subscription rejected, limit reached (%u)\n", |
309 | tipc_max_subscriptions); | 309 | TIPC_MAX_SUBSCRIPTIONS); |
310 | subscr_terminate(subscriber); | 310 | subscr_terminate(subscriber); |
311 | return NULL; | 311 | return NULL; |
312 | } | 312 | } |