File: 52iffup_stdown.patch

package info (click to toggle)
netplug 1.2.9.2-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 440 kB
  • sloc: ansic: 1,227; sh: 136; makefile: 50
file content (20 lines) | stat: -rw-r--r-- 772 bytes parent folder | download | duplicates (2)
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)) {