Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 801535 - sys-apps/busybox: /usr/share/udhcp/default.script contains postfix increment operator
Summary: sys-apps/busybox: /usr/share/udhcp/default.script contains postfix increment ...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: nonbash
  Show dependency tree
 
Reported: 2021-07-11 08:27 UTC by Kerin Millar
Modified: 2021-07-11 08:27 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kerin Millar 2021-07-11 08:27:08 UTC
Line #52 of /usr/share/udhcpc/default.script makes use of a postfix increment operator, which is not defined by POSIX and not supported by shells such as dash.

    $ sed -n 52p /usr/share/udhcpc/default.script
    route add default gw $i dev $interface metric $((metric++))

Considered in isolation, the matter could be resolved by writing it as follows.

    route add default gw $i dev $interface metric $metric
    : $(( metric += 1 ))

As an aside, the preceding seven lines look suspicious in so far as `ip route` is potentially invoked without testing whether ip(8) is available - which is inconsistent with the rest of the script - before going on to execute a seemingly equivalent route(8) command in that event.