{
if (rl)
{
- if (rl->rgi.flags & RGI_ADDR_DEFINED)
+ if (rl->ngi.flags & RGI_ADDR_DEFINED)
{
- *out = rl->rgi.gateway.addr;
+ *out = rl->ngi.gateway.addr;
}
else
{
rl->spec.flags |= RTSA_DEFAULT_METRIC;
}
- get_default_gateway(&rl->rgi, remote_host != IPV4_INVALID_ADDR ? remote_host : INADDR_ANY, ctx);
- if (rl->rgi.flags & RGI_ADDR_DEFINED)
+ get_default_gateway(&rl->ngi, INADDR_ANY, ctx);
+ if (rl->ngi.flags & RGI_ADDR_DEFINED)
{
- setenv_route_addr(es, "net_gateway", rl->rgi.gateway.addr, -1);
+ setenv_route_addr(es, "net_gateway", rl->ngi.gateway.addr, -1);
#if defined(ENABLE_DEBUG) && !defined(ENABLE_SMALL)
print_default_gateway(D_ROUTE, &rl->rgi, NULL);
#endif
dmsg(D_ROUTE, "ROUTE: default_gateway=UNDEF");
}
+ get_default_gateway(&rl->rgi, remote_host != IPV4_INVALID_ADDR ? remote_host : INADDR_ANY, ctx);
+
if (rl->spec.flags & RTSA_REMOTE_HOST)
{
rl->spec.remote_host_local = test_local_addr(remote_host, &rl->rgi);
msg(D_ROUTE, "GDG6: remote_host_ipv6=%s",
remote_host_ipv6 ? print_in6_addr(*remote_host_ipv6, 0, &gc) : "n/a");
- get_default_gateway_ipv6(&rl6->rgi6, remote_host_ipv6, ctx);
- if (rl6->rgi6.flags & RGI_ADDR_DEFINED)
+ get_default_gateway_ipv6(&rl6->ngi6, NULL, ctx);
+ if (rl6->ngi6.flags & RGI_ADDR_DEFINED)
{
- setenv_str(es, "net_gateway_ipv6", print_in6_addr(rl6->rgi6.gateway.addr_ipv6, 0, &gc));
+ setenv_str(es, "net_gateway_ipv6", print_in6_addr(rl6->ngi6.gateway.addr_ipv6, 0, &gc));
#if defined(ENABLE_DEBUG) && !defined(ENABLE_SMALL)
print_default_gateway(D_ROUTE, NULL, &rl6->rgi6);
#endif
dmsg(D_ROUTE, "ROUTE6: default_gateway=UNDEF");
}
+ get_default_gateway_ipv6(&rl6->rgi6, remote_host_ipv6, ctx);
+
if (is_route_parm_defined(remote_endpoint))
{
if (inet_pton(AF_INET6, remote_endpoint, &rl6->remote_endpoint_ipv6) == 1)
struct route_special_addr spec;
struct route_gateway_info rgi;
- unsigned int flags; /* RG_x flags */
+ struct route_gateway_info ngi; /* net_gateway */
+ unsigned int flags; /* RG_x flags */
struct route_ipv4 *routes;
struct gc_arena gc;
};
int default_metric;
struct route_ipv6_gateway_info rgi6;
- unsigned int flags; /* RG_x flags, see route_option_list */
+ struct route_ipv6_gateway_info ngi6; /* net_gateway_ipv6 */
+ unsigned int flags; /* RG_x flags, see route_option_list */
struct route_ipv6 *routes_ipv6;
struct gc_arena gc;
};