Skip to content

ipaddress: Make print_linkinfo_brief() static

Serhey Popovych netdev 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest9 patches 2 repliesIn review
  2. v49 patches 4 repliesSuperseded
  3. v39 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v29 patches2 repliesSuperseded
v19 patches6 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9ipaddress: Abstract IFA_LABEL matching codeip/ipaddress.c+27 -300 replies
2/9ipaddress: ll_map: Replace ll_idx_n2a() with ll_index_to_name()ip/ipaddress.c+9 -120 replies
3/9utils: Reimplement ll_idx_n2a() and introduce ll_idx_a2n()include/ll_map.h lib/ll_map.c+24 -110 replies
4/9ipaddress: Improve print_linkinfo()ip/ipaddress.c+13 -170 replies
5/9ipaddress: Simplify print_linkinfo_brief() and it's usageip/ipaddress.c+14 -170 replies
6/9lib: Correct object file dependenciesMakefile lib/Makefile+3 -30 replies
7/9utils: Introduce and use get_ifname_rta()bridge/link.c include/utils.h ip/ipaddress.c +1 more+32 -160 replies
8/9utils: Introduce and use print_name_and_link() to print name@linkbridge/link.c include/utils.h ip/ipaddress.c +1 more+58 -520 replies
9/9ipaddress: Make print_linkinfo_brief() staticip/ip_common.h ip/ipaddress.c ip/iplink.c+11 -720 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH iproute2-next v5 0/9] ipaddress: Make print_linkinfo_brief() static

With this series I propose to make print_linkinfo_brief() static in favor of print_linkinfo() as single point for linkinfo printing.

Changes presented with this series tested using following script:

\#!/bin/bash

iproute2_dir="$1"
iface='eth0.2'

pushd "$iproute2_dir" &>/dev/null

for i in new old; do
DIR="/tmp/$i"
mkdir -p "$DIR"

ln -snf ip.$i ip/ip

# normal
ip/ip link show >"$DIR/ip-link-show"
ip/ip -4 addr show >"$DIR/ip-4-addr-show"
ip/ip -6 addr show >"$DIR/ip-6-addr-show"
ip/ip addr show dev "$iface" >"$DIR/ip-addr-show-$iface"

# brief
ip/ip -br link show >"$DIR/ip-br-link-show"
ip/ip -br -4 addr show >"$DIR/ip-br-4-addr-show"
ip/ip -br -6 addr show >"$DIR/ip-br-6-addr-show"
ip/ip -br addr show dev "$iface" >"$DIR/ip-br-addr-show-$iface"
done
rm -f ip/ip

diff -urN /tmp/{old,new} |sed -n -Ee'/^(-{3}|\+{3})[[:space:]]+/!p' rc=$?

popd &>/dev/null
exit $rc

Expected results : <no output>
Actual results : <no output>

Although test coverage is far from ideal in my opinion it covers most important aspects of the changes presented by the series.

All this work is done in prepare of iplink_get() enhancements to support attribute parse that finally will be used to simplify ip/tunnel RTM_GETLINK code.

As always reviews, comments, suggestions and criticism is welcome.

v5
Fix build failures caused by incorrect dependency: libnetlink.a does not depend on ll_map.o, instead ll_map.o depends on it.

v4
Print master network device name using correct color.

v3
Fixed subject line.

v2
Rebased to current iproute2-next/master. No changes.

Thanks,
Serhii

Serhey Popovych (9):
ipaddress: Abstract IFA_LABEL matching code
ipaddress: ll_map: Replace ll_idx_n2a() with ll_index_to_name()
utils: Reimplement ll_idx_n2a() and introduce ll_idx_a2n()
ipaddress: Improve print_linkinfo()
ipaddress: Simplify print_linkinfo_brief() and it's usage
lib: Correct object file dependencies
utils: Introduce and use get_ifname_rta()
utils: Introduce and use print_name_and_link() to print name@link
ipaddress: Make print_linkinfo_brief() static

 Makefile         |    2 +-
 bridge/link.c    |   21 ++---
 include/ll_map.h |    4 +-
 include/utils.h  |    5 ++
 ip/ip_common.h   |    2 -
 ip/ipaddress.c   |  231 ++++++++++++++----------------------------------------
 ip/iplink.c      |    5 +-
 lib/Makefile     |    4 +-
 lib/ll_map.c     |   31 +++++---
 lib/utils.c      |   68 ++++++++++++++++
 10 files changed, 167 insertions(+), 206 deletions(-)
Signature · 1 line
1.7.10.4