Skip to contentSkip to conversation

Iptables multiport match fix

PATCH In review Marcus Sundberg 3 participants 4 messages Jul 9, 2002 – Jul 10, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Iptables multiport match fix

Hi,

The multiport match checks for the IPT_INV_PROTO flag in the 'flags' member of struct ipt_ip instead of in the 'invflags' member.

net/ipv4/netfilter/ipt_multiport.c +1 -1
diff -ur linux.current/net/ipv4/netfilter/ipt_multiport.c linux-mine/net/ipv4/netfilter/ipt_multiport.c
@@ -78,7 +78,7 @@
 
 	/* Must specify proto == TCP/UDP, no unknown flags or bad count */
 	return (ip->proto == IPPROTO_TCP || ip->proto == IPPROTO_UDP)
-		&& !(ip->flags & IPT_INV_PROTO)
+		&& !(ip->invflags & IPT_INV_PROTO)
 		&& matchsize == IPT_ALIGN(sizeof(struct ipt_multiport))
 		&& (multiinfo->flags == IPT_MULTIPORT_SOURCE
 		    || multiinfo->flags == IPT_MULTIPORT_DESTINATION

(Where should I send this btw? The kernel part of iptables doesn't seem to be in the netfilter CVS. Was I supposed to create a p-o-m patch? Or send it directly to Marcelo?)

//Marcus

Signature · 3 lines
---------------------------------------+--------------------------
  Marcus Sundberg <[email protected]>  | Firewalls with SIP & NAT
 Firewall Developer, Ingate Systems AB |  http://www.ingate.com/
#1 lore raw
Quoted 4 lines · Marcus Sundberg

Hi,

The multiport match checks for the IPT_INV_PROTO flag in the 'flags' member of struct ipt_ip instead of in the 'invflags' member.

thanks for this fix.

Quoted 14 lines

diff -ur linux.current/net/ipv4/netfilter/ipt_multiport.c linux-mine/net/ipv4/netfilter/ipt_multiport.c

net/ipv4/netfilter/ipt_multiport.c +1 -1
@@ -78,7 +78,7 @@
 
 	/* Must specify proto == TCP/UDP, no unknown flags or bad count */
 	return (ip->proto == IPPROTO_TCP || ip->proto == IPPROTO_UDP)
-		&& !(ip->flags & IPT_INV_PROTO)
+		&& !(ip->invflags & IPT_INV_PROTO)
 		&& matchsize == IPT_ALIGN(sizeof(struct ipt_multiport))
 		&& (multiinfo->flags == IPT_MULTIPORT_SOURCE
 		    || multiinfo->flags == IPT_MULTIPORT_DESTINATION
Quoted 3 lines

(Where should I send this btw? The kernel part of iptables doesn't seem to be in the netfilter CVS. Was I supposed to create a p-o-m patch? Or send it directly to Marcelo?)

send it to the netfilter development list ([email protected]). The netfilter developers will then check/test and submit to DaveM for kernel inclusion.

Quoted 1 line

//Marcus

Signature · 5 lines
Live long and prosper
- Harald Welte / [email protected]               http://www.gnumonks.org/
============================================================================
GCS/E/IT d- s-: a-- C+++ UL++++$ P+++ L++++$ E--- W- N++ o? K- w--- O- M- 
V-- PS+ PE-- Y+ PGP++ t++ 5-- !X !R tv-- b+++ DI? !D G+ e* h+ r% y+(*)
#2 lore raw
In reply to Marcus Sundberg
Quoted 5 lines · Marcus Sundberg

Hi,

The multiport match checks for the IPT_INV_PROTO flag in the 'flags' member of struct ipt_ip instead of in the 'invflags' member.

Thanks, the patch looks good, even though inverted multiport isn't functional.

Quoted 4 lines

(Where should I send this btw? The kernel part of iptables doesn't seem to be in the netfilter CVS. Was I supposed to create a p-o-m patch? Or send it directly to Marcelo?)

netfilter-devel is the best bet.

- James

Signature · 2 lines
James Morris
<[email protected]>
#3 lore raw
Quoted 1 line · James Morris

even though inverted multiport isn't functional.

Please disregard this comment... confused myself.

- James

Signature · 2 lines
James Morris
<[email protected]>