From owner-freebsd-questions Wed Sep 20 5:35:31 2000 Delivered-To: freebsd-questions@freebsd.org Received: from pericles.IPAustralia.gov.au (pericles.IPAustralia.gov.au [202.14.186.30]) by hub.freebsd.org (Postfix) with ESMTP id 1DE0637B42C for ; Wed, 20 Sep 2000 05:35:26 -0700 (PDT) Received: (from smap@localhost) by pericles.IPAustralia.gov.au (8.9.3/8.9.3) id XAA33531 for ; Wed, 20 Sep 2000 23:35:24 +1100 (EST) (envelope-from anwsmh@IPAustralia.Gov.AU) Received: from wf-149.aipo.gov.au(192.168.1.149) by pericles.IPAustralia.gov.au via smap (V2.0) id xma033522; Wed, 20 Sep 00 23:34:59 +1100 Received: from localhost (anwsmh@localhost) by stan (8.9.3/8.9.3) with ESMTP id XAA00349 for ; Wed, 20 Sep 2000 23:34:57 +1100 (EST) (envelope-from anwsmh@IPAustralia.Gov.AU) X-Authentication-Warning: stan: anwsmh owned process doing -bs Date: Wed, 20 Sep 2000 23:34:57 +1100 (EST) From: Stanley Hopcroft X-Sender: anwsmh@stan To: Questions@FreeBSD.ORG Subject: Re: 4.1-RELEASE + Library functions: syslog("connect from [%s]", Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dear Ladies and Gentlemen, I am writing to say that the logging of client connection requests with garbage values in FreeBSD 4.x is dealt with by *************** *** 323,329 **** /*---------------------------Start real processing loop */ while (TRUE) { /* wait for a client to connect */ - c_addr_len = sizeof(c_addr) ; if ((csfd = accept (ssfd, (struct sockaddr *) &c_addr, &c_addr_len)) == -1) { /* no connection - check the reason of the "error" */ switch (errno) { --- 323,328 ---- *************** ie initialise the c_addr_len before passing it to the kernel in accept(). At a guess, the function prototypes have changed to support IP v6 and the difference in the lengths of sockaddr_in (between the address families) leads to *any* client address being logged as the same (rubbish) value. This is how "Unix Network Programming" suggests that all calls to accept be made. However, it seems strange that it's unnecessary in 3.x (or Linux 2.2 kernels evidently). Its very handy to have the daemon call openlog with option argument including LOG_PERROR so that the connection requests are logged on STDERROR. Thank you, Yours sincerely. S Hopcroft Network Specialist IP Australia +61 2 6283 3189 +61 2 6281 1353 FAX To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message