[PATCH] netifd: system-linux: add dev_type info for ubus network.device status

Florian Eckert fe at dev.tdt.de
Tue Dec 7 03:49:05 PST 2021


Hello Jo

> imho these types are not that useful in practice (e.g. tap devices etc. 
> are
> all reported as "ethernet". Maybe expose /sys/class/net/$devname/uevent
> DEVTYP= instead.

I have now taken a look at your suggestion.
Unfortunately, I found that not all network interfaces have set the 
DEVTYPE
attribute set in their uevent file. I have not yet found any information
who sets this value. Does this do the driver or the subsystem?
I need to do some more research

The following devices does have this DEVTYPE attribute set on my targets

root at st-dev-07 /sys/class/net # cat docker0/uevent
DEVTYPE=bridge
INTERFACE=docker0
IFINDEX=16

root at st-dev-07 /sys/class/net # cat wlan0/uevent
DEVTYPE=wlan
INTERFACE=wlan0
IFINDEX=14

root at st-dev-07 /sys/class/net # cat wwan0/uevent
DEVTYPE=wwan
INTERFACE=wwan0
IFINDEX=5

root at VR2-120770 ~ # cat /sys/class/net/pppoe-xdsl/uevent
DEVTYPE=ppp
INTERFACE=pppoe-xdsl
IFINDEX=2285
root at VR2-120770 ~ #


The following devices does *not* have this DEVTYPE attribute set on my 
targets:

root at st-dev-07 /sys/class/net # cat eth0/uevent
INTERFACE=eth0
IFINDEX=2

root at st-dev-07 /sys/class/net # cat sit0/uevent
INTERFACE=sit0
IFINDEX=7

root at st-dev-07 /sys/class/net # cat ip6_vti0/uevent
INTERFACE=ip6_vti0
IFINDEX=9

The question now if this DEVTYPE is not set what should we do?
Set now `dev_type` value in the ubus output til we update this in the 
Kernel?

Regards

Florian



More information about the openwrt-devel mailing list