Skip to contentSkip to conversation

: TTL target

PATCH Samuel Jean 2 participants 2 messages Jul 27, 2004 netfilter

lore
Share & tools
lore
#0 lore raw

Hi Patrick,

Quoted 2 lines · Patrick

The patches for 2.4 and 2.6 don't apply, your mailer may have mangled them. Please send them again as attachment.

I attached both patches. Sorry for all the complications.

Quoted 2 lines

Regards
Patrick

Cheers,

Signature · 3 lines
Samuel Jean
SysAdmin & NetAdmin
at cookinglinux.org
net/ipv4/netfilter/ipt_TTL.c renamed from net/ipv4/netfilter/ipt_TTL.c.orig +1 -6
@@ -37,7 +37,7 @@ static unsigned int ipt_ttl_target(struc
 				new_ttl = 255;
 			break;
 		case IPT_TTL_DEC:
-			new_ttl = iph->ttl + info->ttl;
+			new_ttl = iph->ttl - info->ttl;
 			if (new_ttl < 0)
 				new_ttl = 0;
 			break;
@@ -85,11 +85,6 @@ static int ipt_ttl_checkentry(const char
 		return 0;
 	}
 
-	if ((info->mode != IPT_TTL_SET) && (info->ttl == 0)) {
-		printk(KERN_WARNING "TTL: increment/decrement doesn't make sense with value 0\n");
-		return 0;
-	}
-	
 	return 1;
 }
 
net/ipv4/netfilter/ipt_TTL.c renamed from net/ipv4/netfilter/ipt_TTL.c.orig +1 -6
@@ -43,7 +43,7 @@ ipt_ttl_target(struct sk_buff **pskb, co
 				new_ttl = 255;
 			break;
 		case IPT_TTL_DEC:
-			new_ttl = iph->ttl + info->ttl;
+			new_ttl = iph->ttl - info->ttl;
 			if (new_ttl < 0)
 				new_ttl = 0;
 			break;
@@ -91,11 +91,6 @@ static int ipt_ttl_checkentry(const char
 		return 0;
 	}
 
-	if ((info->mode != IPT_TTL_SET) && (info->ttl == 0)) {
-		printk(KERN_WARNING "TTL: increment/decrement doesn't make sense with value 0\n");
-		return 0;
-	}
-	
 	return 1;
 }
 
#1 lore raw
Quoted 2 lines · Samuel Jean

I attached both patches. Sorry for all the complications.

All three patches applied, thanks.

Regards
Patrick