OpenVZ Forum


Home » Mailing lists » Devel » [patch 2/2][NETNS49][IPV4][UDPLITE] activate udplite per network namespace
[patch 2/2][NETNS49][IPV4][UDPLITE] activate udplite per network namespace [message #21474] Tue, 09 October 2007 17:00
Daniel Lezcano is currently offline  Daniel Lezcano
Messages: 417
Registered: June 2006
Senior Member
This patch activates the udplite protocol for multiple
network namespaces.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>

---
 net/ipv4/udplite.c |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

Index: linux-2.6-netns/net/ipv4/udplite.c
===================================================================
--- linux-2.6-netns.orig/net/ipv4/udplite.c
+++ linux-2.6-netns/net/ipv4/udplite.c
@@ -30,18 +30,11 @@ static int udplite_v4_get_port(struct so
 
 static int udplite_rcv(struct sk_buff *skb)
 {
-	if (skb->dev->nd_net != &init_net) {
-		kfree_skb(skb);
-		return 0;
-	}
 	return __udp4_lib_rcv(skb, udplite_hash, IPPROTO_UDPLITE);
 }
 
 static void udplite_err(struct sk_buff *skb, u32 info)
 {
-	if (skb->dev->nd_net != &init_net)
-		return;
-
 	return __udp4_lib_err(skb, info, udplite_hash);
 }
 
@@ -83,7 +76,7 @@ static struct inet_protosw udplite4_prot
 	.ops		=  &inet_dgram_ops,
 	.capability	= -1,
 	.no_check	=  0,		/* must checksum (RFC 3828) */
-	.flags		=  INET_PROTOSW_PERMANENT,
+	.flags		=  INET_PROTOSW_PERMANENT | INET_PROTOSW_NETNS,
 };
 
 #ifdef CONFIG_PROC_FS
@@ -99,9 +92,6 @@ static struct udp_seq_afinfo udplite4_se
 
 static int udplite4_proc_net_init(struct net *net)
 {
-	if (net != &init_net)
-		return -EPERM;
-
 	if (udp_proc_register(net, &udplite4_seq_afinfo)) /* udplite4_proc_init() */
 		printk(KERN_ERR "%s: Cannot register /proc!\n", __FUNCTION__);
 

-- 
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Previous Topic: [patch 1/2][NETNS49][IPV4][UDPLITE] add udp_proc_register per net
Next Topic: [PATCH][NETNS] Don't memset() netns to zero manually
Goto Forum:
  


Current Time: Fri Sep 12 14:56:44 GMT 2025

Total time taken to generate the page: 0.08960 seconds