Skip to contentSkip to conversation

rsh helper handling of ip_conntrack_helper->name

PATCH In review Phil Oester 2 participants 2 messages Nov 11, 2004 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rsh helper handling of ip_conntrack_helper->name

RSH helper doesn't properly handle name registration of multiple ports. Patch below fixes.

This fixes 1/2 of bugzilla #90

Phil

rsh/linux/net/ipv4/netfilter/ip_conntrack_rsh.c +8 -7
diff -ru pom-orig/rsh/linux/net/ipv4/netfilter/ip_conntrack_rsh.c pom-new/rsh/linux/net/ipv4/netfilter/ip_conntrack_rsh.c
@@ -254,14 +254,14 @@
 }
 
 static struct ip_conntrack_helper rsh_helpers[MAX_PORTS];
+static char rsh_names[MAX_PORTS][10];
 
 static void fini(void);
 
 static int __init init(void)
 {
 	int port, ret;
-	static char name[10];
-
+	char *tmpname;
 
 	/* If no port given, default to standard RSH port */
 	if (ports[0] == 0)
@@ -270,12 +270,13 @@
 	for (port = 0; (port < MAX_PORTS) && ports[port]; port++) {
 		memset(&rsh_helpers[port], 0, sizeof(struct ip_conntrack_helper));
 
-                if (ports[port] == RSH_PORT)
-                        sprintf(name, "rsh");
-                else
-                        sprintf(name, "rsh-%d", port);
+		tmpname = &rsh_names[port][0];
+		if (ports[port] == RSH_PORT)
+			sprintf(tmpname, "rsh");
+		else
+			sprintf(tmpname, "rsh-%d", ports[port]);
+		rsh_helpers[port].name = tmpname;
 
-		rsh_helpers[port].name = name;
 		rsh_helpers[port].me = THIS_MODULE;
 		rsh_helpers[port].max_expected = 1;
 		rsh_helpers[port].flags = IP_CT_HELPER_F_REUSE_EXPECT;
#1 lore raw
Quoted 4 lines · Phil Oester

RSH helper doesn't properly handle name registration of multiple ports. Patch below fixes.

This fixes 1/2 of bugzilla #90

Both RSH and RPC patches applied, thanks.

Signature · 1 line
/Martin