aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-06-29 20:43:43 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-29 20:43:43 -0400
commit74e651f0aa100f3e5d3432a8dd8869c089e8d72f (patch)
tree457e8d6ec4c28f3b1f3f4fcbf45df9b91f9ee9c7 /net/tipc
parent6002e45045a190a112bc3bc2134d0ff4fac7ced7 (diff)
parent0702056f9f41274a06e21cb05f12b4265b4867a2 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (30 commits) [TIPC]: Initial activation message now includes TIPC version number [TIPC]: Improve response to requests for node/link information [TIPC]: Fixed skb_under_panic caused by tipc_link_bundle_buf [IrDA]: Fix the AU1000 FIR dependencies [IrDA]: Fix RCU lock pairing on error path [XFRM]: unexport xfrm_state_mtu [NET]: make skb_release_data() static [NETFILTE] ipv4: Fix typo (Bugzilla #6753) [IrDA]: MCS7780 usb_driver struct should be static [BNX2]: Turn off link during shutdown [BNX2]: Use dev_kfree_skb() instead of the _irq version [ATM]: basic sysfs support for ATM devices [ATM]: [suni] change suni_init to __devinit [ATM]: [iphase] should be __devinit not __init [ATM]: [idt77105] should be __devinit not __init [BNX2]: Add NETIF_F_TSO_ECN [NET]: Add ECN support for TSO [AF_UNIX]: Datagram getpeersec [NET]: Fix logical error in skb_gso_ok [PKT_SCHED]: PSCHED_TADD() and PSCHED_TADD2() can result,tv_usec >= 1000000 ...
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/core.c3
-rw-r--r--net/tipc/link.c11
-rw-r--r--net/tipc/node.c26
-rw-r--r--net/tipc/zone.h4
4 files changed, 27 insertions, 17 deletions
diff --git a/net/tipc/core.c b/net/tipc/core.c
index 5003acb15919..0539a8362858 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -191,7 +191,8 @@ static int __init tipc_init(void)
191 int res; 191 int res;
192 192
193 tipc_log_reinit(CONFIG_TIPC_LOG); 193 tipc_log_reinit(CONFIG_TIPC_LOG);
194 info("Activated (compiled " __DATE__ " " __TIME__ ")\n"); 194 info("Activated (version " TIPC_MOD_VER
195 " compiled " __DATE__ " " __TIME__ ")\n");
195 196
196 tipc_own_addr = 0; 197 tipc_own_addr = 0;
197 tipc_remote_management = 1; 198 tipc_remote_management = 1;
diff --git a/net/tipc/link.c b/net/tipc/link.c
index d64658053746..c6831c75cfa4 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -2,7 +2,7 @@
2 * net/tipc/link.c: TIPC link code 2 * net/tipc/link.c: TIPC link code
3 * 3 *
4 * Copyright (c) 1996-2006, Ericsson AB 4 * Copyright (c) 1996-2006, Ericsson AB
5 * Copyright (c) 2004-2005, Wind River Systems 5 * Copyright (c) 2004-2006, 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
@@ -988,17 +988,18 @@ static int link_bundle_buf(struct link *l_ptr,
988 struct tipc_msg *bundler_msg = buf_msg(bundler); 988 struct tipc_msg *bundler_msg = buf_msg(bundler);
989 struct tipc_msg *msg = buf_msg(buf); 989 struct tipc_msg *msg = buf_msg(buf);
990 u32 size = msg_size(msg); 990 u32 size = msg_size(msg);
991 u32 to_pos = align(msg_size(bundler_msg)); 991 u32 bundle_size = msg_size(bundler_msg);
992 u32 rest = link_max_pkt(l_ptr) - to_pos; 992 u32 to_pos = align(bundle_size);
993 u32 pad = to_pos - bundle_size;
993 994
994 if (msg_user(bundler_msg) != MSG_BUNDLER) 995 if (msg_user(bundler_msg) != MSG_BUNDLER)
995 return 0; 996 return 0;
996 if (msg_type(bundler_msg) != OPEN_MSG) 997 if (msg_type(bundler_msg) != OPEN_MSG)
997 return 0; 998 return 0;
998 if (rest < align(size)) 999 if (skb_tailroom(bundler) < (pad + size))
999 return 0; 1000 return 0;
1000 1001
1001 skb_put(bundler, (to_pos - msg_size(bundler_msg)) + size); 1002 skb_put(bundler, pad + size);
1002 memcpy(bundler->data + to_pos, buf->data, size); 1003 memcpy(bundler->data + to_pos, buf->data, size);
1003 msg_set_size(bundler_msg, to_pos + size); 1004 msg_set_size(bundler_msg, to_pos + size);
1004 msg_set_msgcnt(bundler_msg, msg_msgcnt(bundler_msg) + 1); 1005 msg_set_msgcnt(bundler_msg, msg_msgcnt(bundler_msg) + 1);
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 861322b935da..fc6d09630ccd 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -2,7 +2,7 @@
2 * net/tipc/node.c: TIPC node management routines 2 * net/tipc/node.c: TIPC node management routines
3 * 3 *
4 * Copyright (c) 2000-2006, Ericsson AB 4 * Copyright (c) 2000-2006, Ericsson AB
5 * Copyright (c) 2005, Wind River Systems 5 * Copyright (c) 2005-2006, 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
@@ -592,6 +592,7 @@ struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
592 struct sk_buff *buf; 592 struct sk_buff *buf;
593 struct node *n_ptr; 593 struct node *n_ptr;
594 struct tipc_node_info node_info; 594 struct tipc_node_info node_info;
595 u32 payload_size;
595 596
596 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_NET_ADDR)) 597 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_NET_ADDR))
597 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); 598 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
@@ -608,8 +609,11 @@ struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
608 /* For now, get space for all other nodes 609 /* For now, get space for all other nodes
609 (will need to modify this when slave nodes are supported */ 610 (will need to modify this when slave nodes are supported */
610 611
611 buf = tipc_cfg_reply_alloc(TLV_SPACE(sizeof(node_info)) * 612 payload_size = TLV_SPACE(sizeof(node_info)) * (tipc_max_nodes - 1);
612 (tipc_max_nodes - 1)); 613 if (payload_size > 32768u)
614 return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
615 " (too many nodes)");
616 buf = tipc_cfg_reply_alloc(payload_size);
613 if (!buf) 617 if (!buf)
614 return NULL; 618 return NULL;
615 619
@@ -633,6 +637,7 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space)
633 struct sk_buff *buf; 637 struct sk_buff *buf;
634 struct node *n_ptr; 638 struct node *n_ptr;
635 struct tipc_link_info link_info; 639 struct tipc_link_info link_info;
640 u32 payload_size;
636 641
637 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_NET_ADDR)) 642 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_NET_ADDR))
638 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); 643 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
@@ -645,12 +650,15 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space)
645 650
646 if (!tipc_nodes) 651 if (!tipc_nodes)
647 return tipc_cfg_reply_none(); 652 return tipc_cfg_reply_none();
648 653
649 /* For now, get space for 2 links to all other nodes + bcast link 654 /* Get space for all unicast links + multicast link */
650 (will need to modify this when slave nodes are supported */ 655
651 656 payload_size = TLV_SPACE(sizeof(link_info)) *
652 buf = tipc_cfg_reply_alloc(TLV_SPACE(sizeof(link_info)) * 657 (tipc_net.zones[tipc_zone(tipc_own_addr)]->links + 1);
653 (2 * (tipc_max_nodes - 1) + 1)); 658 if (payload_size > 32768u)
659 return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
660 " (too many links)");
661 buf = tipc_cfg_reply_alloc(payload_size);
654 if (!buf) 662 if (!buf)
655 return NULL; 663 return NULL;
656 664
diff --git a/net/tipc/zone.h b/net/tipc/zone.h
index 267999c5a240..5ab3d08602e2 100644
--- a/net/tipc/zone.h
+++ b/net/tipc/zone.h
@@ -2,7 +2,7 @@
2 * net/tipc/zone.h: Include file for TIPC zone management routines 2 * net/tipc/zone.h: Include file for TIPC zone management routines
3 * 3 *
4 * Copyright (c) 2000-2006, Ericsson AB 4 * Copyright (c) 2000-2006, Ericsson AB
5 * Copyright (c) 2005, Wind River Systems 5 * Copyright (c) 2005-2006, 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
@@ -45,7 +45,7 @@
45 * struct _zone - TIPC zone structure 45 * struct _zone - TIPC zone structure
46 * @addr: network address of zone 46 * @addr: network address of zone
47 * @clusters: array of pointers to all clusters within zone 47 * @clusters: array of pointers to all clusters within zone
48 * @links: (used for inter-zone communication) 48 * @links: number of (unicast) links to zone
49 */ 49 */
50 50
51struct _zone { 51struct _zone {