Hi Matti,

thanks for the patches. A few notes though:
I don't particularly like the dhcp-approach. Including the script directly looks hackish and also it wouldn't work for DHCP and RA/DHCPv6 in parallel. Instead I would suggest to bring up the interface without any addresses and at the end of the protocol handler launch two subprotocols for dhcp and dhcpv6 respecitely. This way we avoid hacking around with the dhcp-handler.

To do this add something like this at the end of your setup_interface after the proto_send_update call:

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

and then the same just with "dhcp" replaced by "dhcpv6".


The second point would be that strictly speaking uci_set_state is deprecated. But I can understand why you used it here. We might want to think into other solutions at some point, i.e. add a kind of daemon mode to uqmi which handles the whole process and also avoids those nasty while - sleep loops.


Cheers,

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

Reply via email to