kernel-netlink: Check return value of both halfs when installing default route in...
authorTobias Brunner <tobias@strongswan.org>
Mon, 17 Sep 2018 13:56:48 +0000 (15:56 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 17 Sep 2018 16:51:41 +0000 (18:51 +0200)
src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c

index c9a76ba..760a875 100644 (file)
@@ -2586,11 +2586,11 @@ static status_t manage_srcroute(private_kernel_netlink_net_t *this,
                memset(half_net.ptr, 0, half_net.len);
                half_prefixlen = 1;
 
-               status = manage_srcroute(this, nlmsg_type, flags, half_net, half_prefixlen,
-                                       gateway, src_ip, if_name);
+               status = manage_srcroute(this, nlmsg_type, flags, half_net,
+                                                                half_prefixlen, gateway, src_ip, if_name);
                half_net.ptr[0] |= 0x80;
-               status = manage_srcroute(this, nlmsg_type, flags, half_net, half_prefixlen,
-                                       gateway, src_ip, if_name);
+               status |= manage_srcroute(this, nlmsg_type, flags, half_net,
+                                                                 half_prefixlen, gateway, src_ip, if_name);
                return status;
        }