[PATCH] ifupdown: 'prio' should have been 'metric' in static_up and static_up6

Denys Vlasenko vda.linux at googlemail.com
Mon Aug 24 18:21:53 UTC 2015


Applied, thanks!

On Mon, Aug 24, 2015 at 7:01 PM, Alex <alexinbeijing at gmail.com> wrote:
> Sending this one again...
>
> ---------- Forwarded message ----------
> From: Alex Dowad <alexinbeijing at gmail.com>
> Date: Fri, Aug 7, 2015 at 11:53 AM
> Subject: [PATCH] ifupdown: 'prio' should have been 'metric' in
> static_up and static_up6
> To: busybox at busybox.net
> Cc: ncopa at alpinelinux.org
>
>
> When a static interface with explicit gateway and metric in
> /etc/network/interfaces
> is enabled using 'ifup', and further, the BusyBox 'ip' applet is enabled, the
> following error message appears at the console (and no default route is added):
>
> ip: either "to" is duplicate, or "prio" is garbage
>
> Tracing ifup reveals that it is attempting to run the following shell command:
>
> ip route add default via <GW> dev <DEVICE> prio <METRIC>
>
> 'ip' does not understand the 'prio' argument, causing this error. With 'metric',
> it works fine.
>
> Signed-off-by: Alex Dowad <alexinbeijing at gmail.com>
> ---
>
> ncopa, I see that you originally added this code. Am I off base here? Is there
> something I'm missing? Thanks, AD
>
>  networking/ifupdown.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/networking/ifupdown.c b/networking/ifupdown.c
> index 606fc04..7c45e89 100644
> --- a/networking/ifupdown.c
> +++ b/networking/ifupdown.c
> @@ -395,7 +395,7 @@ static int FAST_FUNC static_up6(struct
> interface_defn_t *ifd, execfn *exec)
>         result = execute("ip addr add %address%/%netmask% dev
> %iface%[[ label %label%]]", ifd, exec);
>         result += execute("ip link set[[ mtu %mtu%]][[ addr
> %hwaddress%]] %iface% up", ifd, exec);
>         /* Was: "[[ ip ....%gateway% ]]". Removed extra spaces w/o checking */
> -       result += execute("[[ip route add ::/0 via %gateway%]][[ prio
> %metric%]]", ifd, exec);
> +       result += execute("[[ip route add ::/0 via %gateway%]][[
> metric %metric%]]", ifd, exec);
>  # else
>         result = execute("ifconfig %iface%[[ media %media%]][[ hw
> %hwaddress%]][[ mtu %mtu%]] up", ifd, exec);
>         result += execute("ifconfig %iface% add %address%/%netmask%",
> ifd, exec);
> @@ -482,7 +482,7 @@ static int FAST_FUNC static_up(struct
> interface_defn_t *ifd, execfn *exec)
>         result = execute("ip addr add %address%/%bnmask%[[ broadcast
> %broadcast%]] "
>                         "dev %iface%[[ peer %pointopoint%]][[ label
> %label%]]", ifd, exec);
>         result += execute("ip link set[[ mtu %mtu%]][[ addr
> %hwaddress%]] %iface% up", ifd, exec);
> -       result += execute("[[ip route add default via %gateway% dev
> %iface%[[ prio %metric%]]]]", ifd, exec);
> +       result += execute("[[ip route add default via %gateway% dev
> %iface%[[ metric %metric%]]]]", ifd, exec);
>         return ((result == 3) ? 3 : 0);
>  # else
>         /* ifconfig said to set iface up before it processes hw %hwaddress%,
> --
> 2.0.0.GIT
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox


More information about the busybox mailing list