[network-manager-openvpn] helper: fix ipv4 route gateway evaluation



commit e4d8cda14483b3195dbf2a9d61c565f426108ea3
Author: Beniamino Galvani <bgalvani redhat com>
Date:   Wed Oct 4 18:12:46 2017 +0200

    helper: fix ipv4 route gateway evaluation
    
    Fixes: da99ab02cb3d0d0c8a55c338cd0c5c1392ece850
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788514

 src/nm-openvpn-service-openvpn-helper.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/nm-openvpn-service-openvpn-helper.c b/src/nm-openvpn-service-openvpn-helper.c
index 0658e9e..d6c3302 100644
--- a/src/nm-openvpn-service-openvpn-helper.c
+++ b/src/nm-openvpn-service-openvpn-helper.c
@@ -234,7 +234,7 @@ get_ip4_routes (void)
                char key_name[255];
                in_addr_t network;
                in_addr_t netmask;
-               in_addr_t gateway;
+               in_addr_t gateway = 0;
                guint32 metric;
 
                nm_sprintf_buf (key_name, "route_network_%u", i);
@@ -262,8 +262,7 @@ get_ip4_routes (void)
                    && inet_pton (AF_INET, tmp, &gateway) != 1) {
                        _LOGW ("Ignoring invalid static route gateway %s = \"%s\"", key_name, tmp);
                        continue;
-               } else
-                       gateway = 0;
+               }
 
                nm_sprintf_buf (key_name, "route_metric_%u", i);
                tmp = getenv (key_name);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]