aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/config.c')
-rw-r--r--net/tipc/config.c30
1 files changed, 5 insertions, 25 deletions
diff --git a/net/tipc/config.c b/net/tipc/config.c
index bdde39f0436b..8de97ddb0427 100644
--- a/net/tipc/config.c
+++ b/net/tipc/config.c
@@ -269,25 +269,6 @@ static struct sk_buff *cfg_set_max_ports(void)
269 return tipc_cfg_reply_none(); 269 return tipc_cfg_reply_none();
270} 270}
271 271
272static struct sk_buff *cfg_set_max_zones(void)
273{
274 u32 value;
275
276 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
277 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
278 value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
279 if (value == tipc_max_zones)
280 return tipc_cfg_reply_none();
281 if (value != delimit(value, 1, 255))
282 return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
283 " (max zones must be 1-255)");
284 if (tipc_mode == TIPC_NET_MODE)
285 return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
286 " (cannot change max zones once TIPC has joined a network)");
287 tipc_max_zones = value;
288 return tipc_cfg_reply_none();
289}
290
291static struct sk_buff *cfg_set_max_clusters(void) 272static struct sk_buff *cfg_set_max_clusters(void)
292{ 273{
293 u32 value; 274 u32 value;
@@ -452,9 +433,6 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
452 case TIPC_CMD_SET_MAX_SUBSCR: 433 case TIPC_CMD_SET_MAX_SUBSCR:
453 rep_tlv_buf = cfg_set_max_subscriptions(); 434 rep_tlv_buf = cfg_set_max_subscriptions();
454 break; 435 break;
455 case TIPC_CMD_SET_MAX_ZONES:
456 rep_tlv_buf = cfg_set_max_zones();
457 break;
458 case TIPC_CMD_SET_MAX_CLUSTERS: 436 case TIPC_CMD_SET_MAX_CLUSTERS:
459 rep_tlv_buf = cfg_set_max_clusters(); 437 rep_tlv_buf = cfg_set_max_clusters();
460 break; 438 break;
@@ -479,9 +457,6 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
479 case TIPC_CMD_GET_MAX_SUBSCR: 457 case TIPC_CMD_GET_MAX_SUBSCR:
480 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_subscriptions); 458 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_subscriptions);
481 break; 459 break;
482 case TIPC_CMD_GET_MAX_ZONES:
483 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_zones);
484 break;
485 case TIPC_CMD_GET_MAX_CLUSTERS: 460 case TIPC_CMD_GET_MAX_CLUSTERS:
486 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_clusters); 461 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_clusters);
487 break; 462 break;
@@ -498,6 +473,11 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
498 rep_tlv_buf = 473 rep_tlv_buf =
499 tipc_cfg_reply_error_string(TIPC_CFG_NOT_NET_ADMIN); 474 tipc_cfg_reply_error_string(TIPC_CFG_NOT_NET_ADMIN);
500 break; 475 break;
476 case TIPC_CMD_SET_MAX_ZONES:
477 case TIPC_CMD_GET_MAX_ZONES:
478 rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
479 " (obsolete command)");
480 break;
501 default: 481 default:
502 rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED 482 rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
503 " (unknown command)"); 483 " (unknown command)");