uint32_t tx_dropped;
GSList *address_list;
- char *gateway;
+ char *ipv4_gateway;
+ char *ipv6_gateway;
struct connman_ipconfig *config;
connman_ipconfig_unref(ipdevice->config);
free_address_list(ipdevice);
- g_free(ipdevice->gateway);
+ g_free(ipdevice->ipv4_gateway);
+ g_free(ipdevice->ipv6_gateway);
g_free(ipdevice->address);
g_free(ipdevice->ifname);
if (scope == 0 && g_strcmp0(dst, "0.0.0.0") == 0) {
GSList *list;
- g_free(ipdevice->gateway);
- ipdevice->gateway = g_strdup(gateway);
+ if (family == AF_INET6) {
+ g_free(ipdevice->ipv6_gateway);
+ ipdevice->ipv6_gateway = g_strdup(gateway);
+ } else {
+ g_free(ipdevice->ipv4_gateway);
+ ipdevice->ipv4_gateway = g_strdup(gateway);
+ }
if (ipdevice->config != NULL &&
ipdevice->config->system != NULL) {
if (scope == 0 && g_strcmp0(dst, "0.0.0.0") == 0) {
GSList *list;
- g_free(ipdevice->gateway);
- ipdevice->gateway = NULL;
+ if (family == AF_INET6) {
+ g_free(ipdevice->ipv6_gateway);
+ ipdevice->ipv6_gateway = NULL;
+ } else {
+ g_free(ipdevice->ipv4_gateway);
+ ipdevice->ipv4_gateway = NULL;
+ }
if (ipdevice->config != NULL &&
ipdevice->config->system != NULL) {
if (ipdevice == NULL)
return NULL;
- if (ipdevice->gateway != NULL)
- return ipdevice->gateway;
+ if (ipdevice->ipv4_gateway != NULL)
+ return ipdevice->ipv4_gateway;
if (ipdevice->config != NULL &&
ipdevice->config->address != NULL)