From c603e1ed21588a911fae221916a52a328e2a5a21 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Mon, 5 Mar 2007 13:45:53 +0000 Subject: do the prefix masking in network byte order --- usr.sbin/bgpctl/irr_prefix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.sbin/bgpctl') 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 @@ -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); -- cgit v1.2.3