Skip to content

Commit 5c61fd7

Browse files
RN97lnykryn
authored andcommitted
network-functions: Fix a bug in is_nm_handling()
Currently the "^" anchor is applied to the "connected" case and does not apply to the "connecting" case in the grep due to the way the brackets () are placed. This can cause the grep statement to incorrectly return a match. For ex: When trying to check for eth0 using is_nm_handling(), "bondeth0:connecting" would also match the grep and return incorrectly. Signed-off-by: Rohit Nair <[email protected]>
1 parent 79ec530 commit 5c61fd7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

network-scripts/network-functions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ is_nm_active ()
302302

303303
is_nm_handling ()
304304
{
305-
LANG=C nmcli -t --fields device,state dev status 2>/dev/null | grep -q "^\(${1}:connected\)\|\(${1}:connecting.*\)$"
305+
LANG=C nmcli -t --fields device,state dev status 2>/dev/null | grep -q "^\(${1}:connected\|${1}:connecting.*\)$"
306306
}
307307

308308
is_nm_device_unmanaged ()

0 commit comments

Comments
 (0)