Skip to content

Commit 01ba02e

Browse files
committed
init.d/net-online: Support tun/tap devices
Added a single line that allows tun/tap interfaces to be properly handled. It turns out that /sys/class/net/${interface}/operstate shows "unknown" for tun/tap interfaces, not "up", which is the value that net-online depends on. So tun/tap interfaces need minor special handling.
1 parent a4ae231 commit 01ba02e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

init.d/net-online.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ start ()
5050
[ "$carrier" = 1 ] && : $((carriers += 1))
5151
read operstate 2> /dev/null < /sys/class/net/$dev/operstate ||
5252
operstate=
53+
[ -e /sys/class/net/$dev/tun_flags ] && operstate=up
5354
[ "$operstate" = up ] && : $((configured += 1))
5455
done
5556
[ $configured -eq $ifcount ] && [ $carriers -ge 1 ] && break

0 commit comments

Comments
 (0)