From owner-freebsd-bugs@FreeBSD.ORG Mon Sep 13 14:30:06 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D6B3106566C for ; Mon, 13 Sep 2010 14:30:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 395418FC1E for ; Mon, 13 Sep 2010 14:30:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o8DEU63V012800 for ; Mon, 13 Sep 2010 14:30:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o8DEU6fP012798; Mon, 13 Sep 2010 14:30:06 GMT (envelope-from gnats) Resent-Date: Mon, 13 Sep 2010 14:30:06 GMT Resent-Message-Id: <201009131430.o8DEU6fP012798@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, andy white Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B910106564A for ; Mon, 13 Sep 2010 14:26:46 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 86AC58FC16 for ; Mon, 13 Sep 2010 14:26:46 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o8DEQkIj085816 for ; Mon, 13 Sep 2010 14:26:46 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o8DEQkPF085815; Mon, 13 Sep 2010 14:26:46 GMT (envelope-from nobody) Message-Id: <201009131426.o8DEQkPF085815@www.freebsd.org> Date: Mon, 13 Sep 2010 14:26:46 GMT From: andy white To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/150530: syslogd doesn't support ipv6 addrs as destination (patch included) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2010 14:30:06 -0000 >Number: 150530 >Category: misc >Synopsis: syslogd doesn't support ipv6 addrs as destination (patch included) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Sep 13 14:30:05 UTC 2010 >Closed-Date: >Last-Modified: >Originator: andy white >Release: 6.4 (also verified in 8.0) >Organization: >Environment: FreeBSD fbsd64.x.local 6.4-RELEASE FreeBSD 6.4-RELEASE #0: Wed Nov 26 11:43:51 UTC 2008 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: using a ipv4 or hostname (resolves to AAAA or A ) target works fine like this local7.* @hostname or local7.* @192.168.1.1 but using a v6 address doesn't , like this local7.* @2001:770:1cc:caab:2a0:77ff:f403:8398 or local7.* @[2001:770:1cc:caab:2a0:77ff:f403:8398] This is because syslogd.c uses colon as the port separator and this get's broken as a v6 address has colons within it. >How-To-Repeat: use this local7.* @[2001:770:1cc:caab:2a0:77ff:f403:8398] in your syslog.conf >Fix: Attached is a patch to parse an ipv6 address correctly. ipv6 address must be enclosed in square brackets [] inline with rfc3986. Patch is against 8.0 so valid syslog.conf entries are local7.* @[2001:770:1cc:caab:2a0:77ff:f403:8398] and local7.* @[2001:770:1cc:caab:2a0:77ff:f403:8398]:514 etc. Patch attached with submission follows: 1936c1936 < while (*p && (*p != ':') && (i-- > 0)) { --- > while (*p && (*p != ':') && (*p != '[') && (i-- > 0)) { 1938a1939,1945 > if (*p == '[') { > p++; > while (*p && (*p != ']') && (i-- > 0)) { > *tp++ = *p++; > } > p++; > } >Release-Note: >Audit-Trail: >Unformatted: