[netfilter-cvslog] r4244 - in trunk/patch-o-matic-ng/patchlets/TTL: linux/net/ipv4/netfilter linux-2.6/net/ipv4/netfilter

laforge at netfilter.org laforge at netfilter.org
Fri Aug 26 13:00:49 CEST 2005


Author: laforge at netfilter.org
Date: 2005-08-26 13:00:48 +0200 (Fri, 26 Aug 2005)
New Revision: 4244

Modified:
   trunk/patch-o-matic-ng/patchlets/TTL/linux-2.6/net/ipv4/netfilter/ipt_TTL.c
   trunk/patch-o-matic-ng/patchlets/TTL/linux/net/ipv4/netfilter/ipt_TTL.c
Log:
cosmetic cleanup (Marcin Garski, Harald Welte)


Modified: trunk/patch-o-matic-ng/patchlets/TTL/linux/net/ipv4/netfilter/ipt_TTL.c
===================================================================
--- trunk/patch-o-matic-ng/patchlets/TTL/linux/net/ipv4/netfilter/ipt_TTL.c	2005-08-26 10:32:27 UTC (rev 4243)
+++ trunk/patch-o-matic-ng/patchlets/TTL/linux/net/ipv4/netfilter/ipt_TTL.c	2005-08-26 11:00:48 UTC (rev 4244)
@@ -1,7 +1,7 @@
 /* TTL modification target for IP tables
  * (C) 2000 by Harald Welte <laforge at gnumonks.org>
  *
- * Version: $Revision: 1.2 $
+ * Version: $Revision$
  *
  * This software is distributed under the terms of GNU GPL
  */
@@ -26,7 +26,7 @@
 	const struct ipt_TTL_info *info = targinfo;
 	u_int16_t diffs[2];
 	int new_ttl;
-			 
+
 	switch (info->mode) {
 		case IPT_TTL_SET:
 			new_ttl = info->ttl;
@@ -52,8 +52,8 @@
 		diffs[1] = htons(((unsigned)iph->ttl) << 8);
 		iph->check = csum_fold(csum_partial((char *)diffs,
 						    sizeof(diffs),
-				 	            iph->check^0xFFFF));
-									                	(*pskb)->nfcache |= NFC_ALTERED;
+						    iph->check^0xFFFF));
+		(*pskb)->nfcache |= NFC_ALTERED;
 	}
 
 	return IPT_CONTINUE;
@@ -71,11 +71,12 @@
 		printk(KERN_WARNING "TTL: targinfosize %u != %Zu\n",
 				targinfosize,
 				IPT_ALIGN(sizeof(struct ipt_TTL_info)));
-		return 0;	
-	}	
+		return 0;
+	}
 
 	if (strcmp(tablename, "mangle")) {
-		printk(KERN_WARNING "TTL: can only be called from \"mangle\" table, not \"%s\"\n", tablename);
+		printk(KERN_WARNING "TTL: can only be called from "
+			"\"mangle\" table, not \"%s\"\n", tablename);
 		return 0;
 	}
 
@@ -86,15 +87,20 @@
 	}
 
 	if ((info->mode != IPT_TTL_SET) && (info->ttl == 0)) {
-		printk(KERN_WARNING "TTL: increment/decrement doesn't make sense with value 0\n");
+		printk(KERN_WARNING "TTL: increment/decrement doesn't "
+			"make sense with value 0\n");
 		return 0;
 	}
-	
+
 	return 1;
 }
 
-static struct ipt_target ipt_TTL = { { NULL, NULL }, "TTL", 
-	ipt_ttl_target, ipt_ttl_checkentry, NULL, THIS_MODULE };
+static struct ipt_target ipt_TTL = { 
+	.name 		= "TTL", 
+	.target		= ipt_ttl_target, 
+	.checkentry	= ipt_ttl_checkentry,
+	.me		= THIS_MODULE
+};
 
 static int __init init(void)
 {

Modified: trunk/patch-o-matic-ng/patchlets/TTL/linux-2.6/net/ipv4/netfilter/ipt_TTL.c
===================================================================
--- trunk/patch-o-matic-ng/patchlets/TTL/linux-2.6/net/ipv4/netfilter/ipt_TTL.c	2005-08-26 10:32:27 UTC (rev 4243)
+++ trunk/patch-o-matic-ng/patchlets/TTL/linux-2.6/net/ipv4/netfilter/ipt_TTL.c	2005-08-26 11:00:48 UTC (rev 4244)
@@ -1,7 +1,7 @@
 /* TTL modification target for IP tables
  * (C) 2000 by Harald Welte <laforge at gnumonks.org>
  *
- * Version: $Revision: 1.3 $
+ * Version: $Revision$
  *
  * This software is distributed under the terms of GNU GPL
  */
@@ -32,7 +32,7 @@
 		return NF_DROP;
 
 	iph = (*pskb)->nh.iph;
-			 
+
 	switch (info->mode) {
 		case IPT_TTL_SET:
 			new_ttl = info->ttl;
@@ -58,8 +58,8 @@
 		diffs[1] = htons(((unsigned)iph->ttl) << 8);
 		iph->check = csum_fold(csum_partial((char *)diffs,
 						    sizeof(diffs),
-				 	            iph->check^0xFFFF));
-									                	(*pskb)->nfcache |= NFC_ALTERED;
+						    iph->check^0xFFFF));
+		(*pskb)->nfcache |= NFC_ALTERED;
 	}
 
 	return IPT_CONTINUE;
@@ -77,11 +77,12 @@
 		printk(KERN_WARNING "TTL: targinfosize %u != %Zu\n",
 				targinfosize,
 				IPT_ALIGN(sizeof(struct ipt_TTL_info)));
-		return 0;	
-	}	
+		return 0;
+	}
 
 	if (strcmp(tablename, "mangle")) {
-		printk(KERN_WARNING "TTL: can only be called from \"mangle\" table, not \"%s\"\n", tablename);
+		printk(KERN_WARNING "TTL: can only be called from "
+			"\"mangle\" table, not \"%s\"\n", tablename);
 		return 0;
 	}
 
@@ -92,18 +93,19 @@
 	}
 
 	if ((info->mode != IPT_TTL_SET) && (info->ttl == 0)) {
-		printk(KERN_WARNING "TTL: increment/decrement doesn't make sense with value 0\n");
+		printk(KERN_WARNING "TTL: increment/decrement doesn't "
+			"make sense with value 0\n");
 		return 0;
 	}
-	
+
 	return 1;
 }
 
 static struct ipt_target ipt_TTL = { 
-	.name = "TTL",
-	.target = ipt_ttl_target, 
-	.checkentry = ipt_ttl_checkentry, 
-	.me = THIS_MODULE 
+	.name 		= "TTL",
+	.target 	= ipt_ttl_target, 
+	.checkentry 	= ipt_ttl_checkentry, 
+	.me 		= THIS_MODULE,
 };
 
 static int __init init(void)




More information about the netfilter-cvslog mailing list