c8bf632
diff --git a/src/inet.c b/src/inet.c
c8bf632
index aa94975..1e9b959 100644
c8bf632
--- a/src/inet.c
c8bf632
+++ b/src/inet.c
c8bf632
@@ -2,7 +2,7 @@
c8bf632
  * ProFTPD - FTP server daemon
c8bf632
  * Copyright (c) 1997, 1998 Public Flood Software
c8bf632
  * Copyright (c) 1999, 2000 MacGyver aka Habeeb J. Dihu <macgyver@tos.net>
c8bf632
- * Copyright (c) 2001-2013 The ProFTPD Project team
c8bf632
+ * Copyright (c) 2001-2014 The ProFTPD Project team
c8bf632
  *
c8bf632
  * This program is free software; you can redistribute it and/or modify
c8bf632
  * it under the terms of the GNU General Public License as published by
c8bf632
@@ -771,8 +771,15 @@ int pr_inet_set_proto_opts(pool *p, conn_t *c, int mss, int nodelay,
c8bf632
     /* Only set TCLASS flags on IPv6 sockets; IPv4 sockets use TOS. */
c8bf632
     if (pr_netaddr_get_family(c->local_addr) == AF_INET6) {
c8bf632
       if (c->listen_fd != -1) {
c8bf632
-        if (setsockopt(c->listen_fd, ip_level, IPV6_TCLASS, (void *) &tos,
c8bf632
-            sizeof(tos)) < 0) {
c8bf632
+        int res;
c8bf632
+
c8bf632
+        res = setsockopt(c->listen_fd, ip_level, IPV6_TCLASS, (void *) &tos,
c8bf632
+          sizeof(tos));
c8bf632
+        if (res < 0
c8bf632
+#ifdef ENOPROTOOPT
c8bf632
+            && errno != ENOPROTOOPT
c8bf632
+#endif /* !ENOPROTOOPT */
c8bf632
+          ) {
c8bf632
           pr_log_pri(PR_LOG_NOTICE, "error setting listen fd IPV6_TCLASS: %s",
c8bf632
             strerror(errno));
c8bf632
         }