From owner-freebsd-current@freebsd.org Sat Jan 28 11:43:02 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6492CC58C8 for ; Sat, 28 Jan 2017 11:43:02 +0000 (UTC) (envelope-from alex.deiter@gmail.com) Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E7B9136A; Sat, 28 Jan 2017 11:43:02 +0000 (UTC) (envelope-from alex.deiter@gmail.com) Received: by mail-lf0-x243.google.com with SMTP id x1so27896142lff.0; Sat, 28 Jan 2017 03:43:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:date:subject:cc:to :message-id; bh=zenLsEDXT1F+NpIVmcXsGBRbs4odjAqIbIqDg3LXue4=; b=KPysbuhYRvu9e+HW7KCHu6nZ2MlzCRHQJy4Mb66KluQVJSETuLsKneG5y6WOQkx0VK zbQZCiYdqqmlLGywrxtuuooyopIA4s1bIB3Uy+WjPXQqI6Vu2YTUvWSGcpdXGzIG6Mz/ G677zx/MOyfyjgY3AeGe06k8v7HPfCXkYkK3RmNNu/s/eoPvb94C+cfZ0/ielb3bZYA8 368TzzjGvr680BgaKc9dU3nf1kty3g9uYesqrRzCzen1uBnQyWuj2xkByfaX7sPRBLXJ htp3wAwrEEhyHPv/9pOeysBkTJQKd2fyOGlB2ZkEQXDuMc/SQ8JAGYvxBzCMjOXDLqy1 /W7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version:date :subject:cc:to:message-id; bh=zenLsEDXT1F+NpIVmcXsGBRbs4odjAqIbIqDg3LXue4=; b=O4IzAGE9m2h7uW/szeUpGiJjr4dl7sdRdNdcJz5fioNtoFWY24dtW+5fRUZOi0lJVT y3I9ETZLvwyxIPoUzKSmrECWTw3FzwHIp7bL1ZULXhL195gQlJi7GCfDyT0nwNQPXYiM 4BKdrHWDAsTKmdIO6dYYWdi608T2dNGbERfUmpYeU/9Rk29uroFhQn6/uLGIyG4GobGj 7NwhBDu3FxXHT+d4L35rz8N/weLXjSFaVfDou05XqTjVUfJD0kc6+qEz5dN9kgJJprju 6HQs7C4g77rQ46hqSBOZJKRzoxqWHdFafqdJ42964Dull0VKWdLzqQQ+XxRauOgwwuXX jnqA== X-Gm-Message-State: AIkVDXJrbgEumLFUOMRz5jKEkIKlmba8qqMFe4SoEk/j9qYWyWrLp59DV2Q5UHaReM6i+A== X-Received: by 10.25.21.205 with SMTP id 74mr4207050lfv.182.1485603779901; Sat, 28 Jan 2017 03:42:59 -0800 (PST) Received: from tiamat.deiter.ru ([109.167.157.231]) by smtp.gmail.com with ESMTPSA id t23sm2007500ljd.30.2017.01.28.03.42.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Jan 2017 03:42:58 -0800 (PST) From: Alex Deiter Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Date: Sat, 28 Jan 2017 14:42:58 +0300 Subject: CURRENT [r309933] broke syslogd on IPv4 only system To: freebsd-current Message-Id: X-Mailer: Apple Mail (2.3259) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2017 11:43:02 -0000 Hello, Please take a look SVN r309933: ------------------------------------------------------------------------ r309933 | hrs | 2016-12-12 22:33:40 +0300 (Mon, 12 Dec 2016) | 13 lines - Refactor listening socket list. All of the listening sockets are now maintained in a single linked-list in a transport-independent = manner. - Use queue.h for linked-list structure. - Use linked-list for AllowedPeers. - Use getaddrinfo(8) even for Unix Domain sockets. - Use macros to type-casting from/to struct sockaddr{,_in,_in6}. - Define fu_* macro for union f_un to shorten the member names. - Remove an extra #include . - Add "static" to non-exported symbols. - !INET support is still incomplete but will be fixed later. There is no functional change except for some minor debug messages. ------------------------------------------------------------------------ After this change syslogd is not listen on local sockets: # /usr/sbin/syslogd -d Try (null) new socket fd is 6 shutdown sending on socket Try /var/run/log Try /var/run/logpriv off & running.... init loading timezone data via tzset() . . . # sockstat | grep syslogd root syslogd 19151 6 udp4 *:514 *:* # ls -l /var/run/ |grep log -rw------- 1 root wheel 5 Jan 28 14:30 syslog.pid Root cause: usr.sbin/syslogd/syslogd.c . . . 309 #ifdef INET6 310 static int family =3D PF_UNSPEC; /* protocol family (IPv4, = IPv6 or both) */ 311 #else 312 static int family =3D PF_INET; /* protocol family (IPv4 = only) */ 313 #endif . . . 2856 static int 2857 socksetup(struct peer *pe) . . . 2911 if (family !=3D AF_UNSPEC && res->ai_family !=3D = family) 2912 continue; in case of IPv4-only system (WITHOUT_INET6=3DYES in /etc/src.conf) we = have family =3D PF_INET in 312 line and function socksetup will skip = listen on local sockets. Proposed patch: Index: syslogd.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- syslogd.c (revision 312909) +++ syslogd.c (working copy) @@ -2908,7 +2908,7 @@ /* Only AF_LOCAL in secure mode. */ continue; } - if (family !=3D AF_UNSPEC && res->ai_family !=3D family) + if (res->ai_family !=3D AF_LOCAL && res->ai_family !=3D = family) continue; s =3D socket(res->ai_family, res->ai_socktype, Successfully tested on IPv4-only CURRENT r312856M. Thank you!=20 Alex Deiter alex.deiter@gmail.com