diff options
author | ume <ume@FreeBSD.org> | 2003-10-21 20:05:32 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2003-10-21 20:05:32 +0000 |
commit | 5199c863f8f9e7f134710595dee582ad037bffb6 (patch) | |
tree | 56bbb38b63af457fee9d7a7dcb4dabbee7fdf438 /sys/netinet6/ip6_forward.c | |
parent | cf8253f2389748ecf024ef70a17807c7d6d733ee (diff) | |
download | FreeBSD-src-5199c863f8f9e7f134710595dee582ad037bffb6.zip FreeBSD-src-5199c863f8f9e7f134710595dee582ad037bffb6.tar.gz |
- change scope to zone.
- change node-local to interface-local.
- better error handling of address-to-scope mapping.
- use in6_clearscope().
Obtained from: KAME
Diffstat (limited to 'sys/netinet6/ip6_forward.c')
-rw-r--r-- | sys/netinet6/ip6_forward.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index 3cc812e..7e847e9 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -114,6 +114,7 @@ ip6_forward(m, srcrt) int error, type = 0, code = 0; struct mbuf *mcopy = NULL; struct ifnet *origifp; /* maybe unnecessary */ + u_int32_t srczone, dstzone; #ifdef IPSEC struct secpolicy *sp = NULL; #endif @@ -360,8 +361,9 @@ ip6_forward(m, srcrt) * unreachable error with Code 2 (beyond scope of source address). * [draft-ietf-ipngwg-icmp-v3-02.txt, Section 3.1] */ - if (in6_addr2scopeid(m->m_pkthdr.rcvif, &ip6->ip6_src) != - in6_addr2scopeid(rt->rt_ifp, &ip6->ip6_src)) { + if (in6_addr2zoneid(m->m_pkthdr.rcvif, &ip6->ip6_src, &srczone) || + in6_addr2zoneid(rt->rt_ifp, &ip6->ip6_src, &dstzone) || + srczone != dstzone) { ip6stat.ip6s_cantforward++; ip6stat.ip6s_badscope++; in6_ifstat_inc(rt->rt_ifp, ifs6_in_discard); |