diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2020-04-15 15:16:11 +0200 |
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2024-01-29 14:52:32 +0100 |
| commit | 51cb6aee4b699d4f2fcf0f913a15cbbc6ff11598 (patch) | |
| tree | 766bbe0a781462d7e79a01a9dd0bdd8afc919bb1 /zebra/interface.c | |
| parent | f8755d7f866d4ae74d01b2ef9baa6829bdb99f63 (diff) | |
zebra: fix speed set to UINT32_MAX
get_iflink_speed() returns UINT32_MAX when the speeds is unknown.
Routing daemons (at least ospfd) interprets it as the high value.
Return errors in get_iflink_speed() to avoid the confusion.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'zebra/interface.c')
| -rw-r--r-- | zebra/interface.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index 6e33d7ec7d..6624eb2591 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -62,7 +62,7 @@ static void if_zebra_speed_update(struct event *thread) * interfaces not available. * note that loopback & virtual interfaces can return 0 as speed */ - if (error < 0) + if (error == INTERFACE_SPEED_ERROR_READ) return; if (new_speed != ifp->speed) { @@ -73,7 +73,7 @@ static void if_zebra_speed_update(struct event *thread) changed = true; } - if (changed || new_speed == UINT32_MAX) { + if (changed || error == INTERFACE_SPEED_ERROR_UNKNOWN) { #define SPEED_UPDATE_SLEEP_TIME 5 #define SPEED_UPDATE_COUNT_MAX (4 * 60 / SPEED_UPDATE_SLEEP_TIME) /* @@ -88,7 +88,7 @@ static void if_zebra_speed_update(struct event *thread) * to not update the system to keep track of that. This * is far simpler to just stop trying after 4 minutes */ - if (new_speed == UINT32_MAX && + if (error == INTERFACE_SPEED_ERROR_UNKNOWN && zif->speed_update_count == SPEED_UPDATE_COUNT_MAX) return; |
