svn commit: r191942 - head/sys/netinet6

Warner Losh imp at FreeBSD.org
Sat May 9 18:26:00 UTC 2009


Author: imp
Date: Sat May  9 18:25:58 2009
New Revision: 191942
URL: http://svn.freebsd.org/changeset/base/191942

Log:
  Implement RFC 5095 more fully.  Rather than marking this no-op code as
  BURN_BRIDGES, just remove it.  Adjust comments.
  
  Reviewed by:	dwhite, emaste, battlez

Modified:
  head/sys/netinet6/ip6_output.c
  head/sys/netinet6/route6.c

Modified: head/sys/netinet6/ip6_output.c
==============================================================================
--- head/sys/netinet6/ip6_output.c	Sat May  9 18:09:18 2009	(r191941)
+++ head/sys/netinet6/ip6_output.c	Sat May  9 18:25:58 2009	(r191942)
@@ -435,34 +435,11 @@ skip_ipsec2:;
 #endif /* IPSEC */
 
 	/*
-	 * If there is a routing header, replace the destination address field
-	 * with the first hop of the routing header.
+	 * If there is a routing header, discard the packet.
 	 */
 	if (exthdrs.ip6e_rthdr) {
-		struct ip6_rthdr *rh =
-			(struct ip6_rthdr *)(mtod(exthdrs.ip6e_rthdr,
-						  struct ip6_rthdr *));
-
-		/*
-		 * While this switch may look gratuitous, leave it in
-		 * in favour of RH2 implementations, etc.
-		 */
-		switch (rh->ip6r_type) {
-#ifndef BURN_BRIDGES
-		case IPV6_RTHDR_TYPE_0:
-			/*
-			 * According to RFC 5095 we should not implement
-			 * it in any way but we may want to give the user
-			 * a hint for now.
-			 */
-			log(LOG_INFO, "[%s:%d] IPv6 Type 0 Routing Headers are "
-			    "deprecated.\n", __func__, __LINE__);
-			/* FALLTHROUGH */
-#endif
-		default:	/* is it possible? */
-			 error = EINVAL;
-			 goto bad;
-		}
+		 error = EINVAL;
+		 goto bad;
 	}
 
 	/* Source address validation */

Modified: head/sys/netinet6/route6.c
==============================================================================
--- head/sys/netinet6/route6.c	Sat May  9 18:09:18 2009	(r191941)
+++ head/sys/netinet6/route6.c	Sat May  9 18:25:58 2009	(r191942)
@@ -95,15 +95,6 @@ route6_input(struct mbuf **mp, int *offp
 	 * in favour of RH2 implementations, etc.
 	 */
 	switch (rh->ip6r_type) {
-#ifndef BURN_BRIDGES
-	case IPV6_RTHDR_TYPE_0:
-		/*
-		 * According to RFC 5095, 3.  Deprecation of RH0,
-		 * we must handle RH0 like the default (unknown
-		 * routing header type) case.
-		 */
-		/* FALLTHROUGH */
-#endif
 	default:
 		/* Unknown routing header type. */
 		if (rh->ip6r_segleft == 0) {


More information about the svn-src-all mailing list