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...".

(cherry picked from commit da612acc6a)
This commit is contained in:
Lubomir Rintel 2015-07-14 12:51:49 +02:00
parent 57b4de25ea
commit a051446492

View file

@ -4032,8 +4032,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);