summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpctl
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2007-03-05 13:45:53 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2007-03-05 13:45:53 +0000
commitc603e1ed21588a911fae221916a52a328e2a5a21 (patch)
tree685aa0f701814a06f7f93821d06d321dc38c1f19 /usr.sbin/bgpctl
parent6fe3cfe918507d7859e0eae990e20a6e4b0859c0 (diff)
do the prefix masking in network byte order
Diffstat (limited to 'usr.sbin/bgpctl')
-rw-r--r--usr.sbin/bgpctl/irr_prefix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/bgpctl/irr_prefix.c b/usr.sbin/bgpctl/irr_prefix.c
index d99d5dcdce8..7f9beacdaef 100644
--- a/usr.sbin/bgpctl/irr_prefix.c
+++ b/usr.sbin/bgpctl/irr_prefix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: irr_prefix.c,v 1.5 2007/03/05 12:57:56 henning Exp $ */
+/* $OpenBSD: irr_prefix.c,v 1.6 2007/03/05 13:45:52 henning Exp $ */
/*
* Copyright (c) 2007 Henning Brauer <henning@openbsd.org>
@@ -160,9 +160,9 @@ prefix_aggregate(struct irr_prefix *a, const struct irr_prefix *b)
if (a->len == 0)
return (1);
- mask = 0xffffffff << (32 - a->len);
+ mask = htonl(0xffffffff << (32 - a->len));
- if ((ntohl(a->addr.in.s_addr) & mask) == (ntohl(b->addr.in.s_addr) & mask))
+ if ((a->addr.in.s_addr & mask) == (b->addr.in.s_addr & mask))
return (1);
return (0);