Skip to content

Commit e7db38c

Browse files
yoshfujidavem330
authored andcommitted
ipv6 sit: Fix 6rd relay address.
ipv6 sit: Fix 6rd relay address. Relay's address should be extracted from real IPv6 address instead of configured prefix. Signed-off-by: YOSHIFUJI Hideaki <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e0c9394 commit e7db38c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/ipv6/sit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,12 +569,12 @@ __be32 try_6rd(struct in6_addr *v6dst, struct ip_tunnel *tunnel)
569569
pbw0 = tunnel->ip6rd.prefixlen >> 5;
570570
pbi0 = tunnel->ip6rd.prefixlen & 0x1f;
571571

572-
d = (ntohl(tunnel->ip6rd.prefix.s6_addr32[pbw0]) << pbi0) >>
572+
d = (ntohl(v6dst->s6_addr32[pbw0]) << pbi0) >>
573573
tunnel->ip6rd.relay_prefixlen;
574574

575575
pbi1 = pbi0 - tunnel->ip6rd.relay_prefixlen;
576576
if (pbi1 > 0)
577-
d |= ntohl(tunnel->ip6rd.prefix.s6_addr32[pbw0 + 1]) >>
577+
d |= ntohl(v6dst->s6_addr32[pbw0 + 1]) >>
578578
(32 - pbi1);
579579

580580
dst = tunnel->ip6rd.relay_prefix | htonl(d);

0 commit comments

Comments
 (0)