diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-01-18 19:15:01 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-01-18 19:15:01 +0000 |
commit | f07e66382b18716e0b49bc95bf4584115b394ea2 (patch) | |
tree | 33346d5cb3c3e16767b10056b8a3a51c666c69d5 /usr.sbin/bgpd | |
parent | 2c5896ff62e34b762dffa8a4f0c9129bba51d936 (diff) |
track interface type and baudrate as well
ok claudio@
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/bgpd.h | 4 | ||||
-rw-r--r-- | usr.sbin/bgpd/kroute.c | 16 |
2 files changed, 13 insertions, 7 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h index 9ed29c08ff5..0bda2ac88ce 100644 --- a/usr.sbin/bgpd/bgpd.h +++ b/usr.sbin/bgpd/bgpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.72 2004/01/17 21:06:55 henning Exp $ */ +/* $OpenBSD: bgpd.h,v 1.73 2004/01/18 19:15:00 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -246,7 +246,9 @@ struct kif { u_short ifindex; int flags; char ifname[IFNAMSIZ]; + u_int8_t media_type; u_int8_t link_state; + u_long baudrate; }; struct session_up { diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c index a5da14ed15a..86129fc8102 100644 --- a/usr.sbin/bgpd/kroute.c +++ b/usr.sbin/bgpd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.73 2004/01/17 21:06:55 henning Exp $ */ +/* $OpenBSD: kroute.c,v 1.74 2004/01/18 19:15:00 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -96,7 +96,7 @@ int protect_lo(void); u_int8_t prefixlen_classful(in_addr_t); u_int8_t mask2prefixlen(in_addr_t); void get_rtaddrs(int, struct sockaddr *, struct sockaddr **); -void if_change(u_short, int, u_int8_t); +void if_change(u_short, int, struct if_data *); void if_announce(void *); int send_rtmsg(int, int, struct kroute *); @@ -798,7 +798,7 @@ get_rtaddrs(int addrs, struct sockaddr *sa, struct sockaddr **rti_info) } void -if_change(u_short ifindex, int flags, u_int8_t link_state) +if_change(u_short ifindex, int flags, struct if_data *ifd) { struct kif_node *kif; struct kif_kr *kkr; @@ -812,7 +812,9 @@ if_change(u_short ifindex, int flags, u_int8_t link_state) } kif->k.flags = flags; - kif->k.link_state = link_state; + kif->k.link_state = ifd->ifi_link_state; + kif->k.media_type = ifd->ifi_type; + kif->k.baudrate = ifd->ifi_baudrate; LIST_FOREACH(kkr, &kif->kroute_l, entry) { /* @@ -820,7 +822,7 @@ if_change(u_short ifindex, int flags, u_int8_t link_state) * not all interfaces have a conecpt of "link state" and/or * do not report up */ - if ((flags & IFF_UP) && (link_state != LINK_STATE_DOWN)) + if ((flags & IFF_UP) && (kif->k.link_state != LINK_STATE_DOWN)) kkr->kr->r.flags &= ~F_DOWN; else kkr->kr->r.flags |= F_DOWN; @@ -1076,6 +1078,8 @@ fetchifs(int ifindex) kif->k.ifindex = ifm->ifm_index; kif->k.flags = ifm->ifm_flags; kif->k.link_state = ifm->ifm_data.ifi_link_state; + kif->k.media_type = ifm->ifm_data.ifi_type; + kif->k.baudrate = ifm->ifm_data.ifi_baudrate; if ((sa = rti_info[RTAX_IFP]) != NULL) if (sa->sa_family == AF_LINK) { @@ -1221,7 +1225,7 @@ dispatch_rtmsg(void) case RTM_IFINFO: ifm = (struct if_msghdr *)next; if_change(ifm->ifm_index, ifm->ifm_flags, - ifm->ifm_data.ifi_link_state); + &ifm->ifm_data); break; case RTM_IFANNOUNCE: if_announce(next); |