From e976c2c3b99e63418b0d02487ed9da75317894a0 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 11 Mar 2010 17:46:27 +0000 Subject: [PATCH] Don't call htonl on a netmask before displaying it in --iflist; it's already in network byte order. This bug made any mask that wasn't /32 appear as /0. --- CHANGELOG | 3 +++ output.cc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index ff8c4be6e..76d565a2e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,9 @@ [NOT YET RELEASED] +o Fixed the display of route netmask bits in --iflist. Formerly, any + mask that was not /32 was shown as /0. [David] + o Fixed an assertion failure: nsock_core.c:199: socket_count_write_dec: Assertion `(iod->writesd_count) > 0' failed. diff --git a/output.cc b/output.cc index 080b9de0f..3475793f1 100644 --- a/output.cc +++ b/output.cc @@ -448,7 +448,7 @@ int print_iflist(void) { Tbl->addItem(0, devcol, false, "DEV", 3); Tbl->addItem(0, gwcol, false, "GATEWAY", 7); for (i = 0; i < numroutes; i++) { - mask_nbo = htonl(routes[i].netmask); + mask_nbo = routes[i].netmask; addr_mtob(&mask_nbo, sizeof(mask_nbo), &nbits); assert(nbits <= 32); ia.s_addr = routes[i].dest;