Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Dec 2000 11:47:12 +0100
From:      Edwin Groothuis <mavetju@chello.nl>
To:        Iana Liadze <iana@parliament.ge>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: rwhod?
Message-ID:  <20001220114712.A59674@d9168.upc-d.chello.nl>
In-Reply-To: <Pine.BSF.4.21.0012201218340.251-100000@wks18.parliament.ge>; from iana@parliament.ge on Wed, Dec 20, 2000 at 12:34:54PM %2B0400
References:  <Pine.BSF.4.21.0012201218340.251-100000@wks18.parliament.ge>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Dec 20, 2000 at 12:34:54PM +0400, Iana Liadze wrote:
> Did anybody have the following messages:
> rwhod:malformed host name from 238d48d 

grepping the source:
	if (!verify(wd.wd_hostname, sizeof wd.wd_hostname)) {
		syslog(LOG_WARNING, "malformed host name from %x",
			from.sin_addr);
		continue;
	}

So it's a hex representation of the IP address

02 38 d4 8d = 2.56.212.141 (or 141.212.56.2, I'm never sure about this)

wd_hostname is *your* hostname, as initialized at the begin of main().

        /*
         * Establish host name as returned by system.
         */
        if (gethostname(myname, sizeof(myname) - 1) < 0) {
                syslog(LOG_ERR, "gethostname: %m");
                exit(1);
        }
        if ((cp = index(myname, '.')) != NULL)
                *cp = '\0';
        strncpy(mywd.wd_hostname, myname, sizeof(mywd.wd_hostname) - 1);
        mywd.wd_hostname[sizeof(mywd.wd_hostname) - 1] = '\0';

So, what is the hostname of your machine?
It shouldn't contain anything but 0-9, a-z and A-Z and its size
should be >0. See the verify function for this (hmmm... shouldn't
the minus (-) be allowed in this?)

Edwin, loves having the source-code!

-- 
Edwin Groothuis   |           Interested in MUDs? Visit Fatal Dimensions:
mavetju@chello.nl |                     http://fataldimensions.nl.eu.org/
------------------+               telnet://fataldimensions.nl.eu.org:4000


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001220114712.A59674>