Add support for unspecified IPv6 gateway address 92/275092/1 accepted/tizen/unified/20220524.050423 submit/tizen/20220517.032025 submit/tizen/20220518.041030
authorJaehyun Kim <jeik01.kim@samsung.com>
Mon, 16 May 2022 12:24:09 +0000 (21:24 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Mon, 16 May 2022 12:24:09 +0000 (21:24 +0900)
Unspecified gateway address("::") is not permitted
when setting routing table.
So, if this value is passed, it must be handled appropriately.

Change-Id: If04df42fc0d6233bfca79e62efb80c8a1024e7c4
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
src/utils/util.c

index 4eba47a..b39171e 100755 (executable)
@@ -850,7 +850,7 @@ int netconfig_add_route_ipv6(gchar *ip_addr, gchar *interface, gchar *gateway, u
                return -1;
        }
 
-       if (gateway != NULL) {
+       if (gateway != NULL && g_strcmp0(gateway, "::") != 0) {
                rt.rtmsg_flags |= RTF_GATEWAY;
                if (inet_pton(AF_INET6, gateway, &rt.rtmsg_gateway) < 0) {
                        DBG("inet_pton failed : %s",