diff mbox series

[v5,1/2] busybox: Update udhcpc.script for stateful DHCPv6

Message ID 20190521025428.9409-1-sam@mendozajonas.com
State Accepted
Commit 3346048ac5ef14b411a082c56f688192ca4437e0
Headers show
Series [v5,1/2] busybox: Update udhcpc.script for stateful DHCPv6 | expand

Commit Message

Sam Mendoza-Jonas May 21, 2019, 2:54 a.m. UTC
udhcpc6 will call the default script with the address set in the "ipv6"
variable. Set "ip" to this address if present.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
---
v5: Split into two patches and added comment about stateful DHCPv6

 package/busybox/udhcpc.script | 2 ++
 1 file changed, 2 insertions(+)

Comments

Peter Korsgaard Oct. 27, 2019, 7:23 p.m. UTC | #1
>>>>> "Samuel" == Samuel Mendoza-Jonas <sam@mendozajonas.com> writes:

First of all, sorry for the slow response.

 > udhcpc6 will call the default script with the address set in the "ipv6"
 > variable. Set "ip" to this address if present.

 > Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
 > ---
 > v5: Split into two patches and added comment about stateful DHCPv6

 >  package/busybox/udhcpc.script | 2 ++
 >  1 file changed, 2 insertions(+)

 > diff --git a/package/busybox/udhcpc.script b/package/busybox/udhcpc.script
 > index ad110d3a7f..90cc6b62ba 100755
 > --- a/package/busybox/udhcpc.script
 > +++ b/package/busybox/udhcpc.script
 > @@ -8,6 +8,8 @@ RESOLV_CONF="/etc/resolv.conf"
 >  [ -e $RESOLV_CONF ] || touch $RESOLV_CONF
 >  [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
 >  [ -n "$subnet" ] && NETMASK="netmask $subnet"
 > +# Busybox's udhcpc only supports stateful DHCPv6 for now
 > +[ -n "$ipv6" ] && ip="$ipv6/128"

busybox git actually has stateless support (which will then not set
$ipv6), so I changed the comment to state:

# Handle stateful DHCPv6 like DHCPv4

And extended the commit message to explain that the /128 comes from the
stateful DHCPv6 spec, and how we can reuse the existing DHCPv4
renew/bound logic with this.

And committed, thanks.
diff mbox series

Patch

diff --git a/package/busybox/udhcpc.script b/package/busybox/udhcpc.script
index ad110d3a7f..90cc6b62ba 100755
--- a/package/busybox/udhcpc.script
+++ b/package/busybox/udhcpc.script
@@ -8,6 +8,8 @@  RESOLV_CONF="/etc/resolv.conf"
 [ -e $RESOLV_CONF ] || touch $RESOLV_CONF
 [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
 [ -n "$subnet" ] && NETMASK="netmask $subnet"
+# Busybox's udhcpc only supports stateful DHCPv6 for now
+[ -n "$ipv6" ] && ip="$ipv6/128"
 
 case "$1" in
 	deconfig)