]> git.ipfire.org Git - thirdparty/iproute2.git/commit
iprule: refactor print_rule() to use leading space before printing attribute
authorThomas Haller <thaller@redhat.com>
Tue, 23 Apr 2019 07:16:14 +0000 (09:16 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 24 Apr 2019 22:06:15 +0000 (15:06 -0700)
commit927632d4da72bb0e2e9837975663d723082fb63e
treefc42bc4eb883f5729bc681ac7fc18644c0d7f495
parent461f0405f331425069551173b127d3d0dba32315
iprule: refactor print_rule() to use leading space before printing attribute

When printing the actions, we avoid adding the trailing space after the
attribute. Possibly because we expect the action to be the last output
on the line and not end with a space.

But for FR_ACT_TO_TBL nothing is printed. That means, we add double
spaces if a protocol is printed as well:

    # ip rule add priority 10 protocol 10 type 1

will be printed as

    10:     from all lookup 1  proto mrt

The only visible effect of the patch is to avoid the double-space and
avoid a trailing space if the action is FR_ACT_TO_TBL.

Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/iprule.c