From: fendo Date: Sun, 21 Sep 2014 11:59:08 +0000 (+0200) Subject: Fix: IPv6 prefix routing on slave cluster X-Git-Tag: 2.2.1-2fdn3.16~1 X-Git-Url: http://git.sameswireless.fr/l2tpns.git/commitdiff_plain/97bada26aa745e67f3fa0bc85bdd1890323c0bc0?ds=sidebyside;hp=9f212cfbee7ed43d5c5ba35ad00dfa84ec86759d Fix: IPv6 prefix routing on slave cluster --- diff --git a/l2tpns.c b/l2tpns.c index dd1e8ae..14892f7 100644 --- a/l2tpns.c +++ b/l2tpns.c @@ -982,7 +982,6 @@ static sessionidt lookup_ipv6map(struct in6_addr ip) int s; char ipv6addr[INET6_ADDRSTRLEN]; - curnode = &ipv6_hash[ip.s6_addr[0]]; curnode = &ipv6_hash[((ip.s6_addr[0]) & 0xF0)>>4]; i = 1; s = curnode->sess; @@ -5916,9 +5915,12 @@ int load_session(sessionidt s, sessiont *new) } // check v6 routing - for (i = 0; i < MAXROUTE6 && new->route6[i].ipv6prefixlen; i++) + if (new->ppp.ipv6cp == Opened && session[s].ppp.ipv6cp != Opened) { - route6set(s, new->route6[i].ipv6route, new->route6[i].ipv6prefixlen, 1); + for (i = 0; i < MAXROUTE6 && new->route6[i].ipv6prefixlen; i++) + { + route6set(s, new->route6[i].ipv6route, new->route6[i].ipv6prefixlen, 1); + } } if (new->ipv6address.s6_addr[0] && new->ppp.ipv6cp == Opened && session[s].ppp.ipv6cp != Opened)