Skip to contentSkip to conversation

ipt_unclean.c: fix for UDP zero source port check

PATCH In review Guillaume Morin 2 participants 2 messages Oct 11, 2002 – Oct 14, 2002

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

PATCH 1/1 ipt_unclean.c: fix for UDP zero source port check

Hi folks,

RFC768 allows the source port of an UDP packet to be zero. Currently, the unclean match reports such a packet as unclean. This is bogus. Here is the patch which fixes that :

net/ipv4/netfilter/ipt_unclean.c +3 -4
@@ -216,10 +216,9 @@
 				 csum_partial((char *)udph, datalen, 0)) != 0)
 		return 0;
 
-	/* CHECK: Ports can't be zero. */
-	if (!udph->source || !udph->dest) {
-		limpk("UDP zero ports %u/%u\n",
-		      ntohs(udph->source), ntohs(udph->dest));
+	/* CHECK: Destination port can't be zero. */
+	if (!udph->dest) {
+		limpk("UDP zero destination port\n");
 		return 0;
 	}
 

Regards,

Signature · 4 lines
Guillaume Morin <[email protected]>

       Unwisely, Santa offered a teddy bear to James, unaware that he had
             been mauled by a grizzly earlier that year (T. Burton)
net/ipv4/netfilter/ipt_unclean.c +3 -4
@@ -216,10 +216,9 @@
 				 csum_partial((char *)udph, datalen, 0)) != 0)
 		return 0;
 
-	/* CHECK: Ports can't be zero. */
-	if (!udph->source || !udph->dest) {
-		limpk("UDP zero ports %u/%u\n",
-		      ntohs(udph->source), ntohs(udph->dest));
+	/* CHECK: Destination port can't be zero. */
+	if (!udph->dest) {
+		limpk("UDP zero destination port\n");
 		return 0;
 	}
 
#1 lore raw
Quoted 5 lines · Guillaume Morin

Hi folks,

RFC768 allows the source port of an UDP packet to be zero. Currently, the unclean match reports such a packet as unclean. This is bogus. Here is the patch which fixes that :

you are totally correct. I'll forward this for kernel inclusion.

Signature · 5 lines
Live long and prosper
- Harald Welte / [email protected]               http://www.gnumonks.org/
============================================================================
"If this were a dictatorship, it'd be a heck of a lot easier, just so long
 as I'm the dictator."  --  George W. Bush Dec 18, 2000