svn commit: r230442 - in head/sys: netinet netinet6 netipsec
Bjoern A. Zeeb
bz at FreeBSD.org
Sun Jan 22 02:13:20 UTC 2012
Author: bz
Date: Sun Jan 22 02:13:19 2012
New Revision: 230442
URL: http://svn.freebsd.org/changeset/base/230442
Log:
Clean up some #endif comments removing from short sections. Add #endif
comments to longer, also refining strange ones.
Properly use #ifdef rather than #if defined() where possible. Four
#if defined(PCBGROUP) occurances (netinet and netinet6) were ignored to
avoid conflicts with eventually upcoming changes for RSS.
Reported by: bde (most)
Reviewed by: bde
MFC after: 3 days
Modified:
head/sys/netinet/if_ether.c
head/sys/netinet/in_pcb.c
head/sys/netinet/ip_ipsec.c
head/sys/netinet6/ip6_ipsec.c
head/sys/netipsec/xform_ipip.c
Modified: head/sys/netinet/if_ether.c
==============================================================================
--- head/sys/netinet/if_ether.c Sun Jan 22 01:11:06 2012 (r230441)
+++ head/sys/netinet/if_ether.c Sun Jan 22 02:13:19 2012 (r230442)
@@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$");
#include <netinet/in_var.h>
#include <net/if_llatbl.h>
#include <netinet/if_ether.h>
-#if defined(INET)
+#ifdef INET
#include <netinet/ip_carp.h>
#endif
Modified: head/sys/netinet/in_pcb.c
==============================================================================
--- head/sys/netinet/in_pcb.c Sun Jan 22 01:11:06 2012 (r230441)
+++ head/sys/netinet/in_pcb.c Sun Jan 22 02:13:19 2012 (r230442)
@@ -196,7 +196,7 @@ SYSCTL_VNET_INT(_net_inet_ip_portrange,
&VNET_NAME(ipport_randomtime), 0,
"Minimum time to keep sequental port "
"allocation before switching to a random one");
-#endif
+#endif /* INET */
/*
* in_pcb.c: manage the Protocol Control Blocks.
@@ -1038,7 +1038,7 @@ in_pcbdisconnect(struct inpcb *inp)
inp->inp_fport = 0;
in_pcbrehash(inp);
}
-#endif
+#endif /* INET */
/*
* in_pcbdetach() is responsibe for disassociating a socket from an inpcb.
@@ -1169,7 +1169,7 @@ in_pcbfree(struct inpcb *inp)
#ifdef IPSEC
if (inp->inp_sp != NULL)
ipsec_delete_pcbpolicy(inp);
-#endif /* IPSEC */
+#endif
inp->inp_gencnt = ++pcbinfo->ipi_gencnt;
in_pcbremlists(inp);
#ifdef INET6
@@ -1586,7 +1586,7 @@ in_pcblookup_group(struct inpcbinfo *pcb
if (inp->inp_vflag & INP_IPV6PROTO)
local_wild_mapped = inp;
else
-#endif /* INET6 */
+#endif
if (injail)
jail_wild = inp;
else
@@ -1601,7 +1601,7 @@ in_pcblookup_group(struct inpcbinfo *pcb
#ifdef INET6
if (inp == NULL)
inp = local_wild_mapped;
-#endif /* defined(INET6) */
+#endif
if (inp != NULL)
goto found;
} /* if (lookupflags & INPLOOKUP_WILDCARD) */
@@ -1731,7 +1731,7 @@ in_pcblookup_hash_locked(struct inpcbinf
if (inp->inp_vflag & INP_IPV6PROTO)
local_wild_mapped = inp;
else
-#endif /* INET6 */
+#endif
if (injail)
jail_wild = inp;
else
@@ -1747,7 +1747,7 @@ in_pcblookup_hash_locked(struct inpcbinf
#ifdef INET6
if (local_wild_mapped != NULL)
return (local_wild_mapped);
-#endif /* defined(INET6) */
+#endif
} /* if ((lookupflags & INPLOOKUP_WILDCARD) != 0) */
return (NULL);
@@ -1871,7 +1871,7 @@ in_pcbinshash_internal(struct inpcb *inp
if (inp->inp_vflag & INP_IPV6)
hashkey_faddr = inp->in6p_faddr.s6_addr32[3] /* XXX */;
else
-#endif /* INET6 */
+#endif
hashkey_faddr = inp->inp_faddr.s_addr;
pcbhash = &pcbinfo->ipi_hashbase[INP_PCBHASH(hashkey_faddr,
@@ -1958,7 +1958,7 @@ in_pcbrehash_mbuf(struct inpcb *inp, str
if (inp->inp_vflag & INP_IPV6)
hashkey_faddr = inp->in6p_faddr.s6_addr32[3] /* XXX */;
else
-#endif /* INET6 */
+#endif
hashkey_faddr = inp->inp_faddr.s_addr;
head = &pcbinfo->ipi_hashbase[INP_PCBHASH(hashkey_faddr,
@@ -2226,14 +2226,13 @@ db_print_inconninfo(struct in_conninfo *
/* IPv6. */
ip6_sprintf(laddr_str, &inc->inc6_laddr);
ip6_sprintf(faddr_str, &inc->inc6_faddr);
- } else {
+ } else
#endif
+ {
/* IPv4. */
inet_ntoa_r(inc->inc_laddr, laddr_str);
inet_ntoa_r(inc->inc_faddr, faddr_str);
-#ifdef INET6
}
-#endif
db_print_indent(indent);
db_printf("inc_laddr %s inc_lport %u\n", laddr_str,
ntohs(inc->inc_lport));
@@ -2446,4 +2445,4 @@ DB_SHOW_COMMAND(inpcb, db_show_inpcb)
db_print_inpcb(inp, "inpcb", 0);
}
-#endif
+#endif /* DDB */
Modified: head/sys/netinet/ip_ipsec.c
==============================================================================
--- head/sys/netinet/ip_ipsec.c Sun Jan 22 01:11:06 2012 (r230441)
+++ head/sys/netinet/ip_ipsec.c Sun Jan 22 02:13:19 2012 (r230442)
@@ -92,7 +92,7 @@ SYSCTL_VNET_INT(_net_inet_ipsec, OID_AUT
int
ip_ipsec_filtertunnel(struct mbuf *m)
{
-#if defined(IPSEC)
+#ifdef IPSEC
/*
* Bypass packet filtering for packets previously handled by IPsec.
Modified: head/sys/netinet6/ip6_ipsec.c
==============================================================================
--- head/sys/netinet6/ip6_ipsec.c Sun Jan 22 01:11:06 2012 (r230441)
+++ head/sys/netinet6/ip6_ipsec.c Sun Jan 22 02:13:19 2012 (r230442)
@@ -103,7 +103,7 @@ SYSCTL_VNET_INT(_net_inet6_ipsec6, OID_A
int
ip6_ipsec_filtertunnel(struct mbuf *m)
{
-#if defined(IPSEC)
+#ifdef IPSEC
/*
* Bypass packet filtering for packets previously handled by IPsec.
Modified: head/sys/netipsec/xform_ipip.c
==============================================================================
--- head/sys/netipsec/xform_ipip.c Sun Jan 22 01:11:06 2012 (r230441)
+++ head/sys/netipsec/xform_ipip.c Sun Jan 22 02:13:19 2012 (r230442)
@@ -687,7 +687,7 @@ static struct ip6protosw ipe6_protosw =
};
#endif /* INET6 && INET */
-#if defined(INET)
+#ifdef INET
/*
* Check the encapsulated packet to see if we want it
*/
More information about the svn-src-all
mailing list