From: claudio Date: Sun, 22 Jul 2018 16:55:01 +0000 (+0000) Subject: Add more information to if_change() debug log using the new interface helper X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=501be069dbf296a0403b495730d371d7916511e8;p=openbsd Add more information to if_change() debug log using the new interface helper functions in util.c. The idea is to make even debug messages as informative as possible. Before: if_change: ifindex 1, ifi_rdomain 0 After: if_change: em0: rdomain 0 UP, Ethernet, active, 1000 Mbps OK benno@ --- diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c index bdffe63d7a2..8902eef1fd4 100644 --- a/usr.sbin/bgpd/kroute.c +++ b/usr.sbin/bgpd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.221 2018/07/14 12:32:35 benno Exp $ */ +/* $OpenBSD: kroute.c,v 1.222 2018/07/22 16:55:01 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -2489,8 +2489,12 @@ if_change(u_short ifindex, int flags, struct if_data *ifd, return; } - log_info("%s: ifindex %u, ifi_rdomain %u", __func__, ifindex, - ifd->ifi_rdomain); + log_info("%s: %s: rdomain %u %s, %s, %s, %s", + __func__, kif->k.ifname, ifd->ifi_rdomain, + flags & IFF_UP ? "UP" : "DOWN", + get_media_descr(ift2ifm(ifd->ifi_type)), + get_linkstate(ifd->ifi_type, ifd->ifi_link_state), + get_baudrate(ifd->ifi_baudrate, "bps")); kif->k.flags = flags; kif->k.link_state = ifd->ifi_link_state;