From 7b5ef774b870f3299376da44ef9c4090eccd7cb9 Mon Sep 17 00:00:00 2001 From: Nathan Neulinger Date: Tue, 3 Apr 2001 21:22:05 +0000 Subject: [PATCH] fix-ubik-lowest-host-comparison-algorithm-20010403 be more particular about how we do comparison, and fix printing of the host address for byte order problem --- src/ubik/vote.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ubik/vote.c b/src/ubik/vote.c index 3d9eb891e..50c566680 100644 --- a/src/ubik/vote.c +++ b/src/ubik/vote.c @@ -236,7 +236,7 @@ SVOTE_Beacon(rxcall, astate, astart, avers, atid) he's lowest, these loops don't occur. because if someone knows he's lowest, he will send out beacons telling others to vote for him. */ if (!amIClone && - (ntohl((afs_uint32) ubik_host) <= ntohl((afs_uint32) lowestHost) + (ntohl((afs_uint32) ubik_host[0]) <= ntohl((afs_uint32) lowestHost) || lowestTime + BIGTIME < now)) { lowestTime = now; lowestHost = ubik_host[0]; @@ -294,9 +294,8 @@ SVOTE_Beacon(rxcall, astate, astart, avers, atid) (otherHost != lastYesHost) || (lastYesState != astate)) { /* A new vote or a change in the vote or changed quorum */ - ubik_dprint("Ubik: vote 'yes' for %d.%d.%d.%d %s\n", - ((otherHost>>24)&0xff), ((otherHost>>16)&0xff), - ((otherHost>> 8)&0xff), (otherHost &0xff), + ubik_dprint("Ubik: vote 'yes' for %s %s\n", + afs_inet_ntoa(otherHost), (astate?"(in quorum)":"(NOT in quorum)")); } -- 2.39.5