Skip to content

Commit

Permalink
router: skip warning when configured lifetime is 0
Browse files Browse the repository at this point in the history
The configured lifetime is overridden to be 0 in certain cases where
advertising a positive lifetime is not sensible. A log warning is only
warranted if the user was not already aware of this condition and
erroneously set the lifetime to a positive value.

If the user acknoledges these conditions by manually configuring a 0
lifetime, we should not warn them of the override.
  • Loading branch information
rpigott committed Dec 9, 2023
1 parent d8118f6 commit 6ca8988
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/router.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr

if (default_route && valid_prefix) {
adv.h.nd_ra_router_lifetime = htons(lifetime < UINT16_MAX ? lifetime : UINT16_MAX);
} else {
} else if (lifetime) {
adv.h.nd_ra_router_lifetime = 0;

if (default_route) {
Expand Down

0 comments on commit 6ca8988

Please sign in to comment.