[6bed4-devel] [PATCH] router: Allow traffic to the routers ipv6 address
zeroconfig IPv6 tunnel
Status: Beta
Brought to you by:
vanrein
From: <ebi...@xm...> - 2012-06-18 00:12:31
|
Don't hairpin traffic to the routers interfaceid. Signed-off-by: Eric W. Biederman <ebi...@xm...> --- router.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/router.c b/router.c index c12ee88..e7ab764 100644 --- a/router.c +++ b/router.c @@ -340,6 +340,10 @@ static inline bool prefix_6bed4 (struct in6_addr *ip6) { return memcmp (&v6listen, ip6->s6_addr, 8) == 0; } +static inline bool router_interfaceid(struct in6_addr *ip6) { + return ip6->s6_addr[10] == 0 && ip6->s6_addr[13] == 0 && + ip6->s6_addr[14] == 0 && ip6->s6_addr[15] == 0; +}; /* * Validate the originator's IPv6 address. It should match the @@ -568,7 +572,7 @@ void handle_4to6 (void) { if (v4v6hoplimit-- <= 1) { return; } - if (prefix_6bed4 (v4dst6)) { + if (prefix_6bed4 (v4dst6) && !router_interfaceid(v4dst6)) { relay_6bed4_plain_unicast (v4data, buflen, v4dst6); } else { handle_4to6_plain_unicast (buflen); -- 1.7.5.4 |