6to4: add netifd support
[openwrt/openwrt.git] / package / 6to4 / files / 6to4.hotplug
index 1e3d26c418843cfd763d3ef50958d43f020edd6c..202a3c737cdc20e6fc0f0fd98f799a24c1cf9969 100644 (file)
@@ -3,6 +3,9 @@
 if [ "$ACTION" = ifup ]; then
        . /etc/functions.sh
 
+       INCLUDE_ONLY=1
+       . /lib/netifd/proto/6to4.sh
+
        include /lib/network
        scan_interfaces
 
@@ -19,15 +22,7 @@ if [ "$ACTION" = ifup ]; then
 
                local wanip=$(find_6to4_wanip "$wandev")
 
-               [ -n "$wanip" ] && {
-                       lsmod | grep -q ^sit || {
-                               logger -t 6to4 "Tunneling driver not loaded yet, deferring action"
-                               exit 0
-                       }
-
-                       uci_set_state network "$cfg" ipaddr "$wanip"
-                       ( ifup "$cfg" )&
-               }
+               [ -n "$wanip" ] && ifup "$cfg"
        }
 
        config_foreach update_tunnel interface