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...".
This commit is contained in:
Lubomir Rintel 2015-07-14 12:51:49 +02:00
parent 421cf84343
commit da612acc6a

View file

@ -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);