diff options
| author | Andrey V. Elsukov <ae@FreeBSD.org> | 2015-04-18 16:46:31 +0000 |
|---|---|---|
| committer | Andrey V. Elsukov <ae@FreeBSD.org> | 2015-04-18 16:46:31 +0000 |
| commit | 1ae800e7a6eccc8f85cd4f3219433db0770e18ac (patch) | |
| tree | 0e5523427571594a2ab2b573e2c32b8ff11753f1 /sys/netipsec/ipsec_input.c | |
| parent | 61f376155d7aadd50ad5633fac8e25536867733c (diff) | |
Notes
Diffstat (limited to 'sys/netipsec/ipsec_input.c')
| -rw-r--r-- | sys/netipsec/ipsec_input.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/netipsec/ipsec_input.c b/sys/netipsec/ipsec_input.c index 86cc5b532e8f..1eac8dbad508 100644 --- a/sys/netipsec/ipsec_input.c +++ b/sys/netipsec/ipsec_input.c @@ -195,6 +195,13 @@ ipsec_common_input(struct mbuf *m, int skip, int protoff, int af, int sproto) m_copydata(m, offsetof(struct ip6_hdr, ip6_dst), sizeof(struct in6_addr), (caddr_t) &dst_address.sin6.sin6_addr); + /* We keep addresses in SADB without embedded scope id */ + if (IN6_IS_SCOPE_LINKLOCAL(&dst_address.sin6.sin6_addr)) { + /* XXX: sa6_recoverscope() */ + dst_address.sin6.sin6_scope_id = + ntohs(dst_address.sin6.sin6_addr.s6_addr16[1]); + dst_address.sin6.sin6_addr.s6_addr16[1] = 0; + } break; #endif /* INET6 */ default: |
