Skip to contentSkip to conversation

busybox: udhcpc: fix IPv6 support when using udhcpc

PATCH In review Stefan Agner 3 participants 11 messages May 14, 2018 – Jun 17, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 busybox: udhcpc: fix IPv6 support when using udhcpc

From: Stefan Agner <[email protected]>

The udhcpc script calls ip addr flush .. which flushes addresses of any address family, including IPv6. However, busybox udhcpc is IPv4 only and should not influence IPv6 addressing. Hence use ip addr flush with family constrait.

The script particularly broke IPv6 SLAAC: Typically when udhcpc calls the script the kernel already assigned the IPv6 link-local address. The flush removes the link-local IPv6 address again and prohibits proper IPv6 operation such as SLAAC since neighbor discovery protocol relies on IPv6 link-local addressing.

---
 meta/recipes-core/busybox/files/simple.script | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/busybox/files/simple.script +1 -1
index 6ed0293525..8b5eb53633 100644
@@ -28,7 +28,7 @@ case "$1" in
 		fi
 		if ! root_is_nfs ; then
                         if [ $have_bin_ip -eq 1 ]; then
-                                /SBIN_DIR/ip addr flush dev $interface
+                                /SBIN_DIR/ip -4 addr flush dev $interface
                                 /SBIN_DIR/ip link set dev $interface up
                         else
                                 /SBIN_DIR/ifconfig $interface 0.0.0.0
Signature · 1 line
2.13.6
#1 lore raw

Hi,

Any comment on this patch? Just stumbled upon that problem today again :-)

--
Stefan

Quoted 35 lines · Stefan Agner

From: Stefan Agner <[email protected]>

The udhcpc script calls ip addr flush .. which flushes addresses of any address family, including IPv6. However, busybox udhcpc is IPv4 only and should not influence IPv6 addressing. Hence use ip addr flush with family constrait.

The script particularly broke IPv6 SLAAC: Typically when udhcpc calls the script the kernel already assigned the IPv6 link-local address. The flush removes the link-local IPv6 address again and prohibits proper IPv6 operation such as SLAAC since neighbor discovery protocol relies on IPv6 link-local addressing.

---
 meta/recipes-core/busybox/files/simple.script | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/busybox/files/simple.script +1 -1
index 6ed0293525..8b5eb53633 100644
@@ -28,7 +28,7 @@ case "$1" in
 		fi
 		if ! root_is_nfs ; then
                         if [ $have_bin_ip -eq 1 ]; then
-                                /SBIN_DIR/ip addr flush dev $interface
+                                /SBIN_DIR/ip -4 addr flush dev $interface
                                 /SBIN_DIR/ip link set dev $interface up
                         else
                                 /SBIN_DIR/ifconfig $interface 0.0.0.0
Signature · 1 line
2.13.6
#2 lore raw
In reply to Stefan Agner

Hi all,

Quoted 23 lines · Stefan Agner

From: Stefan Agner <[email protected]>

The udhcpc script calls ip addr flush .. which flushes addresses of any address family, including IPv6. However, busybox udhcpc is IPv4 only and should not influence IPv6 addressing. Hence use ip addr flush with family constrait.

The script particularly broke IPv6 SLAAC: Typically when udhcpc calls the script the kernel already assigned the IPv6 link-local address. The flush removes the link-local IPv6 address again and prohibits proper IPv6 operation such as SLAAC since neighbor discovery protocol relies on IPv6 link-local addressing.

---
 meta/recipes-core/busybox/files/simple.script | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/busybox/files/simple.script +0 -0
index 6ed0293525..8b5eb53633 100644

meta/recipes-core/busybox/files/simple.script case "$1" in · line 34

Quoted 8 lines
meta/recipes-core/busybox/files/simple.script +1 -1
@@ -28,7 +28,7 @@ case "$1" in
 		fi
 		if ! root_is_nfs ; then
                         if [ $have_bin_ip -eq 1 ]; then
-                                /SBIN_DIR/ip addr flush dev $interface
+                                /SBIN_DIR/ip -4 addr flush dev $interface
                                 /SBIN_DIR/ip link set dev $interface up
                         else
                                 /SBIN_DIR/ifconfig $interface 0.0.0.0

Kindly pinging, happened to us as well many times.

OT: Didn't have the original mail, so hopefully getting the mbox file and answering to it didn't trigger anything weird somewhere :)

Thanks,
Quentin

#3 lore raw

Hi all,

Quoted 21 lines · Quentin Schulz

Hi all,

Quoted 18 lines · Stefan Agner

From: Stefan Agner <[email protected]>

The udhcpc script calls ip addr flush .. which flushes addresses of any address family, including IPv6. However, busybox udhcpc is IPv4 only and should not influence IPv6 addressing. Hence use ip addr flush with family constrait.

The script particularly broke IPv6 SLAAC: Typically when udhcpc calls the script the kernel already assigned the IPv6 link-local address. The flush removes the link-local IPv6 address again and prohibits proper IPv6 operation such as SLAAC since neighbor discovery protocol relies on IPv6 link-local addressing.

---
 meta/recipes-core/busybox/files/simple.script | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines

meta/recipes-core/busybox/files/simple.script case "$1" in · line 34

Quoted 13 lines
meta/recipes-core/busybox/files/simple.script +1 -1
index 6ed0293525..8b5eb53633 100644
@@ -28,7 +28,7 @@ case "$1" in
 		fi
 		if ! root_is_nfs ; then
                         if [ $have_bin_ip -eq 1 ]; then
-                                /SBIN_DIR/ip addr flush dev $interface
+                                /SBIN_DIR/ip -4 addr flush dev $interface
                                 /SBIN_DIR/ip link set dev $interface up
                         else
                                 /SBIN_DIR/ifconfig $interface 0.0.0.0

Kindly pinging, happened to us as well many times.

Kindly pinging.

Quentin

#4 lore raw
Quoted 41 lines · Quentin Schulz

Hi all,

Quoted 21 lines · Quentin Schulz

Hi all,

Quoted 18 lines · Stefan Agner

From: Stefan Agner <[email protected]>

The udhcpc script calls ip addr flush .. which flushes addresses of any address family, including IPv6. However, busybox udhcpc is IPv4 only and should not influence IPv6 addressing. Hence use ip addr flush with family constrait.

The script particularly broke IPv6 SLAAC: Typically when udhcpc calls the script the kernel already assigned the IPv6 link-local address. The flush removes the link-local IPv6 address again and prohibits proper IPv6 operation such as SLAAC since neighbor discovery protocol relies on IPv6 link-local addressing.

---
 meta/recipes-core/busybox/files/simple.script | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines

meta/recipes-core/busybox/files/simple.script case "$1" in · line 34

Quoted 13 lines
meta/recipes-core/busybox/files/simple.script +1 -1
index 6ed0293525..8b5eb53633 100644
@@ -28,7 +28,7 @@ case "$1" in
 		fi
 		if ! root_is_nfs ; then
                         if [ $have_bin_ip -eq 1 ]; then
-                                /SBIN_DIR/ip addr flush dev $interface
+                                /SBIN_DIR/ip -4 addr flush dev $interface
                                 /SBIN_DIR/ip link set dev $interface up
                         else
                                 /SBIN_DIR/ifconfig $interface 0.0.0.0

Kindly pinging, happened to us as well many times.

Quoted 1 line

Kindly pinging.

Just checked, we still override that script in our layer, so definitely would be happy if this gets merged upstream so I can get rid of our custom script downstream.

--
Stefan

#5 lore raw
Quoted 42 lines · Stefan Agner
Quoted 41 lines · Quentin Schulz

Hi all,

Quoted 37 lines · Quentin Schulz

Hi all,

Quoted 23 lines · Stefan Agner

From: Stefan Agner <[email protected]>

The udhcpc script calls ip addr flush .. which flushes addresses of any address family, including IPv6. However, busybox udhcpc is IPv4 only and should not influence IPv6 addressing. Hence use ip addr flush with family constrait.

The script particularly broke IPv6 SLAAC: Typically when udhcpc calls the script the kernel already assigned the IPv6 link-local address. The flush removes the link-local IPv6 address again and prohibits proper IPv6 operation such as SLAAC since neighbor discovery protocol relies on IPv6 link-local addressing.

---
  meta/recipes-core/busybox/files/simple.script | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/busybox/files/simple.script +0 -0
index 6ed0293525..8b5eb53633 100644

meta/recipes-core/busybox/files/simple.script case "$1" in · line 34

Quoted 8 lines
meta/recipes-core/busybox/files/simple.script +1 -1
@@ -28,7 +28,7 @@ case "$1" in
  		fi
  		if ! root_is_nfs ; then
                          if [ $have_bin_ip -eq 1 ]; then
-                                /SBIN_DIR/ip addr flush dev $interface
+                                /SBIN_DIR/ip -4 addr flush dev $interface
                                  /SBIN_DIR/ip link set dev $interface up
                          else
                                  /SBIN_DIR/ifconfig $interface 0.0.0.0

Kindly pinging, happened to us as well many times.

Quoted 6 lines
Quoted 1 line

Kindly pinging.

Just checked, we still override that script in our layer, so definitely would be happy if this gets merged upstream so I can get rid of our custom script downstream.

I think this is good to go got OE-core, but I was wondering if default script in busybox also need this and perhaps upstream too

Quoted 3 lines

--
Stefan

#6 lore raw

Hi Khem,

Quoted 8 lines · Khem Raj
Quoted 4 lines

Just checked, we still override that script in our layer, so definitely would be happy if this gets merged upstream so I can get rid of our custom script downstream.

I think this is good to go got OE-core, but I was wondering if default script in busybox also need this and perhaps upstream too

What do you mean by "default script"?
https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/busybox/files/default.script
?

Upstream could benefit from it, I'd agree. Though, it is technically just provided as an example.
https://git.busybox.net/busybox/tree/examples/udhcp/simple.script

The reason why I didn't bother to send a patch to busybox before pinging on this patch was that we're already different from the upstream simple.script so it didn't make sense to me to add the Upstream-Status: pending or something on the patch (in some ways, since it's patching the file directly and not adding a patch in SRC_URI). Anyway, digressing. Do you want a patch to be sent to busybox ML (or PR or whatever they use) before taking this patch?

Quentin

#7 lore raw
Quoted 9 lines · Quentin Schulz

Hi Khem,

Quoted 5 lines · Khem Raj
Quoted 4 lines

Just checked, we still override that script in our layer, so definitely would be happy if this gets merged upstream so I can get rid of our custom script downstream.

Quoted 7 lines
Quoted 3 lines

I think this is good to go got OE-core, but I was wondering if default script in busybox also need this and perhaps upstream too

What do you mean by "default script"?
https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/busybox/files/default.script
?

yes.

Quoted 6 lines

Upstream could benefit from it, I'd agree. Though, it is technically just provided as an example.
https://git.busybox.net/busybox/tree/examples/udhcp/simple.script

Quoted 8 lines

The reason why I didn't bother to send a patch to busybox before pinging on this patch was that we're already different from the upstream simple.script so it didn't make sense to me to add the Upstream-Status: pending or something on the patch (in some ways, since it's patching the file directly and not adding a patch in SRC_URI). Anyway, digressing. Do you want a patch to be sent to busybox ML (or PR or whatever they use) before taking this patch?

I think the problem this patch fixes is generic and somewhere the script OE has is also derived from
that example, so while the patch in itself is enough for OE, it would be better if it was in upstream too
perhaps one less thing to worry about when we cherry pick changes from upstream script in future.

Quoted 1 line

Quentin

#8 lore raw

Hi Khem,

Quoted 15 lines · Khem Raj
Quoted 13 lines · Quentin Schulz

Hi Khem,

Quoted 8 lines · Khem Raj
Quoted 4 lines

Just checked, we still override that script in our layer, so definitely would be happy if this gets merged upstream so I can get rid of our custom script downstream.

I think this is good to go got OE-core, but I was wondering if default script in busybox also need this and perhaps upstream too

Quoted 5 lines
Quoted 3 lines

What do you mean by "default script"?
https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/busybox/files/default.script
?

yes.

I'm confused then. Bear with me, I'm new to userspace so I'm sure I'm missing something rather obvious.
The content of default.script is:

exec run-parts -a "$1" /etc/udhcpc.d

AFAICT from a quick look at busybox.inc, the only things in that /etc/udhcpc.d directory are simple.script (named 50default actually) and default.script.

What do you think should be done for that file wrt the original issue?

Quoted 6 lines
Quoted 5 lines

Upstream could benefit from it, I'd agree. Though, it is technically just provided as an example.
https://git.busybox.net/busybox/tree/examples/udhcp/simple.script

@all: FYI, patch is merged:
https://git.openembedded.org/openembedded-core/commit/meta/recipes-core/busybox/files/simple.script?id=b77541dbb2f442e51842f9d24c8745a6df2d1478

Quoted 9 lines
Quoted 8 lines

The reason why I didn't bother to send a patch to busybox before pinging on this patch was that we're already different from the upstream simple.script so it didn't make sense to me to add the Upstream-Status: pending or something on the patch (in some ways, since it's patching the file directly and not adding a patch in SRC_URI). Anyway, digressing. Do you want a patch to be sent to busybox ML (or PR or whatever they use) before taking this patch?

Quoted 7 lines

I think the problem this patch fixes is generic and somewhere the script OE has is also derived from
that example, so while the patch in itself is enough for OE, it would be better if it was in upstream too
perhaps one less thing to worry about when we cherry pick changes from upstream script in future.

Agreed, I'll put it on my TODO-list. If I do not send an answer on this mail with the link to the PR or patch in the next week, anyone, please ping me.

Thx,
Quentin

#9 lore raw

Hi all,

Quoted 17 lines · Quentin Schulz
Quoted 9 lines
Quoted 8 lines

The reason why I didn't bother to send a patch to busybox before pinging on this patch was that we're already different from the upstream simple.script so it didn't make sense to me to add the Upstream-Status: pending or something on the patch (in some ways, since it's patching the file directly and not adding a patch in SRC_URI). Anyway, digressing. Do you want a patch to be sent to busybox ML (or PR or whatever they use) before taking this patch?

Quoted 7 lines

I think the problem this patch fixes is generic and somewhere the script OE has is also derived from
that example, so while the patch in itself is enough for OE, it would be better if it was in upstream too
perhaps one less thing to worry about when we cherry pick changes from upstream script in future.

Quoted 3 lines

Agreed, I'll put it on my TODO-list. If I do not send an answer on this mail with the link to the PR or patch in the next week, anyone, please ping me.

*cough* Took a bit more *cough* than a week *cough*

http://lists.busybox.net/pipermail/busybox/2020-June/088028.html

Quentin

#10 lore raw
Quoted 20 lines · Quentin Schulz

Hi all,

Quoted 17 lines · Quentin Schulz
Quoted 16 lines
Quoted 8 lines

The reason why I didn't bother to send a patch to busybox before pinging on this patch was that we're already different from the upstream simple.script so it didn't make sense to me to add the Upstream-Status: pending or something on the patch (in some ways, since it's patching the file directly and not adding a patch in SRC_URI). Anyway, digressing. Do you want a patch to be sent to busybox ML (or PR or whatever they use) before taking this patch?

I think the problem this patch fixes is generic and somewhere the script OE has is also derived from
that example, so while the patch in itself is enough for OE, it would be better if it was in upstream too
perhaps one less thing to worry about when we cherry pick changes from upstream script in future.

Quoted 7 lines
Quoted 3 lines

Agreed, I'll put it on my TODO-list. If I do not send an answer on this mail with the link to the PR or patch in the next week, anyone, please ping me.

*cough* Took a bit more *cough* than a week *cough*

http://lists.busybox.net/pipermail/busybox/2020-June/088028.html

Cool, thx for upstreaming!

--
Stefan