This patch adds Netfilter mark support and overhauls existing QOS features. Netfilter mark support is added to all existing TOS functionality including qos_flows, clientside_tos and tcp_outgoing_tos. Netfilter QOS marking requires the libnetfilter_conntrack library. Netfilter marking for clientside_tos and tcp_outgoing_tos requires no additional libraries. === modified file 'CREDITS' --- CREDITS 2010-08-13 10:17:20 +0000 +++ CREDITS 2010-09-12 21:48:39 +0000 @@ -342,6 +342,14 @@ ============================================================================== +lib/xstrto.cc: + + /* + * (C) 2000-2006 by the netfilter coreteam : + */ + +============================================================================== + lib/getopt.c: /* === modified file 'configure.in' --- configure.in 2010-09-10 15:41:41 +0000 +++ configure.in 2010-09-17 19:58:11 +0000 @@ -1309,6 +1309,37 @@ AC_MSG_NOTICE([Linux Netfilter support requested: ${enable_linux_netfilter:=auto}]) #will be AC_DEFINEd later, after checking for appropriate infrastructure + +dnl Look for libnetfilter_conntrack options (needed for QOS netfilter marking) +AC_ARG_WITH(netfilter-conntrack, + AS_HELP_STRING([--without-netfilter-conntrack], + [Do not use Netfilter conntrack libraries for packet marking. + A path to alternative library location may be specified by + using --with-netfilter=PATH. Default: auto-detect.]), [ + case "$withval" in + yes|no) with_netfilter_conntrack=$withval ;; + *) squid_opt_netfilterconntrackpath=$withval + with_netfilter_conntrack=yes ;; + esac], [ + with_netfilter_conntrack=yes +]) +if test x"$with_netfilter_conntrack" = "xyes"; then + if test "x$squid_opt_netfilterconntrackpath" != "x"; then + if ! test -d "$squid_opt_netfilterconntrackpath"; then + AC_MSG_ERROR([--with-netfilter-conntrack path '$squid_opt_netfilterconntrackpath' does not exist]) + fi + LDFLAGS="-L$squid_opt_netfilterconntrackpath/lib $LDFLAGS" + CPPFLAGS="-I$squid_opt_netfilterconntrackpath/include $CPPFLAGS" + else + AC_SEARCH_LIBS([nfct_query], [netfilter_conntrack],, + AC_MSG_ERROR([libnetfilter-conntrack library not found. Needed for netfilter-conntrack support]) \ + with_netfilter_conntrack=no) + fi + AC_CHECK_HEADERS([libnetfilter_conntrack/libnetfilter_conntrack.h \ + libnetfilter_conntrack/libnetfilter_conntrack_tcp.h],,with_netfilter_conntrack=no) +fi + + dnl Enable Large file support buildmodel="" squid_opt_enable_large_files=no @@ -2039,10 +2070,15 @@ SQUID_YESNO([$enableval], [unrecognized argument to --enable-zph-qos: $enableval]) ]) -SQUID_DEFINE_BOOL(USE_ZPH_QOS,${enable_zph_qos:=no}, +SQUID_DEFINE_BOOL(USE_QOS_TOS,${enable_zph_qos:=no}, [Enable Zero Penalty Hit QOS. When set, Squid will alter the TOS field of HIT responses to help policing network traffic]) AC_MSG_NOTICE([ZPH QOS enabled: $enable_zph_qos]) +if test x"$enable_zph_qos" = "xyes" ; then + AC_MSG_NOTICE([QOS netfilter marking enabled: $with_netfilter_conntrack]) + SQUID_DEFINE_BOOL(USE_QOS_NFMARK,${with_netfilter_conntrack:=no}, + [Enable support for QOS netfilter packet marking]) +fi if $CPPUNITCONFIG --help >/dev/null; then squid_cv_cppunit_version="`$CPPUNITCONFIG --version`" @@ -2133,6 +2169,7 @@ lber.h \ ldap.h \ libc.h \ + limits \ limits.h \ linux/posix_types.h \ linux/types.h \ @@ -2164,6 +2201,7 @@ signal.h \ sstream \ stdarg.h \ + stdbool.h \ stddef.h \ stdexcept \ stdio.h \ === modified file 'doc/release-notes/release-3.2.sgml' --- doc/release-notes/release-3.2.sgml 2010-09-06 08:13:20 +0000 +++ doc/release-notes/release-3.2.sgml 2010-09-17 20:03:34 +0000 @@ -403,6 +403,25 @@

Please check and update your squid.conf to use the text none for no limit instead of the old 0 (zero).

All users upgrading need to be aware that from Squid-3.3 setting this option to 0 (zero) will mean zero bytes of memory get pooled. + qos_flows +

New options mark and tos +

tos retains the original QOS functionality of the IP header TOS field. +

mark offers the same functionality, but with a netfilter mark value. +

These options should be placed immediately after qos_flows. +

The tos value is optional in order to maintain backwards compatability. +

This feature requires libnetfilter_conntrack, which must be included during compilation using --with-netfilter-conntrack. +

The preserve-miss functionality is available with the mark option and requires no kernel patching. + + tcp_outgoing_tos +

This parameter is now compatible with persistent server connections. + + clientside_mark and tcp_outgoing_mark +

New configuration parameters clientside_mark and tcp_outgoing_mark +

These 2 new configuration parameters allow packets leaving Squid on both the server and client side to be marked with a Netfilter mark value. +

clientside_mark marks packets on the client side, in the same way as the existing clientside_tos feature. +

tcp_outgoing_mark marks packets on the server side, in the same way as the existing tcp_outgoing_tos feature. +

This feature is only available for Netfilter environments. Unlike qos_flows, libnetfilter_conntrack is not required. + windows_ipaddrchangemonitor

Now only available to be set in Windows builds. @@ -486,6 +505,9 @@ to have any effect on existing builds other than fixing some mysterious lack of core dumps. The old /var/cache location was often non-writable which blocked core dumps creation. + --with-netfiler-conntrack +

Includes the libnetfilter_conntrack library, required for the new qos_flows option mark. + Changes to existing options