diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2018-07-22 16:55:02 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2018-07-22 16:55:02 +0000 |
commit | cba9652171545c46120b047f14d43716af567890 (patch) | |
tree | e34ff851cce712be622867d86b8c4966429a5ba1 | |
parent | 90c0b1b388d3ac10d74dd009002aeba74b030b24 (diff) |
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@
-rw-r--r-- | usr.sbin/bgpd/kroute.c | 10 |
1 files changed, 7 insertions, 3 deletions
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 <henning@openbsd.org> @@ -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; |