1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-10 01:17:44 +03:00

network: 'cur' variable cannot be null, so simplify code

This commit is contained in:
Benjamin Robin 2020-05-09 21:19:12 +02:00
parent b9c54c4665
commit 81c5a5961f

View File

@ -590,8 +590,7 @@ _public_ int sd_radv_add_prefix(sd_radv *ra, sd_radv_prefix *p, int dynamic) {
cur->valid_until = valid_until;
cur->preferred_until = preferred_until;
log_radv("%s prefix %s/%u preferred %s valid %s",
cur? "Updated": "Added",
log_radv("Updated prefix %s/%u preferred %s valid %s",
addr_p, p->opt.prefixlen,
format_timespan(time_string_preferred, FORMAT_TIMESPAN_MAX,
preferred, USEC_PER_SEC),
@ -691,8 +690,7 @@ _public_ int sd_radv_add_route_prefix(sd_radv *ra, sd_radv_route_prefix *p, int
if (valid_until == USEC_INFINITY)
return -EOVERFLOW;
log_radv("%s route prefix %s/%u valid %s",
cur? "Updated": "Added",
log_radv("Updated route prefix %s/%u valid %s",
strempty(pretty), p->opt.prefixlen,
format_timespan(time_string_valid, FORMAT_TIMESPAN_MAX, valid, USEC_PER_SEC));