Author: jow
Date: 2015-01-23 23:19:29 +0100 (Fri, 23 Jan 2015)
New Revision: 44092

Modified:
   trunk/package/network/config/netifd/files/lib/netifd/dhcp.script
Log:
netifd: store additional DHCP lease information

Extend the DHCPv4 handler script to store additional information from the
DHCP lease in the per-interface data object.

Signed-off-by: Jo-Philipp Wich <[email protected]>

Modified: trunk/package/network/config/netifd/files/lib/netifd/dhcp.script
===================================================================
--- trunk/package/network/config/netifd/files/lib/netifd/dhcp.script    
2015-01-23 13:09:54 UTC (rev 44091)
+++ trunk/package/network/config/netifd/files/lib/netifd/dhcp.script    
2015-01-23 22:19:29 UTC (rev 44092)
@@ -34,7 +34,13 @@
        done
 
        proto_add_data
-       [ -n "$ZONE" ] && json_add_string zone "$ZONE"
+       [ -n "$ZONE" ]     && json_add_string zone "$ZONE"
+       [ -n "$ntpsrv" ]   && json_add_string ntpserver "$ntpsrv"
+       [ -n "$timesvr" ]  && json_add_string timeserver "$timesvr"
+       [ -n "$hostname" ] && json_add_string hostname "$hostname"
+       [ -n "$message" ]  && json_add_string message "$message"
+       [ -n "$timezone" ] && json_add_int timezone "$timezone"
+       [ -n "$lease" ]    && json_add_int leasetime "$lease"
        proto_close_data
 
        proto_send_update "$INTERFACE"
@@ -69,12 +75,6 @@
 
                ubus call network add_dynamic "$(json_dump)"
        fi
-
-       # TODO
-       # [ -n "$ntpsrv" ] &&   change_state network "$ifc" lease_ntpsrv 
"$ntpsrv"
-       # [ -n "$timesvr" ] &&  change_state network "$ifc" lease_timesrv 
"$timesvr"
-       # [ -n "$hostname" ] && change_state network "$ifc" lease_hostname 
"$hostname"
-       # [ -n "$timezone" ] &&         change_state network "$ifc" 
lease_timezone "$timezone"
 }
 
 deconfig_interface() {
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to