store and print the rdomain of the interfaces we see.
ok?
(benno_print_rdomain_2.diff)
diff --git usr.sbin/bgpctl/bgpctl.c usr.sbin/bgpctl/bgpctl.c
index f8d4a5adcc9..f22a2561c42 100644
--- usr.sbin/bgpctl/bgpctl.c
+++ usr.sbin/bgpctl/bgpctl.c
@@ -1140,7 +1140,7 @@ show_nexthop_msg(struct imsg *imsg)
void
show_interface_head(void)
{
- printf("%-15s%-15s%-15s%s\n", "Interface", "Nexthop state", "Flags",
+ printf("%-15s%-9s%-9s%-7s%s\n", "Interface", "rdomain", "Nexthop",
"Flags",
"Link state");
}
@@ -1223,8 +1223,9 @@ show_interface_msg(struct imsg *imsg)
case IMSG_CTL_SHOW_INTERFACE:
k = imsg->data;
printf("%-15s", k->ifname);
- printf("%-15s", k->nh_reachable ? "ok" : "invalid");
- printf("%-15s", k->flags & IFF_UP ? "UP" : "");
+ printf("%-9u", k->rdomain);
+ printf("%-9s", k->nh_reachable ? "ok" : "invalid");
+ printf("%-7s", k->flags & IFF_UP ? "UP" : "");
if ((ifms_type = ift2ifm(k->if_type)) != 0)
printf("%s, ", get_media_descr(ifms_type));
diff --git usr.sbin/bgpd/bgpd.h usr.sbin/bgpd/bgpd.h
index c5a00e7b83f..9d18756f1b6 100644
--- usr.sbin/bgpd/bgpd.h
+++ usr.sbin/bgpd/bgpd.h
@@ -567,6 +567,7 @@ struct kroute_nexthop {
struct kif {
char ifname[IFNAMSIZ];
u_int64_t baudrate;
+ u_int rdomain;
int flags;
u_short ifindex;
u_int8_t if_type;
diff --git usr.sbin/bgpd/kroute.c usr.sbin/bgpd/kroute.c
index ed5405db314..1ff126f1591 100644
--- usr.sbin/bgpd/kroute.c
+++ usr.sbin/bgpd/kroute.c
@@ -2491,6 +2491,7 @@ if_change(u_short ifindex, int flags, struct if_data *ifd)
kif->k.flags = flags;
kif->k.link_state = ifd->ifi_link_state;
kif->k.if_type = ifd->ifi_type;
+ kif->k.rdomain = ifd->ifi_rdomain;
kif->k.baudrate = ifd->ifi_baudrate;
send_imsg_session(IMSG_IFINFO, 0, &kif->k, sizeof(kif->k));
@@ -3057,6 +3058,7 @@ fetchifs(int ifindex)
kif->k.flags = ifm.ifm_flags;
kif->k.link_state = ifm.ifm_data.ifi_link_state;
kif->k.if_type = ifm.ifm_data.ifi_type;
+ kif->k.rdomain = ifm.ifm_data.ifi_rdomain;
kif->k.baudrate = ifm.ifm_data.ifi_baudrate;
kif->k.nh_reachable = kif_validate(&kif->k);