mirror of
https://github.com/OpenVPN/openvpn.git
synced 2026-05-28 04:03:29 -04:00
Merge 258282873f into 2b8afc6c68
This commit is contained in:
commit
bd2c7663d5
1 changed files with 15 additions and 8 deletions
|
|
@ -1824,14 +1824,21 @@ add_route_ipv6(struct route_ipv6 *r6, const struct tuntap *tt, unsigned int flag
|
|||
* but for link-local destinations, we MUST specify the interface, so
|
||||
* we build a combined "$gateway%$interface" gateway string
|
||||
*/
|
||||
if (r6->iface != NULL && gateway_needed
|
||||
&& IN6_IS_ADDR_LINKLOCAL(&r6->gateway)) /* fe80::...%intf */
|
||||
{
|
||||
size_t len = strlen(gateway) + 1 + strlen(r6->iface) + 1;
|
||||
char *tmp = gc_malloc(len, true, &gc);
|
||||
snprintf(tmp, len, "%s%%%s", gateway, r6->iface);
|
||||
gateway = tmp;
|
||||
}
|
||||
if (IN6_IS_ADDR_LINKLOCAL(&r6->gateway)) { /* fe80::...%intf */
|
||||
|
||||
if (r6->iface != NULL && gateway_needed) {
|
||||
size_t len = strlen(gateway) + 1 + strlen(r6->iface)+1;
|
||||
char *tmp = gc_malloc( len, true, &gc );
|
||||
snprintf( tmp, len, "%s%%%s", gateway, r6->iface );
|
||||
gateway = tmp;
|
||||
|
||||
} else if (device) {
|
||||
size_t len = strlen(gateway) + 1 + strlen(device)+1;
|
||||
char *tmp = gc_malloc( len, true, &gc );
|
||||
snprintf( tmp, len, "%s%%%s", gateway, device );
|
||||
gateway = tmp;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
|
|
|
|||
Loading…
Reference in a new issue