Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

network._get_lower do not cause "ls" error when there is no lower #1145

Merged
merged 1 commit into from
Dec 27, 2024

Conversation

ilario
Copy link
Member

@ilario ilario commented Nov 23, 2024

On a YouHua WR1200JS I could observe two error messages from ls when running lime-config:

...
network.scandevices.owrt_network_interface_parser found ifname lo
network.scandevices.owrt_network_interface_parser found ifname br-lan
network.scandevices.owrt_network_interface_parser found ifname wan
ls: /sys/class/net/wan/lower*: No such file or directory
network.scandevices.dev_parser found WAN port wan
network.scandevices.owrt_network_interface_parser found ifname wan
ls: /sys/class/net/wan/lower*: No such file or directory
network.scandevices.dev_parser found WAN port wan
network.scandevices.owrt_device_parser found base interface not_found and derived device br-lan
network.scandevices.dev_parser got nil device
...

This happens as wan on this router is the name of the physical interface, so it does not have any lower one associated.

With the applied change, the output of lime-config does not show anymore these errors.

@G10h4ck
Copy link
Member

G10h4ck commented Nov 27, 2024

Have you tested it works both detecting interfaces with lower, and interfaces without it?

@ilario
Copy link
Member Author

ilario commented Nov 28, 2024

Yes it does.
I tested on a YouHua WR1200JS.

Adding some debugging output showing the content of dev and of lower_if, the output of lime-config is the following (the result without this commit is identical, the only differences are the two additional error messages reported in the previous comment):

root@LiMe-eb7eac:~# lime-config 
Mac-config: lime-d45f25eb7eac
Clearing wireless config...
Clearing network config...
Disabling odhcpd
Cleaning dnsmasq
Disabling 6relayd...
@/usr/lib/lua/lime/hwd/openwrt_wan.lua:53 detect_hardware WAN interface: wan
network.scandevices.owrt_ifname_parser found ifname wlan0-ap
network.scandevices.dev_parser found WiFi device wlan0-ap
network.scandevices.owrt_ifname_parser found ifname wlan0-apname
network.scandevices.dev_parser found WiFi device wlan0-apname
network.scandevices.owrt_ifname_parser found ifname wlan0-mesh
network.scandevices.dev_parser found WiFi device wlan0-mesh
network.scandevices.owrt_ifname_parser found ifname wlan1-ap
network.scandevices.dev_parser found WiFi device wlan1-ap
network.scandevices.owrt_ifname_parser found ifname wlan1-apname
network.scandevices.dev_parser found WiFi device wlan1-apname
network.scandevices.owrt_ifname_parser found ifname wlan1-mesh
network.scandevices.dev_parser found WiFi device wlan1-mesh
network.scandevices.owrt_network_interface_parser found ifname lo
network.scandevices.owrt_network_interface_parser found ifname br-lan
network.scandevices.owrt_network_interface_parser found ifname wan
network._get_lower
wan
nil
network.scandevices.dev_parser found WAN port wan
network.scandevices.owrt_network_interface_parser found ifname wan
network._get_lower
wan
nil
network.scandevices.dev_parser found WAN port wan
network.scandevices.owrt_device_parser found base interface not_found and derived device br-lan
network.scandevices.dev_parser got nil device
network.scandevices.owrt_device_parser found interface br-lan with port bat0
network.scandevices.owrt_device_parser found interface br-lan with port lan1
network._get_lower
lan1
eth0
network.scandevices.dev_parser found LAN port lan1 and marking eth0 as nobridge
network.scandevices.owrt_device_parser found interface br-lan with port lan4
network._get_lower
lan4
eth0
network.scandevices.dev_parser found LAN port lan4 and marking eth0 as nobridge
network.scandevices.owrt_device_parser found interface br-lan with port lan3
network._get_lower
lan3
eth0
network.scandevices.dev_parser found LAN port lan3 and marking eth0 as nobridge
network.scandevices.owrt_device_parser found interface br-lan with port lan2
network._get_lower
lan2
eth0
network.scandevices.dev_parser found LAN port lan2 and marking eth0 as nobridge
network._get_lower
lan1
eth0
network.scandevices.dev_parser found LAN port lan1 and marking eth0 as nobridge
network._get_lower
lan2
eth0
network.scandevices.dev_parser found LAN port lan2 and marking eth0 as nobridge
network._get_lower
lan3
eth0
network.scandevices.dev_parser found LAN port lan3 and marking eth0 as nobridge
network._get_lower
lan4
eth0
network.scandevices.dev_parser found LAN port lan4 and marking eth0 as nobridge
network.scandevices.dev_parser found plain Ethernet device eth0
lime.proto.babeld.configure(...)
lime.proto.batadv.setup_interface(lan1, ...)
lime.proto.babeld.setup_interface(lan1, ...)
lime.proto.batadv.setup_interface(wlan1-ap, ...) ignored
lime.proto.babeld.setup_interface(wlan1-ap, ...) ignored
lime.proto.batadv.setup_interface(wlan0-apname, ...) ignored
lime.proto.babeld.setup_interface(wlan0-apname, ...) ignored
lime.proto.batadv.setup_interface(wlan1-apname, ...) ignored
lime.proto.babeld.setup_interface(wlan1-apname, ...) ignored
lime.proto.batadv.setup_interface(lan4, ...)
lime.proto.babeld.setup_interface(lan4, ...)
lime.proto.batadv.setup_interface(wlan0-mesh, ...)
lime.proto.babeld.setup_interface(wlan0-mesh, ...)
lime.proto.batadv.setup_interface(wlan1-mesh, ...)
lime.proto.babeld.setup_interface(wlan1-mesh, ...)
lime.proto.batadv.setup_interface(wlan0-ap, ...) ignored
lime.proto.babeld.setup_interface(wlan0-ap, ...) ignored
lime.proto.batadv.setup_interface(wan, ...)
lime.proto.babeld.setup_interface(wan, ...)
lime.proto.batadv.setup_interface(lan3, ...)
lime.proto.babeld.setup_interface(lan3, ...)
lime.proto.batadv.setup_interface(eth0, ...)
lime.proto.babeld.setup_interface(eth0, ...)
lime.proto.batadv.setup_interface(lan2, ...)
lime.proto.babeld.setup_interface(lan2, ...)
Configuring system...
Let uhttpd listen on IPv4/IPv6
Applying generic configs:
 uhttpd_https
Done applying generic configs.
Copying assets:
Done copying assets.
Running assets on ATCONFIG :
Done running assets.
executed hook:	/etc/hotplug.d/lime-config/babeld-auto-gw.lua after	0

Also, the resulting /etc/config/network is identical with or without this commit.

@G10h4ck G10h4ck merged commit 6f307bb into libremesh:master Dec 27, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants