? ospfctl/logmsg.d ? ospfctl/ospfctl ? ospfctl/ospfctl.d ? ospfctl/output.d ? ospfctl/parser.d Index: ospfd/interface.c =================================================================== RCS file: /cvs/src/usr.sbin/ospfd/interface.c,v retrieving revision 1.83 diff -u -p -r1.83 interface.c --- ospfd/interface.c 28 Jun 2019 13:32:49 -0000 1.83 +++ ospfd/interface.c 26 Oct 2020 23:45:45 -0000 @@ -633,6 +633,9 @@ if_to_ctl(struct iface *iface) ictl.auth_type = iface->auth_type; ictl.auth_keyid = iface->auth_keyid; + memcpy(ictl.dependon, iface->dependon, sizeof(ictl.dependon)); + ictl.depend_ok = iface->depend_ok; + gettimeofday(&now, NULL); if (evtimer_pending(&iface->hello_timer, &tv)) { timersub(&tv, &now, &res); Index: ospfd/ospfd.h =================================================================== RCS file: /cvs/src/usr.sbin/ospfd/ospfd.h,v retrieving revision 1.106 diff -u -p -r1.106 ospfd.h --- ospfd/ospfd.h 21 Jan 2020 20:38:52 -0000 1.106 +++ ospfd/ospfd.h 26 Oct 2020 23:45:45 -0000 @@ -485,6 +485,8 @@ struct ctl_iface { u_int8_t passive; enum auth_type auth_type; u_int8_t auth_keyid; + char dependon[IF_NAMESIZE]; + int depend_ok; }; struct ctl_nbr { Index: ospfd/ospfe.c =================================================================== RCS file: /cvs/src/usr.sbin/ospfd/ospfe.c,v retrieving revision 1.106 diff -u -p -r1.106 ospfe.c --- ospfd/ospfe.c 23 Apr 2019 06:18:02 -0000 1.106 +++ ospfd/ospfe.c 26 Oct 2020 23:45:45 -0000 @@ -1058,6 +1058,8 @@ orig_rtr_lsa(struct area *area) if ((oeconf->flags & OSPFD_FLAG_STUB_ROUTER || oe_nofib) && rtr_link.type != LINK_TYPE_STUB_NET) rtr_link.metric = MAX_METRIC; + else if (iface->dependon[0] != '\0' && iface->depend_ok == 0) + rtr_link.metric = MAX_METRIC; else rtr_link.metric = htons(iface->metric); num_links++; Index: ospfctl/output.c =================================================================== RCS file: /cvs/src/usr.sbin/ospfctl/output.c,v retrieving revision 1.2 diff -u -p -r1.2 output.c --- ospfctl/output.c 20 May 2020 11:11:24 -0000 1.2 +++ ospfctl/output.c 26 Oct 2020 23:45:45 -0000 @@ -170,10 +170,15 @@ show_interface(struct ctl_iface *iface, printf(" Router ID %s, network type %s, cost: %d\n", inet_ntoa(iface->rtr_id), if_type_name(iface->type), iface->metric); + if (iface->dependon[0] != '\0') { + printf(" Depends on %s, %s\n", iface->dependon, + iface->depend_ok ? "up" : "down"); + } printf(" Transmit delay is %d sec(s), state %s, priority %d\n", iface->transmit_delay, if_state_name(iface->state), iface->priority); - printf(" Designated Router (ID) %s, ", inet_ntoa(iface->dr_id)); + printf(" Designated Router (ID) %s, ", + inet_ntoa(iface->dr_id)); printf("interface address %s\n", inet_ntoa(iface->dr_addr)); printf(" Backup Designated Router (ID) %s, ", inet_ntoa(iface->bdr_id));