X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=net%2Ftipc%2Fconfig.c;h=ca3544d030c7f9177fbe426e9f955c4655c157cc;hb=12de512ae1d6d150f95b7157cb3293ef7545676d;hp=458a2c46cef3d5a022947fbe85350bacdda17317;hpb=f1ff0fdc353ca00ff43b7b039944b8070da22242;p=linux-2.6-omap-h63xx.git diff --git a/net/tipc/config.c b/net/tipc/config.c index 458a2c46cef..ca3544d030c 100644 --- a/net/tipc/config.c +++ b/net/tipc/config.c @@ -1,8 +1,8 @@ /* * net/tipc/config.c: TIPC configuration management code - * + * * Copyright (c) 2002-2006, Ericsson AB - * Copyright (c) 2004-2006, Wind River Systems + * Copyright (c) 2004-2007, Wind River Systems * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -86,10 +86,10 @@ struct sk_buff *tipc_cfg_reply_alloc(int payload_size) return buf; } -int tipc_cfg_append_tlv(struct sk_buff *buf, int tlv_type, +int tipc_cfg_append_tlv(struct sk_buff *buf, int tlv_type, void *tlv_data, int tlv_data_size) { - struct tlv_desc *tlv = (struct tlv_desc *)buf->tail; + struct tlv_desc *tlv = (struct tlv_desc *)skb_tail_pointer(buf); int new_tlv_space = TLV_SPACE(tlv_data_size); if (skb_tailroom(buf) < new_tlv_space) { @@ -112,7 +112,7 @@ struct sk_buff *tipc_cfg_reply_unsigned_type(u16 tlv_type, u32 value) buf = tipc_cfg_reply_alloc(TLV_SPACE(sizeof(value))); if (buf) { value_net = htonl(value); - tipc_cfg_append_tlv(buf, tlv_type, &value_net, + tipc_cfg_append_tlv(buf, tlv_type, &value_net, sizeof(value_net)); } return buf; @@ -182,7 +182,7 @@ int tipc_cfg_cmd(const struct tipc_cmd_msg * msg, static void cfg_cmd_event(struct tipc_cmd_msg *msg, char *data, - u32 sz, + u32 sz, struct tipc_portid const *orig) { int rv = -EINVAL; @@ -192,7 +192,7 @@ static void cfg_cmd_event(struct tipc_cmd_msg *msg, msg->cmd = ntohl(msg->cmd); - cfg_prepare_res_msg(msg->cmd, msg->usr_handle, rv, &rmsg, msg_sect, + cfg_prepare_res_msg(msg->cmd, msg->usr_handle, rv, &rmsg, msg_sect, data, 0); if (ntohl(msg->magic) != TIPC_MAGIC) goto exit; @@ -208,7 +208,7 @@ static void cfg_cmd_event(struct tipc_cmd_msg *msg, if (mng.link_subscriptions > 64) break; - sub = (struct subscr_data *)kmalloc(sizeof(*sub), + sub = kmalloc(sizeof(*sub), GFP_ATOMIC); if (sub == NULL) { warn("Memory squeeze; dropped remote link subscription\n"); @@ -293,9 +293,8 @@ static struct sk_buff *cfg_set_own_addr(void) if (tipc_mode == TIPC_NET_MODE) return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED " (cannot change node address once assigned)"); - tipc_own_addr = addr; - /* + /* * Must release all spinlocks before calling start_net() because * Linux version of TIPC calls eth_media_start() which calls * register_netdevice_notifier() which may block! @@ -306,7 +305,7 @@ static struct sk_buff *cfg_set_own_addr(void) */ spin_unlock_bh(&config_lock); - tipc_core_start_net(); + tipc_core_start_net(addr); spin_lock_bh(&config_lock); return tipc_cfg_reply_none(); } @@ -529,7 +528,7 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area break; #endif case TIPC_CMD_SET_LOG_SIZE: - rep_tlv_buf = tipc_log_resize(req_tlv_area, req_tlv_space); + rep_tlv_buf = tipc_log_resize_cmd(req_tlv_area, req_tlv_space); break; case TIPC_CMD_DUMP_LOG: rep_tlv_buf = tipc_log_dump(); @@ -602,6 +601,10 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area case TIPC_CMD_GET_NETID: rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_net_id); break; + case TIPC_CMD_NOT_NET_ADMIN: + rep_tlv_buf = + tipc_cfg_reply_error_string(TIPC_CFG_NOT_NET_ADMIN); + break; default: rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED " (unknown command)"); @@ -619,7 +622,7 @@ static void cfg_named_msg_event(void *userdata, struct sk_buff **buf, const unchar *msg, u32 size, - u32 importance, + u32 importance, struct tipc_portid const *orig, struct tipc_name_seq const *dest) { @@ -640,7 +643,7 @@ static void cfg_named_msg_event(void *userdata, /* Generate reply for request (if can't, return request) */ rep_buf = tipc_cfg_do_cmd(orig->node, - ntohs(req_hdr->tcm_type), + ntohs(req_hdr->tcm_type), msg + sizeof(*req_hdr), size - sizeof(*req_hdr), BUF_HEADROOM + MAX_H_SIZE + sizeof(*rep_hdr));