[proftpd] Fix log noise on IPv6 connections

Paul Howarth pghmcfc at fedoraproject.org
Sat May 17 00:20:34 UTC 2014


commit c8bf632e81dac4e560a3f8c58bb47ef6713218b2
Author: Paul Howarth <paul at city-fan.org>
Date:   Sat May 17 01:19:10 2014 +0100

    Fix log noise on IPv6 connections
    
    Upstream fix to ignore any ENOPROTOOPT errors when setting the IPv6 TCLASS (TOS)
    flags on the socket; they make for noisier logging without providing any
    actual value to the user/admin.
    http://bugs.proftpd.org/show_bug.cgi?id=4055

 3a777567d403a407f9f8ae257ea41efe5313c625.diff |   31 +++++++++++++++++++++++++
 proftpd.spec                                  |   14 ++++++++++-
 2 files changed, 44 insertions(+), 1 deletions(-)
---
diff --git a/3a777567d403a407f9f8ae257ea41efe5313c625.diff b/3a777567d403a407f9f8ae257ea41efe5313c625.diff
new file mode 100644
index 0000000..6454d9f
--- /dev/null
+++ b/3a777567d403a407f9f8ae257ea41efe5313c625.diff
@@ -0,0 +1,31 @@
+diff --git a/src/inet.c b/src/inet.c
+index aa94975..1e9b959 100644
+--- a/src/inet.c
++++ b/src/inet.c
+@@ -2,7 +2,7 @@
+  * ProFTPD - FTP server daemon
+  * Copyright (c) 1997, 1998 Public Flood Software
+  * Copyright (c) 1999, 2000 MacGyver aka Habeeb J. Dihu <macgyver at tos.net>
+- * Copyright (c) 2001-2013 The ProFTPD Project team
++ * Copyright (c) 2001-2014 The ProFTPD Project team
+  *
+  * This program is free software; you can redistribute it and/or modify
+  * it under the terms of the GNU General Public License as published by
+@@ -771,8 +771,15 @@ int pr_inet_set_proto_opts(pool *p, conn_t *c, int mss, int nodelay,
+     /* Only set TCLASS flags on IPv6 sockets; IPv4 sockets use TOS. */
+     if (pr_netaddr_get_family(c->local_addr) == AF_INET6) {
+       if (c->listen_fd != -1) {
+-        if (setsockopt(c->listen_fd, ip_level, IPV6_TCLASS, (void *) &tos,
+-            sizeof(tos)) < 0) {
++        int res;
++
++        res = setsockopt(c->listen_fd, ip_level, IPV6_TCLASS, (void *) &tos,
++          sizeof(tos));
++        if (res < 0
++#ifdef ENOPROTOOPT
++            && errno != ENOPROTOOPT
++#endif /* !ENOPROTOOPT */
++          ) {
+           pr_log_pri(PR_LOG_NOTICE, "error setting listen fd IPV6_TCLASS: %s",
+             strerror(errno));
+         }
diff --git a/proftpd.spec b/proftpd.spec
index c772ee5..a7e0167 100644
--- a/proftpd.spec
+++ b/proftpd.spec
@@ -41,7 +41,7 @@
 %define _hardened_build 1
 
 #global prever rc3
-%global rpmrel 1
+%global rpmrel 2
 
 Summary:		Flexible, stable and highly-configurable FTP server
 Name:			proftpd
@@ -65,6 +65,7 @@ Source13:		http://search.cpan.org/CPAN/authors/id/C/CL/CLEMBURG/Test-Unit-0.14.t
 Patch2:			proftpd.conf-no-memcached.patch
 Patch4:			proftpd-1.3.4rc1-mod_vroot-test.patch
 Patch5:			proftpd-1.3.4-utf8.patch
+Patch20:		https://github.com/proftpd/proftpd/commit/3a777567d403a407f9f8ae257ea41efe5313c625.diff
 Patch27:		proftpd-mod-vroot-0.9.2-bug3841.patch
 BuildRoot:		%{_tmppath}/%{name}-%{version}-%{release}-root
 Requires(preun):	coreutils, findutils
@@ -206,6 +207,12 @@ cp -p %{SOURCE1} proftpd.conf
 # Fix character encoding in docs
 %patch5 -p1 -b .utf8
 
+# Upstream fix to ignore any ENOPROTOOPT errors when setting the IPv6 TCLASS (TOS)
+# flags on the socket; they make for noisier logging without providing any
+# actual value to the user/admin
+# http://bugs.proftpd.org/show_bug.cgi?id=4055
+%patch20 -p1
+
 # Fix possible symlink race when applying UserOwner to newly created directory
 # http://bugs.proftpd.org/show_bug.cgi?id=3841
 %patch27
@@ -487,6 +494,11 @@ fi
 %{_mandir}/man1/ftpwho.1*
 
 %changelog
+* Fri May 16 2014 Paul Howarth <paul at city-fan.org> 1.3.5-2
+- Add upstream fix to ignore any ENOPROTOOPT errors when setting the
+  IPv6 TCLASS (TOS) flags on the socket; they make for noisier logging
+  without providing any actual value to the user/admin (upstream bug 4055)
+
 * Fri May 16 2014 Paul Howarth <paul at city-fan.org> 1.3.5-1
 - Update to 1.3.5 (see NEWS for details)
 - Drop upstreamed patches


More information about the scm-commits mailing list