[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: [PATCH] busybox: Update udhcpc.script for DHCPv6
From: Bernhard Reutner-Fischer <rep.dot.nop () gmail ! com>
Date: 2018-06-18 6:55:26
Message-ID: 55AE6850-3904-43FB-A742-FC18BA1D90E2 () gmail ! com
[Download RAW message or body]
On 18 June 2018 04:09:55 CEST, Samuel Mendoza-Jonas <sam@mendozajonas.com> wrote:
>udhcpc6 will call the default script with the address set in the "ipv6"
>variable. Set "ip" to this address if present.
>
>Also from Rob, if handling a DHCPv6 address wait a moment for the IPv6
>route to be configured; this doesn't come from DHCPv6 but rather the
>IPv6 Router Advertisement (RA).
>
>(wait for IPv6 route)
>From: Robert Lippert <rlippert@google.com>
>Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
>---
> package/busybox/udhcpc.script | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
>diff --git a/package/busybox/udhcpc.script
>b/package/busybox/udhcpc.script
>index ad110d3a7f..9613d00e81 100755
>--- a/package/busybox/udhcpc.script
>+++ b/package/busybox/udhcpc.script
>@@ -8,6 +8,16 @@ RESOLV_CONF="/etc/resolv.conf"
> [ -e $RESOLV_CONF ] || touch $RESOLV_CONF
> [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
> [ -n "$subnet" ] && NETMASK="netmask $subnet"
>+[ -n "$ipv6" ] && ip="$ipv6/128"
>+
>+wait_for_ipv6_default_route() {
>+ attempts=10
>+ while [ $attempts != 0 ] && [ -z "$(ip -6 route list | grep default)"
>] ; do
>+ sleep 1
>+ let attempts="$attempts-1"
No non-portable extensions please.
attempts=$(($attempts-1))
>+ done
>+ [ $attempts == 0 ] && echo "failed to get default ipv6 route"
the double equal operator is removed from test(1).
Please use the shorter and correct equality operator.
Thanks.
>+}
>
> case "$1" in
> deconfig)
>@@ -37,6 +47,10 @@ case "$1" in
> /usr/sbin/avahi-autoipd -k $interface
> fi
> /sbin/ifconfig $interface $ip $BROADCAST $NETMASK
>+ if [ -n "$ipv6" ] ; then
>+ echo "waiting for default ipv6 route set"
>+ wait_for_ipv6_default_route
>+ fi
>
> if [ -n "$router" ] ; then
> echo "deleting routers"
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic