From f9956b9524ddafdb9d0cec042213eaa8229aad8c Mon Sep 17 00:00:00 2001 From: Chris Hall Date: Tue, 29 Mar 2011 01:49:16 +0100 Subject: Bring "ex" version up to date with 0.99.18 Release: 0.99.18ex15p -- Pipework Branch Also fixes issue with unknown attributes -- does not release them prematurely. Contains the "bgpd: New show commands for improved view and address family support", which is post 0.99.18. (But not RFC 5082 GTSM.) --- zebra/router-id.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'zebra/router-id.c') diff --git a/zebra/router-id.c b/zebra/router-id.c index 81ffa1b7..72747bd9 100644 --- a/zebra/router-id.c +++ b/zebra/router-id.c @@ -1,7 +1,7 @@ /* * Router ID for zebra daemon. * - * Copyright (C) 2004 James R. Leu + * Copyright (C) 2004 James R. Leu * * This file is part of Quagga routing suite. * @@ -66,11 +66,11 @@ router_id_bad_address (struct connected *ifc) { if (ifc->address->family != AF_INET) return 1; - + /* non-redistributable addresses shouldn't be used for RIDs either */ if (!zebra_check_addr (ifc->address)) return 1; - + return 0; } @@ -134,7 +134,7 @@ router_id_add_address (struct connected *ifc) l = &rid_lo_sorted_list; else l = &rid_all_sorted_list; - + if (!router_id_find_node (l, ifc)) listnode_add_sort (l, ifc); @@ -228,16 +228,12 @@ DEFUN (no_router_id, static int router_id_cmp (void *a, void *b) { - unsigned int A, B; + const struct connected *ifa = (const struct connected *)a; + const struct connected *ifb = (const struct connected *)b; + unsigned int A = ntohl(ifa->address->u.prefix4.s_addr); + unsigned int B = ntohl(ifb->address->u.prefix4.s_addr); - A = ((struct connected *) a)->address->u.prefix4.s_addr; - B = ((struct connected *) b)->address->u.prefix4.s_addr; - - if (A > B) - return 1; - else if (A < B) - return -1; - return 0; + return (int) (A - B); } void -- cgit v1.2.3