diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-03-23 20:18:20 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-03-23 20:18:20 +0000 |
commit | 7d1181648514df3d6daba8f3dac3b890aa5679f7 (patch) | |
tree | 213789436b122bde688c772eab4fa5e26870dcf5 /usr.sbin | |
parent | 4170cecbef3bba8a62d7099a80d5c8270c3aece6 (diff) |
Sync mask2prefixlen() with the kroute.c version of ospfd because they share
the same prototype definition comming from ospfd.h.
OK norby@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ospfctl/ospfctl.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/ospfctl/ospfctl.c b/usr.sbin/ospfctl/ospfctl.c index dc09c9e7e04..8aa5bf1dffd 100644 --- a/usr.sbin/ospfctl/ospfctl.c +++ b/usr.sbin/ospfctl/ospfctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfctl.c,v 1.8 2005/03/15 22:09:43 claudio Exp $ */ +/* $OpenBSD: ospfctl.c,v 1.9 2005/03/23 20:18:19 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -50,7 +50,6 @@ const char *fmt_timeframe(time_t t); const char *fmt_timeframe_core(time_t t); const char *log_id(u_int32_t ); const char *log_adv_rtr(u_int32_t); -u_int8_t mask2prefixlen(struct in_addr); void show_database_head(struct in_addr, u_int8_t); int show_database_msg(struct imsg *); int show_nbr_msg(struct imsg *); @@ -284,7 +283,7 @@ show_interface_msg(struct imsg *imsg) iface->name, iface->linkstate, print_link(iface->flags)); printf(" Internet address %s/%d, ", inet_ntoa(iface->addr), - mask2prefixlen(iface->mask)); + mask2prefixlen(iface->mask.s_addr)); printf("Area %s\n", inet_ntoa(iface->area)); printf(" Router ID %s, network type %s, cost: %d\n", inet_ntoa(iface->rtr_id), @@ -474,13 +473,14 @@ log_adv_rtr(u_int32_t adv_rtr) return (buf); } +/* prototype defined in ospfd.h and shared with the kroute.c version */ u_int8_t -mask2prefixlen(struct in_addr ina) +mask2prefixlen(in_addr_t ina) { - if (ina.s_addr == 0) + if (ina == 0) return (0); else - return (33 - ffs(ntohl(ina.s_addr))); + return (33 - ffs(ntohl(ina))); } void |