Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Dec 2012 10:38:48 GMT
From:      Garrett Cooper <yanegomi@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/174032: [patch] better document netinet6 sysctls and formatting cleanup
Message-ID:  <201212011038.qB1Acm5J050100@red.freebsd.org>
Resent-Message-ID: <201212011040.qB1Ae0MA067789@freefall.freebsd.org>

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

>Number:         174032
>Category:       kern
>Synopsis:       [patch] better document netinet6 sysctls and formatting cleanup
>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:   Sat Dec 01 10:40:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Garrett Cooper
>Release:        10-CURRENT
>Organization:
EMC Isilon
>Environment:
FreeBSD bayonetta.local 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0 r240836M: Sat Sep 22 12:30:11 PDT 2012     gcooper@bayonetta.local:/usr/obj/store/freebsd/stable/9/sys/BAYONETTA  amd64
>Description:
After having to tweak the net.inet6 sysctls for TAHI, I figured it would be best to better document the sysctls for others who needed to use them at a later date. The attached patch is the resulting change, reviewed by brde@ on the freebsd-net@ list here: http://lists.freebsd.org/pipermail/freebsd-net/2012-November/033971.html .

Some of the other changes contained in the patch dealing with formatting, "v6" suffixing instead of "6", etc are based on feedback received from brde@.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: sys/netinet6/in6_proto.c
===================================================================
--- sys/netinet6/in6_proto.c	(revision 242903)
+++ sys/netinet6/in6_proto.c	(working copy)
@@ -131,7 +131,7 @@
 #endif
 
 /*
- * TCP/IP protocol family: IP6, ICMP6, UDP, TCP.
+ * TCP/IP protocol family: IPv6, ICMPv6, UDPv6, TCPv6.
  */
 FEATURE(inet6, "Internet Protocol version 6");
 
@@ -380,11 +380,11 @@
 /*
  * Internet configuration info
  */
-#ifndef	IPV6FORWARDING
+#ifndef IPV6FORWARDING
 #ifdef GATEWAY6
-#define	IPV6FORWARDING	1	/* forward IP6 packets not for us */
+#define	IPV6FORWARDING	1	/* forward IPv6 packets */
 #else
-#define	IPV6FORWARDING	0	/* don't forward IP6 packets not for us */
+#define	IPV6FORWARDING	0	/* don't forward IPv6 packets */
 #endif /* GATEWAY6 */
 #endif /* !IPV6FORWARDING */
 
@@ -431,7 +431,7 @@
 VNET_DEFINE(int, pmtu_expire) = 60*10;
 VNET_DEFINE(int, pmtu_probe) = 60*2;
 
-/* raw IP6 parameters */
+/* raw IPV6 parameters */
 /*
  * Nominal space allocated to a raw ip socket.
  */
@@ -449,7 +449,7 @@
 VNET_DEFINE(int, icmp6_nodeinfo) =
     (ICMP6_NODEINFO_FQDNOK|ICMP6_NODEINFO_NODEADDROK);
 
-/* UDP on IP6 parameters */
+/* UDP on IPv6 parameters */
 VNET_DEFINE(int, udp6_sendspace) = 9216;/* really max datagram size */
 VNET_DEFINE(int, udp6_recvspace) = 40 * (1024 + sizeof(struct sockaddr_in6));
 					/* 40 1K datagrams */
@@ -461,15 +461,15 @@
 	"Internet6 Family");
 
 /* net.inet6 */
-SYSCTL_NODE(_net_inet6,	IPPROTO_IPV6,	ip6,	CTLFLAG_RW, 0,	"IP6");
-SYSCTL_NODE(_net_inet6,	IPPROTO_ICMPV6,	icmp6,	CTLFLAG_RW, 0,	"ICMP6");
-SYSCTL_NODE(_net_inet6,	IPPROTO_UDP,	udp6,	CTLFLAG_RW, 0,	"UDP6");
-SYSCTL_NODE(_net_inet6,	IPPROTO_TCP,	tcp6,	CTLFLAG_RW, 0,	"TCP6");
+SYSCTL_NODE(_net_inet6,	IPPROTO_IPV6,	ip6,	CTLFLAG_RW, 0,	"");
+SYSCTL_NODE(_net_inet6,	IPPROTO_ICMPV6,	icmp6,	CTLFLAG_RW, 0,	"");
+SYSCTL_NODE(_net_inet6,	IPPROTO_UDP,	udp6,	CTLFLAG_RW, 0,	"");
+SYSCTL_NODE(_net_inet6,	IPPROTO_TCP,	tcp6,	CTLFLAG_RW, 0,	"");
 #ifdef SCTP
-SYSCTL_NODE(_net_inet6,	IPPROTO_SCTP,	sctp6,	CTLFLAG_RW, 0,	"SCTP6");
+SYSCTL_NODE(_net_inet6,	IPPROTO_SCTP,	sctp6,	CTLFLAG_RW, 0,	"");
 #endif
 #ifdef IPSEC
-SYSCTL_NODE(_net_inet6,	IPPROTO_ESP,	ipsec6,	CTLFLAG_RW, 0,	"IPSEC6");
+SYSCTL_NODE(_net_inet6,	IPPROTO_ESP,	ipsec6,	CTLFLAG_RW, 0,	"");
 #endif /* IPSEC */
 
 /* net.inet6.ip6 */
@@ -515,77 +515,99 @@
 }
 
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_FORWARDING, forwarding, CTLFLAG_RW,
-	&VNET_NAME(ip6_forwarding), 0, "");
+    &VNET_NAME(ip6_forwarding), 0,
+    "Forward IPv6 packets via node");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_SENDREDIRECTS, redirect, CTLFLAG_RW,
-	&VNET_NAME(ip6_sendredirects), 0, "");
+    &VNET_NAME(ip6_sendredirects), 0,
+    "Redirect IPv6 packets via node");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_DEFHLIM, hlim, CTLFLAG_RW,
-	&VNET_NAME(ip6_defhlim), 0, "");
+    &VNET_NAME(ip6_defhlim), 0,
+    "Default hop limit for IPv6 unicast packets");
 SYSCTL_VNET_STRUCT(_net_inet6_ip6, IPV6CTL_STATS, stats, CTLFLAG_RW,
-	&VNET_NAME(ip6stat), ip6stat, "");
+    &VNET_NAME(ip6stat), ip6stat,
+    "IPv6 statistics");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGPACKETS, maxfragpackets,
-	CTLFLAG_RW, &VNET_NAME(ip6_maxfragpackets), 0, "");
+    CTLFLAG_RW, &VNET_NAME(ip6_maxfragpackets), 0,
+    "Maximum number of fragmented packets to process");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_ACCEPT_RTADV, accept_rtadv,
-	CTLFLAG_RW, &VNET_NAME(ip6_accept_rtadv), 0,
-	"Default value of per-interface flag for accepting ICMPv6 Router"
-	"Advertisement messages");
+    CTLFLAG_RW, &VNET_NAME(ip6_accept_rtadv), 0,
+    "Default value of per-interface flag for accepting ICMPv6 Router"
+    "Advertisement messages");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_NO_RADR, no_radr,
-	CTLFLAG_RW, &VNET_NAME(ip6_no_radr), 0,
-	"Default value of per-interface flag to control whether routers "
-	"sending ICMPv6 RA messages on that interface are added into the "
-	"default router list.");
+    CTLFLAG_RW, &VNET_NAME(ip6_no_radr), 0,
+    "Default value of per-interface flag to control whether routers "
+    "sending ICMPv6 RA messages on that interface are added into the "
+    "default router list");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_NORBIT_RAIF, norbit_raif, CTLFLAG_RW,
-	&VNET_NAME(ip6_norbit_raif), 0,
-	"Always set 0 to R flag in ICMPv6 NA messages when accepting RA"
-	" on the interface.");
+    &VNET_NAME(ip6_norbit_raif), 0,
+    "Always set 0 to R flag in ICMPv6 NA messages when accepting RA "
+    "on the interface");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_RFC6204W3, rfc6204w3,
-	CTLFLAG_RW, &VNET_NAME(ip6_rfc6204w3), 0,
-	"Accept the default router list from ICMPv6 RA messages even "
-	"when packet forwarding enabled.");
+    CTLFLAG_RW, &VNET_NAME(ip6_rfc6204w3), 0,
+    "Accept the default router list from ICMPv6 RA messages even when packet "
+    "forwarding enabled");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_KEEPFAITH, keepfaith, CTLFLAG_RW,
-	&VNET_NAME(ip6_keepfaith), 0, "");
+    &VNET_NAME(ip6_keepfaith), 0,
+    "");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_LOG_INTERVAL, log_interval,
-	CTLFLAG_RW, &VNET_NAME(ip6_log_interval), 0, "");
+    CTLFLAG_RW, &VNET_NAME(ip6_log_interval), 0,
+    "Period (in secs) for throttling logging for high-traffic operations");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_HDRNESTLIMIT, hdrnestlimit,
-	CTLFLAG_RW, &VNET_NAME(ip6_hdrnestlimit), 0, "");
+    CTLFLAG_RW, &VNET_NAME(ip6_hdrnestlimit), 0,
+    "Maximum number of nested header options to process");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_DAD_COUNT, dad_count, CTLFLAG_RW,
-	&VNET_NAME(ip6_dad_count), 0, "");
+    &VNET_NAME(ip6_dad_count), 0,
+    "Number of Duplicate Address Detection attempts to try before "
+    "disabling interface.  Setting the value to 0 disables DAD");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_AUTO_FLOWLABEL, auto_flowlabel,
-	CTLFLAG_RW, &VNET_NAME(ip6_auto_flowlabel), 0, "");
+    CTLFLAG_RW, &VNET_NAME(ip6_auto_flowlabel), 0,
+    "Automatically attach a flowlabel to IPv6 packets");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_DEFMCASTHLIM, defmcasthlim,
-	CTLFLAG_RW, &VNET_NAME(ip6_defmcasthlim), 0, "");
+    CTLFLAG_RW, &VNET_NAME(ip6_defmcasthlim), 0,
+    "Default hop limit for ip6 multicast packets");
 SYSCTL_STRING(_net_inet6_ip6, IPV6CTL_KAME_VERSION, kame_version,
-	CTLFLAG_RD, __KAME_VERSION, 0, "");
+    CTLFLAG_RD, __KAME_VERSION, 0,
+    "");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_USE_DEPRECATED, use_deprecated,
-	CTLFLAG_RW, &VNET_NAME(ip6_use_deprecated), 0, "");
-SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_RR_PRUNE, rr_prune, CTLFLAG_RW,
-	&VNET_NAME(ip6_rr_prune), 0, "");
+    CTLFLAG_RW, &VNET_NAME(ip6_use_deprecated), 0,
+    "Use deprecated IPv6 support");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_USETEMPADDR, use_tempaddr,
-	CTLFLAG_RW, &VNET_NAME(ip6_use_tempaddr), 0, "");
+    CTLFLAG_RW, &VNET_NAME(ip6_use_tempaddr), 0,
+    "Use a temporary address when establishing address via SLAAC");
 SYSCTL_VNET_PROC(_net_inet6_ip6, IPV6CTL_TEMPPLTIME, temppltime,
-	CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(ip6_temp_preferred_lifetime), 0,
-   	sysctl_ip6_temppltime, "I", "");
+    CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(ip6_temp_preferred_lifetime), 0,
+    sysctl_ip6_temppltime, "I",
+    "Preferred lifetime (in secs) for a temporary address");
 SYSCTL_VNET_PROC(_net_inet6_ip6, IPV6CTL_TEMPVLTIME, tempvltime,
-	CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(ip6_temp_valid_lifetime), 0,
-   	sysctl_ip6_tempvltime, "I", "");
-SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_V6ONLY, v6only,	CTLFLAG_RW,
-	&VNET_NAME(ip6_v6only), 0, "");
+    CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(ip6_temp_valid_lifetime), 0,
+    sysctl_ip6_tempvltime, "I",
+    "Valid lifetime (in secs) for a temporary address");
+SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_V6ONLY, v6only, CTLFLAG_RW,
+    &VNET_NAME(ip6_v6only), 0,
+    "Allow IPv4-mapped ip6 addresses per RFC 3493");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_AUTO_LINKLOCAL, auto_linklocal,
-	CTLFLAG_RW, &VNET_NAME(ip6_auto_linklocal), 0,
-	"Default value of per-interface flag for automatically adding an IPv6"
-	" link-local address to interfaces when attached");
-SYSCTL_VNET_STRUCT(_net_inet6_ip6, IPV6CTL_RIP6STATS, rip6stats, CTLFLAG_RW,
-	&VNET_NAME(rip6stat), rip6stat, "");
+    CTLFLAG_RW, &VNET_NAME(ip6_auto_linklocal), 0,
+    "Default value of per-interface flag for automatically adding an ip6 "
+    "link-local address to interfaces when attached");
+SYSCTL_VNET_STRUCT(_net_inet6_ip6, IPV6CTL_RIPV6STATS, rip6stats, CTLFLAG_RW,
+    &VNET_NAME(rip6stat), rip6stat,
+    "RIP6 statistics");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_PREFER_TEMPADDR, prefer_tempaddr,
-	CTLFLAG_RW, &VNET_NAME(ip6_prefer_tempaddr), 0, "");
+    CTLFLAG_RW, &VNET_NAME(ip6_prefer_tempaddr), 0,
+    "Prefer the temporary address assigned when performing NUD");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_USE_DEFAULTZONE, use_defaultzone,
-	CTLFLAG_RW, &VNET_NAME(ip6_use_defzone), 0,"");
+    CTLFLAG_RW, &VNET_NAME(ip6_use_defzone), 0,
+    "Use the default scope zone if not explicitly provided");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGS, maxfrags, CTLFLAG_RW,
-	&VNET_NAME(ip6_maxfrags), 0, "");
+    &VNET_NAME(ip6_maxfrags), 0,
+    "Maximum number of fragments to hold in the reassembly queue");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_MCAST_PMTU, mcast_pmtu, CTLFLAG_RW,
-	&VNET_NAME(ip6_mcast_pmtu), 0, "");
+    &VNET_NAME(ip6_mcast_pmtu), 0,
+    "Enable multicast pMTU discovery");
 #ifdef IPSTEALTH
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_STEALTH, stealth, CTLFLAG_RW,
-	&VNET_NAME(ip6stealth), 0, "");
+    &VNET_NAME(ip6stealth), 0,
+    "IPv6 stealth mode. No hop limit decrementation on forwarding");
 #endif
 
 #ifdef FLOWTABLE
@@ -600,29 +622,39 @@
 
 /* net.inet6.icmp6 */
 SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRACCEPT, rediraccept,
-	CTLFLAG_RW, &VNET_NAME(icmp6_rediraccept), 0, "");
-SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRTIMEOUT, redirtimeout,
-	CTLFLAG_RW, &VNET_NAME(icmp6_redirtimeout), 0, "");
+    CTLFLAG_RW, &VNET_NAME(icmp6_rediraccept), 0,
+    "Accept and process router redirects");
 SYSCTL_VNET_STRUCT(_net_inet6_icmp6, ICMPV6CTL_STATS, stats, CTLFLAG_RW,
-	&VNET_NAME(icmp6stat), icmp6stat, "");
+    &VNET_NAME(icmp6stat), icmp6stat,
+    "ICMPv6 statistics");
 SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_PRUNE, nd6_prune, CTLFLAG_RW,
-	&VNET_NAME(nd6_prune), 0, "");
+    &VNET_NAME(nd6_prune), 0,
+    "Period (in secs) for checking for stale router entries via nd6");
 SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DELAY, nd6_delay, CTLFLAG_RW,
-	&VNET_NAME(nd6_delay), 0, "");
+    &VNET_NAME(nd6_delay), 0,
+    "Delay (in secs) before performing NUD on stale nodes");
 SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_UMAXTRIES, nd6_umaxtries,
-	CTLFLAG_RW, &VNET_NAME(nd6_umaxtries), 0, "");
+    CTLFLAG_RW, &VNET_NAME(nd6_umaxtries), 0,
+    "Maximum number of unicast queries to perform via nd6");
 SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MMAXTRIES, nd6_mmaxtries,
-	CTLFLAG_RW, &VNET_NAME(nd6_mmaxtries), 0, "");
+    CTLFLAG_RW, &VNET_NAME(nd6_mmaxtries), 0,
+    "Maximum number of multicast queries to perform via nd6");
 SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_USELOOPBACK, nd6_useloopback,
-	CTLFLAG_RW, &VNET_NAME(nd6_useloopback), 0, "");
+    CTLFLAG_RW, &VNET_NAME(nd6_useloopback), 0,
+    "Use loopback interface for local traffic");
 SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO, nodeinfo, CTLFLAG_RW,
-	&VNET_NAME(icmp6_nodeinfo), 0, "");
+    &VNET_NAME(icmp6_nodeinfo), 0,
+    "Node information state");
 SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ERRPPSLIMIT, errppslimit,
-	CTLFLAG_RW, &VNET_NAME(icmp6errppslim), 0, "");
+    CTLFLAG_RW, &VNET_NAME(icmp6errppslim), 0,
+    "Packets per second limit for ICMPv6 queries");
 SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MAXNUDHINT, nd6_maxnudhint,
-	CTLFLAG_RW, &VNET_NAME(nd6_maxnudhint), 0, "");
+    CTLFLAG_RW, &VNET_NAME(nd6_maxnudhint), 0,
+    "Maximum number of upper layer hints");
 SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DEBUG, nd6_debug, CTLFLAG_RW,
-	&VNET_NAME(nd6_debug), 0, "");
+    &VNET_NAME(nd6_debug), 0,
+    "");
 SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_ONLINKNSRFC4861,
-	nd6_onlink_ns_rfc4861, CTLFLAG_RW, &VNET_NAME(nd6_onlink_ns_rfc4861),
-	0, "Accept 'on-link' nd6 NS in compliance with RFC 4861.");
+    nd6_onlink_ns_rfc4861,
+    CTLFLAG_RW, &VNET_NAME(nd6_onlink_ns_rfc4861), 0,
+    "Accept 'on-link' nd6 NS in compliance with RFC 4861");


>Release-Note:
>Audit-Trail:
>Unformatted:



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