summaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/ip6_input.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index 41e2e68edac..f5216ceaa5f 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_input.c,v 1.88 2008/10/15 19:12:18 blambert Exp $ */
+/* $OpenBSD: ip6_input.c,v 1.89 2008/11/02 10:37:29 claudio Exp $ */
/* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */
/*
@@ -210,7 +210,7 @@ ip6_input(struct mbuf *m)
#if NPF > 0
struct in6_addr odst;
#endif
- int srcrt = 0, rtableid = 0;
+ int srcrt = 0, rtableid = 0, isanycast = 0;
/*
* mbuf statistics by kazu
@@ -496,7 +496,7 @@ ip6_input(struct mbuf *m)
struct in6_ifaddr *ia6 =
(struct in6_ifaddr *)ip6_forward_rt.ro_rt->rt_ifa;
if (ia6->ia6_flags & IN6_IFF_ANYCAST)
- m->m_flags |= M_ANYCAST6;
+ isanycast = 1;
/*
* packets to a tentative, duplicated, or somehow invalid
* address must not be accepted.
@@ -716,6 +716,18 @@ ip6_input(struct mbuf *m)
goto bad;
}
+ /* draft-itojun-ipv6-tcp-to-anycast */
+ if (isanycast && nxt == IPPROTO_TCP) {
+ if (m->m_len >= sizeof(struct ip6_hdr)) {
+ ip6 = mtod(m, struct ip6_hdr *);
+ icmp6_error(m, ICMP6_DST_UNREACH,
+ ICMP6_DST_UNREACH_ADDR,
+ (caddr_t)&ip6->ip6_dst - (caddr_t)ip6);
+ break;
+ } else
+ goto bad;
+ }
+
nxt = (*inet6sw[ip6_protox[nxt]].pr_input)(&m, &off, nxt);
}
return;
@@ -723,7 +735,6 @@ ip6_input(struct mbuf *m)
m_freem(m);
}
-
/* scan packet for RH0 routing header. Mostly stolen from pf.c:pf_test6() */
int
ip6_check_rh0hdr(struct mbuf *m)