Hi!

I have a situation where I have to react to "ifup" events in OpenWRT,
and I believe that QMI/NCM/MBIM interfaces are sending the "ifup" event
too early, which is before they got an IP address. That is due to the
use of "sub-interfaces" for DHCP IPv4 and DHCP IPv6, as seen in the
/lib/netifd/proto/[ncm|qmi|mbim].sh scripts:

        echo "Starting DHCP"
        proto_init_update "$ifname" 1
        proto_send_update "$interface"

        json_init
        json_add_string name "${interface}_4"
        json_add_string ifname "@$interface"
        json_add_string proto "dhcp"
        json_close_object
        ubus call network add_dynamic "$(json_dump)"

        json_init
        json_add_string name "${interface}_6"
        json_add_string ifname "@$interface"
        json_add_string proto "dhcpv6"
        json_close_object
        ubus call network add_dynamic "$(json_dump)"

Here the "main" interface is marked "up" before the sub-interfaces
"xyz_4" or "xyz_6" are added or got an IP address.

Normally, a WAN, WLAN or a 3G (PPP) interface is only "up" after it got
an IP and when we can start sending data thru it. Also I can not always
trigger on the "xyz_4" interface because in the 3G/PPP case the IP is
directly assigned to "xyz" and no "xyz_4" exists...

Is there any way in netifd that we could avoid the use of the
sub-interfaces here (other interfaces also may have DHCP and DHCPv6 IP
assignement without sub-interface, IMHO), or that the main interface
will only be "up" when at least one of the sub-interfaces is up?

Any pointers welcome, I'm ready to "mess" with the code as well... :)

bruno
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to