summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/ip6_output.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2009-03-03 13:12:12 +0000
committerbz <bz@FreeBSD.org>2009-03-03 13:12:12 +0000
commit59d53a5bdbf149d89096dab7127b65683cd37dfa (patch)
tree58020af4ac25be6de1b0ad90c36cc9abb21be9e9 /sys/netinet6/ip6_output.c
parentccfe8ecd4e48b6707e4c7df47a9c5aeada53b21f (diff)
downloadFreeBSD-src-59d53a5bdbf149d89096dab7127b65683cd37dfa.zip
FreeBSD-src-59d53a5bdbf149d89096dab7127b65683cd37dfa.tar.gz
Start removing IPv6 Type 0 Routing header code.
RH0 was deprecated by RFC 5095. While most of the code had been disabled by #if 0 already, leave a bit of infrastructure for possible RH2 code and a log message under BURN_BRIDGES in case a user still tries to send RH0 packets. Reviewed by: gnn (a bit back, earlier version)
Diffstat (limited to 'sys/netinet6/ip6_output.c')
-rw-r--r--sys/netinet6/ip6_output.c46
1 files changed, 15 insertions, 31 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index 80f8130..787bc12 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$");
#include <sys/protosw.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
+#include <sys/syslog.h>
#include <sys/ucred.h>
#include <sys/vimage.h>
@@ -443,40 +444,23 @@ skip_ipsec2:;
struct ip6_rthdr *rh =
(struct ip6_rthdr *)(mtod(exthdrs.ip6e_rthdr,
struct ip6_rthdr *));
- struct ip6_rthdr0 *rh0;
- struct in6_addr *addr;
- struct sockaddr_in6 sa;
+ /*
+ * 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:
- rh0 = (struct ip6_rthdr0 *)rh;
- addr = (struct in6_addr *)(rh0 + 1);
-
- /*
- * construct a sockaddr_in6 form of
- * the first hop.
- *
- * XXX: we may not have enough
- * information about its scope zone;
- * there is no standard API to pass
- * the information from the
- * application.
- */
- bzero(&sa, sizeof(sa));
- sa.sin6_family = AF_INET6;
- sa.sin6_len = sizeof(sa);
- sa.sin6_addr = addr[0];
- if ((error = sa6_embedscope(&sa,
- V_ip6_use_defzone)) != 0) {
- goto bad;
- }
- ip6->ip6_dst = sa.sin6_addr;
- bcopy(&addr[1], &addr[0], sizeof(struct in6_addr)
- * (rh0->ip6r0_segleft - 1));
- addr[rh0->ip6r0_segleft - 1] = finaldst;
- /* XXX */
- in6_clearscope(addr + rh0->ip6r0_segleft - 1);
- break;
+ /*
+ * 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;
OpenPOWER on IntegriCloud