We need to watch link changes even if we don't actively print them. Otherwise, route changes will not print the correct link name. Signed-off-by: William A. Kennington III --- ip/ipmonitor.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ip/ipmonitor.c b/ip/ipmonitor.c index 1f4e860f..14aba1f1 100644 --- a/ip/ipmonitor.c +++ b/ip/ipmonitor.c @@ -25,6 +25,7 @@ static int prefix_banner; int listen_all_nsid; struct rtnl_ctrl_data *ctrl_data; int do_monitor; +int print_link; static void usage(void) { @@ -100,7 +101,8 @@ static int accept_msg(struct rtnl_ctrl_data *ctrl, case RTM_NEWLINK: case RTM_DELLINK: ll_remember_index(n, NULL); - print_linkinfo(n, arg); + if (print_link) + print_linkinfo(n, arg); return 0; case RTM_NEWADDR: @@ -263,8 +265,10 @@ int do_ipmonitor(int argc, char **argv) if (!lmask) lmask = IPMON_L_ALL; + /* Always monitor links for renaming */ + groups |= nl_mgrp(RTNLGRP_LINK); if (lmask & IPMON_LLINK) - groups |= nl_mgrp(RTNLGRP_LINK); + print_link = true; if (lmask & IPMON_LADDR) { if (!preferred_family || preferred_family == AF_INET) groups |= nl_mgrp(RTNLGRP_IPV4_IFADDR); -- 2.50.1.565.gc32cd1483b-goog