diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2015-07-14 12:51:49 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2015-07-14 13:02:15 +0200 |
commit | da612acc6a7d12115ece767d6d07e8ba54987d10 (patch) | |
tree | a194173e4cfad38665ff34f4357a369c279634b4 | |
parent | 421cf84343b436ee3624cd2c064cd8bc4d5c31d9 (diff) | |
download | NetworkManager-da612acc6a7d12115ece767d6d07e8ba54987d10.tar.gz |
linux-platform: correct the lifetime conditional
Coverity detected that it was always-true:
src/platform/nm-linux-platform.c:4035: dead_error_line: Execution cannot reach the expression "preferred != 0U" inside this statement: "if (lifetime != 0U || lifet...".
-rw-r--r-- | src/platform/nm-linux-platform.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index f866c61017..efbdbe3351 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -4031,8 +4031,8 @@ build_rtnl_addr (NMPlatform *platform, } _nl_rtnl_addr_set_prefixlen (rtnladdr, plen); - if ( lifetime != 0 || lifetime != NM_PLATFORM_LIFETIME_PERMANENT - || preferred != 0 || preferred != NM_PLATFORM_LIFETIME_PERMANENT) { + if ( (lifetime != 0 && lifetime != NM_PLATFORM_LIFETIME_PERMANENT) + || (preferred != 0 && preferred != NM_PLATFORM_LIFETIME_PERMANENT)) { /* note that here we set the relative timestamps (ticking from *now*). */ rtnl_addr_set_valid_lifetime (rtnladdr, lifetime); rtnl_addr_set_preferred_lifetime (rtnladdr, preferred); |