[1116] in arla-drinkers

home help back first fref pref prev next nref lref last post

Re: Byte order in IP addresses in udebug?

daemon@ATHENA.MIT.EDU (Love)
Sun Aug 29 16:23:32 1999

From owner-arla-drinkers@stacken.kth.se Sun Aug 29 20:23:32 1999
Return-Path: <owner-arla-drinkers@stacken.kth.se>
Delivered-To: arla-drinkers-mtg@bloom-picayune.mit.edu
Received: (qmail 5149 invoked from network); 29 Aug 1999 20:23:31 -0000
Received: from unknown (HELO sundance.stacken.kth.se) (130.237.234.41)
  by bloom-picayune.mit.edu with SMTP; 29 Aug 1999 20:23:31 -0000
Received: (from majordom@localhost)
	by sundance.stacken.kth.se (8.8.8/8.8.8) id WAA02150
	for arla-drinkers-list; Sun, 29 Aug 1999 22:16:34 +0200 (MET DST)
Received: from elixir.e.kth.se (elixir.e.kth.se [130.237.48.5])
	by sundance.stacken.kth.se (8.8.8/8.8.8) with ESMTP id WAA02146
	for <arla-drinkers@stacken.kth.se>; Sun, 29 Aug 1999 22:16:27 +0200 (MET DST)
Received: from hummel.e.kth.se (hummel.e.kth.se [130.237.43.135])
	by elixir.e.kth.se (8.9.3/8.9.3) with ESMTP id WAA13829;
	Sun, 29 Aug 1999 22:16:26 +0200 (MET DST)
Received: (from lha@localhost)
	by hummel.e.kth.se (8.9.3/8.9.3) id WAA16174;
	Sun, 29 Aug 1999 22:16:23 +0200 (MET DST)
To: Dr A V Le Blanc <LeBlanc@mcc.ac.uk>
Cc: arla-drinkers@stacken.kth.se
Subject: Re: Byte order in IP addresses in udebug?
References: <19990829204242.A7836@afs.mcc.ac.uk>
From: Love <lha@stacken.kth.se>
Date: 29 Aug 1999 22:16:20 +0200
In-Reply-To: Dr A V Le Blanc's message of "Sun, 29 Aug 1999 20:42:42 +0100"
Message-ID: <amyaeuz6jv.fsf@hummel.e.kth.se>
Lines: 50
User-Agent: Gnus/5.0700000000000003 (Pterodactyl Gnus v0.91) Emacs/20.2
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: owner-arla-drinkers@stacken.kth.se
Precedence: bulk

Dr A V Le Blanc <LeBlanc@mcc.ac.uk> writes:

> I'm running arla 0.27 on a PII with linux-2.2.12.  I notice udebug
> produces this output:
> 
[..]
> 
> Note that the first IP address is correct (130.88.203.12) but that
> the ones in 'Last yes vote' and in the two Server lines are wrong,
> reversed from their correct order.

This might do.

Love


Index: udebug.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/appl/udebug/udebug.c,v
retrieving revision 1.6
diff -u -w -u -w -r1.6 udebug.c
--- udebug.c	1999/06/11 01:18:45	1.6
+++ udebug.c	1999/08/29 20:14:15
@@ -130,7 +130,7 @@
 	printf("Localtime is %s, differ %d seconds\n", 
 	       myctime((time_t) tv.tv_sec),
 	       abs(db.now - tv.tv_sec));
-	server.s_addr = db.syncHost;
+	server.s_addr = htonl(db.syncHost);
 	printf("Last yes vote for %s secs was %d ago (at %s)\n",
 	       inet_ntoa(server),
 	       ABS_COMP_DB(db,lastYesTime),
@@ -170,7 +170,7 @@
 		    continue;
 		}
 
-		server.s_addr = sdb.addr;
+		server.s_addr = htonl(sdb.addr);
 		printf("Server %s: (db %u.%u)\n",
 		       inet_ntoa(server),
 		       sdb.remoteVersion.epoch,
@@ -190,7 +190,7 @@
 
 	    }
 	} else {
-	    server.s_addr = db.syncHost;
+	    server.s_addr = htonl(db.syncHost);
 	    printf("I'm not the synchost, but %s is.\n",
 		   inet_ntoa(server));    
 	}

home help back first fref pref prev next nref lref last post