From: <abe...@us...> - 2017-05-12 14:25:04
|
Revision: 8300 http://sourceforge.net/p/astlinux/code/8300 Author: abelbeck Date: 2017-05-12 14:25:02 +0000 (Fri, 12 May 2017) Log Message: ----------- network, try to wait (up to 10secs) for the DHCPv6 response to be received on startup, always create /var/db/dhcp6c_cache file even if a user script is not defined Modified Paths: -------------- branches/1.0/package/wide-dhcpv6/dhcp6c.script branches/1.0/project/astlinux/target_skeleton/etc/init.d/network Modified: branches/1.0/package/wide-dhcpv6/dhcp6c.script =================================================================== --- branches/1.0/package/wide-dhcpv6/dhcp6c.script 2017-05-11 23:53:44 UTC (rev 8299) +++ branches/1.0/package/wide-dhcpv6/dhcp6c.script 2017-05-12 14:25:02 UTC (rev 8300) @@ -128,8 +128,11 @@ fi } +## Setup environmental variables +## Create dhcp6c_cache file +setup_env + if [ -x $SCRIPTFILE ]; then - setup_env export dhcp6c_interface dhcp6c_address dhcp6c_changed export dhcp6c_prefix_interfaces dhcp6c_prefix_addresses export dhcp6c_prefix dhcp6c_prefix_base dhcp6c_prefix_len Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/network =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2017-05-11 23:53:44 UTC (rev 8299) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2017-05-12 14:25:02 UTC (rev 8300) @@ -62,7 +62,6 @@ interface $interface { send ia-na 1; send rapid-commit; - script \"/etc/dhcp6c.script\"; }; id-assoc na 1 { };" @@ -645,7 +644,7 @@ fi if [ "$IPV6" = "yes" ]; then if [ "$DHCPV6_CLIENT_ENABLE" = "yes" ]; then - up_delay=4 + up_delay=10 init_dhcp6c extif $EXTIF ifplugd -apq -t2 -u3 -d3 -i $EXTIF -r /etc/ifplugd/dhcp6c.action fi @@ -656,9 +655,10 @@ fi fi ip link set dev $EXTIF up - if [ $up_delay -gt 0 ]; then - sleep $up_delay - fi + while [ $up_delay -gt 0 ] && [ ! -f /var/db/dhcp6c_cache ]; do + up_delay=$((up_delay - 1)) + sleep 1 + done ;; esac @@ -702,14 +702,20 @@ #DHCP if [ -n "$EXTIF" -a -z "$EXTIP" ] && ! isextppp extif; then + up_delay=0 ip link set dev $EXTIF up sleep 4 if [ "$IPV6" = "yes" -a "$DHCPV6_CLIENT_ENABLE" = "yes" ]; then + up_delay=10 init_dhcp6c extif $EXTIF dhcp6c -c /etc/wide-dhcpv6/dhcp6c-$EXTIF.conf -p /var/run/dhcp6c-$EXTIF.pid $EXTIF fi udhcpc -b -T2 -t6 -S -s /etc/udhcpc.script -H $HOSTNAME -p /var/run/udhcpc-$EXTIF.pid -i $EXTIF ifplugd -apq -t2 -u3 -d3 -i $EXTIF -r /etc/ifplugd/udhcpc.action + while [ $up_delay -gt 0 ] && [ ! -f /var/db/dhcp6c_cache ]; do + up_delay=$((up_delay - 1)) + sleep 1 + done # No DHCPv6 - Static IPv6 if defined if [ "$IPV6" = "yes" ] && [ "$DHCPV6_CLIENT_ENABLE" != "yes" -o "$DHCPV6_CLIENT_REQUEST_ADDRESS" = "no" ]; then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |