Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Oct 2006 01:51:19 +0700 (NOVST)
From:      Alexey Dokuchaev <danfe@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/104682: Some minor language consistency fixes and whitespace nits
Message-ID:  <200610221851.k9MIpJR9024774@regency.nsu.ru>
Resent-Message-ID: <200610221850.k9MIoFh0035754@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         104682
>Category:       kern
>Synopsis:       Some minor language consistency fixes and whitespace nits
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 22 18:50:14 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Alexey Dokuchaev
>Release:        FreeBSD 6.2-PRERELEASE i386
>Organization:
Asempra Technologies, Inc.
>Environment:
>Description:
It seems that displaing "ipfw2 .... initalized" upon system startup is
useless (our users do not really care about version since there's no
ipfw1 in modern versions of FreeBSD).  In fact, in FreeBSD 4.x, it was
"IP packet filtering" instead of "ipfw2", which is IMHO better.  I've
tweaked it a bit to turn down chances of consufing IPFW with
IPFilter/PF, so basically what I suggest is "IP packet firewall").
Also, what about printing "(+ipv6)" unless we have NO_INET6 defined?
I've also fixed EOL whitespace along the way, and consitent use of
"IPv6" term in comments (and "... initialized/inloaded" string).

My `ip_fw2.c' version:

	src/sys/netinet/ip_fw2.c,v 1.106.2.20 2006/09/20 19:15:03 jhay
>How-To-Repeat:
N/A
>Fix:
--- sys/netinet/ip_fw2.c.orig	Tue Oct  3 03:32:49 2006
+++ sys/netinet/ip_fw2.c	Mon Oct 23 01:31:01 2006
@@ -514,7 +514,7 @@
 /*
  * The verify_path function checks if a route to the src exists and
  * if it is reachable via ifp (when provided).
- * 
+ *
  * The 'verrevpath' option checks that the interface that an IP packet
  * arrives on is the same interface that traffic destined for the
  * packet's source address would be routed out of.  The 'versrcreach'
@@ -580,7 +580,7 @@
 
 #ifdef INET6
 /*
- * ipv6 specific rules here...
+ * IPv6 specific rules here...
  */
 static __inline int
 icmp6type_match (int type, ipfw_insn_u32 *cmd)
@@ -641,7 +641,7 @@
 	if (ro.ro_rt == NULL)
 		return 0;
 
-	/* 
+	/*
 	 * if ifp is provided, check for equality with rtentry
 	 * We should use rt->rt_ifa->ifa_ifp, instead of rt->rt_ifp,
 	 * to support the case of sending packets to an address of our own.
@@ -1042,7 +1042,7 @@
 	u_int32_t i;
 
 #ifdef INET6
-	if (IS_IP6_FLOW_ID(id)) 
+	if (IS_IP6_FLOW_ID(id))
 		i = hash_packet6(id);
 	else
 #endif /* INET6 */
@@ -1504,7 +1504,7 @@
 
 		conn_limit = (cmd->conn_limit == IP_FW_TABLEARG) ?
 		    tablearg : cmd->conn_limit;
-		  
+
 		DEB(
 		if (cmd->conn_limit == IP_FW_TABLEARG)
 			printf("ipfw: %s: O_LIMIT rule, conn_limit: %u "
@@ -1828,7 +1828,7 @@
 
 static int
 init_tables(struct ip_fw_chain *ch)
-{ 
+{
 	int i;
 	uint16_t j;
 
@@ -2007,7 +2007,7 @@
 			*lookup = -1;
 			return (0);
 		}
-	} 
+	}
 	if (insn->o.opcode == O_UID)
 		match = (ugp->fw_uid == (uid_t)insn->d[0]);
 	else if (insn->o.opcode == O_GID) {
@@ -2121,7 +2121,7 @@
 	 *	we have a fragment at this offset of an IPv4 packet.
 	 *	offset == 0 means that (if this is an IPv4 packet)
 	 *	this is the first or only fragment.
-	 *	For IPv6 offset == 0 means there is no Fragment Header. 
+	 *	For IPv6 offset == 0 means there is no Fragment Header.
 	 *	If offset != 0 for IPv6 always use correct mask to
 	 *	get the correct offset because we add IP6F_MORE_FRAG
 	 *	to be able to dectect the first fragment which would
@@ -2162,14 +2162,14 @@
 	/*
 	 * We store in ulp a pointer to the upper layer protocol header.
 	 * In the ipv4 case this is easy to determine from the header,
-	 * but for ipv6 we might have some additional headers in the middle.
+	 * but for IPv6 we might have some additional headers in the middle.
 	 * ulp is NULL if not found.
 	 */
 	void *ulp = NULL;		/* upper layer protocol pointer. */
-	/* XXX ipv6 variables */
+	/* XXX IPv6 variables */
 	int is_ipv6 = 0;
 	u_int16_t ext_hd = 0;	/* bits vector for extension header filtering */
-	/* end of ipv6 variables */
+	/* end of IPv6 variables */
 	int is_ipv4 = 0;
 
 	if (m->m_flags & M_SKIP_FIREWALL)
@@ -4329,8 +4329,11 @@
 	}
 
 	ip_fw_default_rule = layer3_chain.rules;
-	printf("ipfw2 (+ipv6) initialized, divert %s, "
-		"rule-based forwarding "
+	printf("IP packet firewall "
+#ifdef INET6
+	"(+IPv6) "
+#endif
+	"initialized, divert %s, rule-based forwarding "
 #ifdef IPFIREWALL_FORWARD
 		"enabled, "
 #else
@@ -4397,5 +4400,5 @@
 	sysctl_ctx_free(&ip6_fw_sysctl_ctx);
 #endif
 
-	printf("IP firewall unloaded\n");
+	printf("IP packet firewall unloaded\n");
 }
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610221851.k9MIpJR9024774>