summaryrefslogtreecommitdiffstats
path: root/zebra/router-id.c
diff options
context:
space:
mode:
authorChris Hall <chris.hall@highwayman.com>2011-03-29 00:29:35 +0100
committerChris Hall <chris.hall@highwayman.com>2011-03-29 00:29:35 +0100
commite20f7ccd9e110fcd5deb945f8d23922efd8b0822 (patch)
tree89b61ee61ac306817dc19b9313806bf2562b1c1b /zebra/router-id.c
parent6481583be322b0ba223a0140500a0a6d50546dd9 (diff)
downloadquagga-ex14.tar.bz2
quagga-ex14.tar.xz
Bring "ex" version up to date with 0.99.18ex14
Release: 0.99.18ex14 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.)
Diffstat (limited to 'zebra/router-id.c')
-rw-r--r--zebra/router-id.c22
1 files changed, 9 insertions, 13 deletions
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