From 243b95729ca5c07a39bdb7e327868460a6884474 Mon Sep 17 00:00:00 2001 From: rpaulo Date: Mon, 27 Jul 2009 14:22:09 +0000 Subject: Mesh fixes, namely: * don't clobber proxy entries * HWMP seq number processing, including discard of old frames * flush routing table entries based on nexthop * print route flags in ifconfig * more debugging messages and comments Proxy changes submitted by sam. Approved by: re (kib) --- sbin/ifconfig/ifieee80211.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'sbin/ifconfig') diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index be929fc..10fb83d 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -3952,9 +3952,9 @@ list_regdomain(int s, int channelsalso) static void list_mesh(int s) { - int i; struct ieee80211req ireq; struct ieee80211req_mesh_route routes[128]; + struct ieee80211req_mesh_route *rt; (void) memset(&ireq, 0, sizeof(ireq)); (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); @@ -3965,23 +3965,26 @@ list_mesh(int s) if (ioctl(s, SIOCG80211, &ireq) < 0) err(1, "unable to get the Mesh routing table"); - printf("%-17.17s %-17.17s %4s %4s %4s %6s\n" + printf("%-17.17s %-17.17s %4s %4s %4s %6s %s\n" , "DEST" , "NEXT HOP" , "HOPS" , "METRIC" , "LIFETIME" - , "MSEQ"); + , "MSEQ" + , "FLAGS"); - for (i = 0; i < ireq.i_len / sizeof(*routes); i++) { + for (rt = &routes[0]; rt - &routes[0] < ireq.i_len / sizeof(*rt); rt++){ printf("%s ", - ether_ntoa((const struct ether_addr *)routes[i].imr_dest)); - printf("%s %4u %4u %6u %6u\n", - ether_ntoa((const struct ether_addr *) - routes[i].imr_nexthop), - routes[i].imr_nhops, routes[i].imr_metric, - routes[i].imr_lifetime, - routes[i].imr_lastmseq); + ether_ntoa((const struct ether_addr *)rt->imr_dest)); + printf("%s %4u %4u %6u %6u %c%c\n", + ether_ntoa((const struct ether_addr *)rt->imr_nexthop), + rt->imr_nhops, rt->imr_metric, rt->imr_lifetime, + rt->imr_lastmseq, + (rt->imr_flags & IEEE80211_MESHRT_FLAGS_VALID) ? + 'V' : '!', + (rt->imr_flags & IEEE80211_MESHRT_FLAGS_PROXY) ? + 'P' : ' '); } } -- cgit v1.1