Hi Elmer,

On Montag 25 Februar 2008, Horvath, Elmer wrote:
> Ahh, look at http://lxr.linux.no/linux+v2.6.24/net/tipc/port.c#L841 and
> you do have the older code.  This will result in a TIPC reject message
> being sent back.  You application would receive the reject message and
> then process it in line 910 (or thereabouts).
> 
> I think this is the issue.
> 
> You will probably want to up grade to TIPC 1.7.5.  But try what you have
> time to look at.

I managed to get 1.7.5 up and loaded, and things work as expected now! Thanks
for all the patience while walking me through this.

For 2.6.24 I aplied the 5 patches posted on the tipc project page and a fixed
version of the tipc_1.7.5_2.6.24.patch (attached).

Thanks & best regards,
Erich
diff -ur tipc-1.7.5.orig/net/tipc/tipc_cfgsrv.c tipc-1.7.5/net/tipc/tipc_cfgsrv.c
--- tipc-1.7.5.orig/net/tipc/tipc_cfgsrv.c	2007-09-05 22:08:47.000000000 +0200
+++ tipc-1.7.5/net/tipc/tipc_cfgsrv.c	2008-02-06 15:40:10.000000000 +0100
@@ -75,7 +75,7 @@
 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) {
diff -ur tipc-1.7.5.orig/net/tipc/tipc_eth_media.c tipc-1.7.5/net/tipc/tipc_eth_media.c
--- tipc-1.7.5.orig/net/tipc/tipc_eth_media.c	2007-09-06 22:22:27.000000000 +0200
+++ tipc-1.7.5/net/tipc/tipc_eth_media.c	2008-02-06 15:40:10.000000000 +0100
@@ -126,9 +127,9 @@
 		return TIPC_OK;
 	}
 
-	buf_clone->nh.raw = buf_clone->data;
+	skb_reset_network_header(buf_clone);
 	buf_clone->dev = dev;
-	dev->hard_header(buf_clone, dev, ETH_P_TIPC, &dest->value[4],
+	dev_hard_header(buf_clone, dev, ETH_P_TIPC, &dest->value[4],
 			 dev->dev_addr, buf_clone->len);
 	dev_queue_xmit(buf_clone);
 	return TIPC_OK;
@@ -164,18 +165,21 @@
 
 static int enable_bearer(struct tipc_bearer *tb_ptr)
 {
-	struct net_device *dev = dev_base;
+	struct net_device *dev = NULL;
+       struct net_device *pdev = NULL;
 	struct eth_bearer *eb_ptr = &eth_bearers[0];
 	struct eth_bearer *stop = &eth_bearers[MAX_ETH_BEARERS];
 	char *driver_name = strchr((const char *)tb_ptr->name, ':') + 1;
 
 	/* Find device with specified name */
-
-	while (dev && dev->name && strncmp(dev->name, driver_name, IFNAMSIZ)) {	
-		dev = dev->next;
-	}
-	if (!dev)
-		return -ENODEV;
+        for_each_netdev(&init_net, pdev){
+                if (!strncmp(pdev->name, driver_name, IFNAMSIZ)) {
+                        dev = pdev;
+                        break;
+                }
+        }
+        if (!dev)
+                return -ENODEV;
 
 	/* Create Ethernet bearer for device */
 
diff -ur tipc-1.7.5.orig/net/tipc/tipc_handler.c tipc-1.7.5/net/tipc/tipc_handler.c
--- tipc-1.7.5.orig/net/tipc/tipc_handler.c	2007-08-30 19:22:30.000000000 +0200
+++ tipc-1.7.5/net/tipc/tipc_handler.c	2008-02-06 15:40:10.000000000 +0100
@@ -107,9 +107,9 @@
 
 int tipc_handler_start(void)
 {
 	tipc_queue_item_cache = 
 		kmem_cache_create("tipc_queue_items", sizeof(struct queue_item),
-				  0, SLAB_HWCACHE_ALIGN, NULL, NULL);
+				  0, SLAB_HWCACHE_ALIGN, NULL);
 	if (!tipc_queue_item_cache)
 		return -ENOMEM;
 
diff -ur tipc-1.7.5.orig/net/tipc/tipc_socket.c tipc-1.7.5/net/tipc/tipc_socket.c
--- tipc-1.7.5.orig/net/tipc/tipc_socket.c	2007-08-30 19:22:31.000000000 +0200
+++ tipc-1.7.5/net/tipc/tipc_socket.c	2008-02-06 15:40:10.000000000 +0100
@@ -189,8 +189,8 @@
  * Returns 0 on success, errno otherwise
  */
 
-static int tipc_create(struct socket *sock, int protocol)
+static int tipc_create(struct net* net, struct socket *sock, int protocol)
 {
 	const struct proto_ops *ops;
 	socket_state state;
 	struct sock *sk;
@@ -198,6 +199,9 @@
 
 	/* Validate arguments */
 
+	if (net != &init_net)
+ 		return -EAFNOSUPPORT;
+
 	if (unlikely(protocol != 0))
 		return -EPROTONOSUPPORT;
 
@@ -221,7 +225,7 @@
 
 	/* Allocate socket's protocol area */
 
-	sk = sk_alloc(AF_TIPC, GFP_KERNEL, &tipc_proto, 1);
+	sk = sk_alloc(net, AF_TIPC, GFP_KERNEL, &tipc_proto);
 	if (sk == NULL)
 		return -ENOMEM;
 
@@ -241,6 +245,11 @@
 
 	sock_init_data(sock, sk);
 	sk->sk_rcvtimeo = CONN_TIMEOUT_DEFAULT;
+        /* set credentials */
+        sk->sk_peercred.pid     = current->tgid;
+        sk->sk_peercred.uid     = current->euid;
+        sk->sk_peercred.gid     = current->egid;
+
 	sk->sk_backlog_rcv = backlog_rcv;
 	sk->sk_user_data = (void *)tipc_get_port(portref);
 
@@ -1523,7 +1532,7 @@
 
 	buf = skb_peek(&sk->sk_receive_queue);
 
-	res = tipc_create(new_sock, 0);
+	res = tipc_create(sock->sk->sk_net, new_sock, 0);
 	if (!res) {
 		struct sock *new_sk = new_sock->sk;
 		struct tipc_port *new_tport = sock_port(new_sk);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
tipc-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to