Skip to contentSkip to conversation

[PATCH 2.4/2.5]

PATCH In review Filip Sneppe (Cronos) 4 participants 7 messages Jun 29, 2003 – Jun 30, 2003 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 [PATCH 2.4/2.5]

Hi Brian,

Are you ok with the following two patches? They allow for the amanda conntrack/nat modules to track up to 8 ports - it has more or less become a common practice for most conntrack/nat helpers in the kernel. There's a patch for 2.4 and one for 2.5.

Regards,
Filip

include/linux/netfilter_ipv4/ip_conntrack_amanda.h +1 -1
diff -urN -X dontdiff linux-2.4.22-pre2-orig/include/linux/netfilter_ipv4/ip_conntrack_amanda.h linux-2.4.22-pre2/include/linux/netfilter_ipv4/ip_conntrack_amanda.h
@@ -17,7 +17,7 @@
 };
 
 #define NUM_MSGS 	3
-
+#define AMANDA_PORT	10080
 
 struct ip_ct_amanda_expect
 {
net/ipv4/netfilter/ip_conntrack_amanda.c +61 -26

128 lines not on this page · raw message

net/ipv4/netfilter/ip_nat_amanda.c +59 -28

117 lines not on this page · raw message

include/linux/netfilter_ipv4/ip_conntrack_amanda.h +2 -0
diff -urN -X dontdiff linux-2.5.73-orig/include/linux/netfilter_ipv4/ip_conntrack_amanda.h linux-2.5.73/include/linux/netfilter_ipv4/ip_conntrack_amanda.h
@@ -11,6 +11,8 @@
 
 #endif
 
+#define AMANDA_PORT	10080
+
 struct ip_ct_amanda_expect
 {
 	u_int16_t port;		/* port number of this expectation */
net/ipv4/netfilter/ip_conntrack_amanda.c +61 -27

130 lines not on this page · raw message

net/ipv4/netfilter/ip_nat_amanda.c +59 -28

117 lines not on this page · raw message

#1 lore raw
Quoted 6 lines · Filip Sneppe (Cronos)

Hi Brian,

Are you ok with the following two patches? They allow for the amanda conntrack/nat modules to track up to 8 ports - it has more or less become a common practice for most conntrack/nat helpers in the kernel.

In what scenario would there be a need for multiple ports? The connection is initiated from the Amanda "server" to the clients. It's the clients that listen on port 10080, and it's the connection from the server to the clients that is watched for, natted and conntracked.

I am having a hard time thinking of a scenario where a client would want to listen on a port other than it's default and/or listen on multiple ports for commands from the backup server.

The patch (the 2.4 one anyway) looks syntactically correct. It's just the need for it that I am not quite seeing.

b.

Signature · 1 line
Brian J. Murrell <[email protected]>
#2 lore raw
Quoted 5 lines · Brian J. Murrell

I am having a hard time thinking of a scenario where a client would want to listen on a port other than it's default and/or listen on multiple ports for commands from the backup server.

Well not a lot of common scenarios, I will give you that, but I just figured that in some situations, people run services on different ports, not the standard ports the services are normally associated with. Sometimes because those ports are blocked by another firewall, sometimes to confuse portscanners. I just figured that the other conntrackers in the kernel had this feature so I added it to your code...

Regards,
Filip

#3 lore raw
Quoted 5 lines · Filip Sneppe (Cronos)

Well not a lot of common scenarios, I will give you that, but I just figured that in some situations, people run services on different ports, not the standard ports the services are normally associated with. Sometimes because those ports are blocked by another firewall, sometimes to confuse portscanners.

That is all fair enough I suppose. I have no specific objection to it, just didn't do it myself because I could not see the need. If Harald (and/or the core team) see fit, I have no objection to adding it.

b.

Signature · 1 line
Brian J. Murrell <[email protected]>
#4 lore raw
Quoted 10 lines · Brian J. Murrell
Quoted 5 lines · Filip Sneppe (Cronos)

Well not a lot of common scenarios, I will give you that, but I just figured that in some situations, people run services on different ports, not the standard ports the services are normally associated with. Sometimes because those ports are blocked by another firewall, sometimes to confuse portscanners.

That is all fair enough I suppose. I have no specific objection to it, just didn't do it myself because I could not see the need. If Harald (and/or the core team) see fit, I have no objection to adding it.

I don't really see the need for such a patch unless the port numbers used by amanda can be tuned somehow (by an amanda server/client config
file). I'm not that familiar with the amanda suite, could somebody
please investicate this?

I mean, if we really need any helper to be working on any port, we could even think of a more generic mechanism (like making helpers target of a special table ('helper' with only one chain).... there you could do stuff like
'iptables -t helper -j HELPER --helper-name ftp -p tcp --dport 21'

Quoted 1 line

Brian J. Murrell <[email protected]>

Signature · 5 lines
- Harald Welte <[email protected]>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie
#5 lore raw
Quoted 5 lines · Harald Welte

I don't really see the need for such a patch unless the port numbers used by amanda can be tuned somehow (by an amanda server/client config
file). I'm not that familiar with the amanda suite, could somebody
please investicate this?

The port numbers can certainly be tuned. In the case of the client (which having configurable ports as per Filip's patch addresses) the client is simply started from the [x]inetd super-server, so it can be on any port the admin wishes.

b.

Signature · 1 line
Brian J. Murrell <[email protected]>
#6 lore raw
In reply to Filip Sneppe (Cronos)

Hi Filip,
you should remove the memsets, they are currently beeing removed from the others helpers.

Best regards,
Patrick

Quoted 11 lines · Filip Sneppe (Cronos)
net/ipv4/netfilter/ip_conntrack_amanda.c +4 -4
-	if (ret) {
-		printk("ip_ct_amanda: ERROR registering helper\n");
-		fini();
-		return -EBUSY;
+	for(i = 0; (i < MAX_PORTS) && ports[i]; i++) {
+		memset(&amanda_helper[i], 0, sizeof(struct ip_conntrack_helper));
+		amanda_helper[i].tuple.src.u.udp.port = htons(ports[i]);
+		amanda_helper[i].tuple.dst.protonum = IPPROTO_UDP;