diff options
Diffstat (limited to 'net/tipc/config.c')
| -rw-r--r-- | net/tipc/config.c | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/net/tipc/config.c b/net/tipc/config.c index e16750dcf3c1..b25a396b7e1e 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, Wind River Systems | 5 | * Copyright (c) 2004-2007, 2010-2011, 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 |
| @@ -148,7 +148,7 @@ static struct sk_buff *cfg_enable_bearer(void) | |||
| 148 | 148 | ||
| 149 | args = (struct tipc_bearer_config *)TLV_DATA(req_tlv_area); | 149 | args = (struct tipc_bearer_config *)TLV_DATA(req_tlv_area); |
| 150 | if (tipc_enable_bearer(args->name, | 150 | if (tipc_enable_bearer(args->name, |
| 151 | ntohl(args->detect_scope), | 151 | ntohl(args->disc_domain), |
| 152 | ntohl(args->priority))) | 152 | ntohl(args->priority))) |
| 153 | return tipc_cfg_reply_error_string("unable to enable bearer"); | 153 | return tipc_cfg_reply_error_string("unable to enable bearer"); |
| 154 | 154 | ||
| @@ -260,25 +260,6 @@ static struct sk_buff *cfg_set_max_ports(void) | |||
| 260 | return tipc_cfg_reply_none(); | 260 | return tipc_cfg_reply_none(); |
| 261 | } | 261 | } |
| 262 | 262 | ||
| 263 | static struct sk_buff *cfg_set_max_nodes(void) | ||
| 264 | { | ||
| 265 | u32 value; | ||
| 266 | |||
| 267 | if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED)) | ||
| 268 | return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); | ||
| 269 | value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area)); | ||
| 270 | if (value == tipc_max_nodes) | ||
| 271 | return tipc_cfg_reply_none(); | ||
| 272 | if (value != delimit(value, 8, 2047)) | ||
| 273 | return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE | ||
| 274 | " (max nodes must be 8-2047)"); | ||
| 275 | if (tipc_mode == TIPC_NET_MODE) | ||
| 276 | return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED | ||
| 277 | " (cannot change max nodes once TIPC has joined a network)"); | ||
| 278 | tipc_max_nodes = value; | ||
| 279 | return tipc_cfg_reply_none(); | ||
| 280 | } | ||
| 281 | |||
| 282 | static struct sk_buff *cfg_set_netid(void) | 263 | static struct sk_buff *cfg_set_netid(void) |
| 283 | { | 264 | { |
| 284 | u32 value; | 265 | u32 value; |
| @@ -397,9 +378,6 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area | |||
| 397 | case TIPC_CMD_SET_MAX_SUBSCR: | 378 | case TIPC_CMD_SET_MAX_SUBSCR: |
| 398 | rep_tlv_buf = cfg_set_max_subscriptions(); | 379 | rep_tlv_buf = cfg_set_max_subscriptions(); |
| 399 | break; | 380 | break; |
| 400 | case TIPC_CMD_SET_MAX_NODES: | ||
| 401 | rep_tlv_buf = cfg_set_max_nodes(); | ||
| 402 | break; | ||
| 403 | case TIPC_CMD_SET_NETID: | 381 | case TIPC_CMD_SET_NETID: |
| 404 | rep_tlv_buf = cfg_set_netid(); | 382 | rep_tlv_buf = cfg_set_netid(); |
| 405 | break; | 383 | break; |
| @@ -415,9 +393,6 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area | |||
| 415 | case TIPC_CMD_GET_MAX_SUBSCR: | 393 | case TIPC_CMD_GET_MAX_SUBSCR: |
| 416 | rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_subscriptions); | 394 | rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_subscriptions); |
| 417 | break; | 395 | break; |
| 418 | case TIPC_CMD_GET_MAX_NODES: | ||
| 419 | rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_nodes); | ||
| 420 | break; | ||
| 421 | case TIPC_CMD_GET_NETID: | 396 | case TIPC_CMD_GET_NETID: |
| 422 | rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_net_id); | 397 | rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_net_id); |
| 423 | break; | 398 | break; |
| @@ -431,6 +406,8 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area | |||
| 431 | case TIPC_CMD_GET_MAX_SLAVES: | 406 | case TIPC_CMD_GET_MAX_SLAVES: |
| 432 | case TIPC_CMD_SET_MAX_CLUSTERS: | 407 | case TIPC_CMD_SET_MAX_CLUSTERS: |
| 433 | case TIPC_CMD_GET_MAX_CLUSTERS: | 408 | case TIPC_CMD_GET_MAX_CLUSTERS: |
| 409 | case TIPC_CMD_SET_MAX_NODES: | ||
| 410 | case TIPC_CMD_GET_MAX_NODES: | ||
| 434 | rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED | 411 | rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED |
| 435 | " (obsolete command)"); | 412 | " (obsolete command)"); |
| 436 | break; | 413 | break; |
