1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
Fix handling IFF_UP && !IFF_RUNNING in ST_DOWN state
When netplugd has interface in ST_DOWN state and interface has IFF_UP flag
set but not IFF_RUNNING flag then it is never moved into ST_INACTIVE state.
This is because of error in FALLTHROUGH logic. Fix it by manually changing
state to ST_INACTIVE after checking for IFF_UP flag and before FALLTHROUGH
to the ST_INACTIVE switch case.
diff --git a/if_info.c b/if_info.c
index d8b541e3c86d..01451629fc22 100644
--- a/if_info.c
+++ b/if_info.c
@@ -133,6 +133,7 @@ ifsm_flagpoll(struct if_info *info)
case ST_DOWN:
if ((info->flags & (IFF_UP|IFF_RUNNING)) == 0)
break;
+ info->state = ST_INACTIVE;
/* FALLTHROUGH */
case ST_INACTIVE:
if (!(info->flags & IFF_UP)) {
|