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 'configure.in' --- configure.in 2010-09-05 09:27:34 +0000 +++ configure.in 2010-09-05 17:03:00 +0000 @@ -1279,6 +1279,43 @@ 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([--with-netfilter-conntrack=PATH], + [Compile with the Netfilter conntrack libraries. The path to + the development libraries and headers + installation can be specified if outside of the + system standard directories (default=autodetect)]), [ + case "$withval" in + yes) unset netfilterconntrackpath ;; + no) netfilterconntrackpath=no ;; + *) netfilterconntrackpath=$withval ;; + esac +]) +if test x"$netfilterconntrackpath" != "xno"; then + if test "x$netfilterconntrackpath" != "x"; then + if ! test -x "$netfilterconntrackpath"; then + AC_MSG_ERROR([--with-netfilter-conntrack path '$netfilterconntrackpath' not executable]) + fi + LDFLAGS="-L$netfilterconntrackpath/lib $LDFLAGS" + CPPFLAGS="-I$netfilterconntrackpath/include $CPPFLAGS" + with_netfilter_conntrack=yes + else + AC_CHECK_LIB([netfilter_conntrack], [nfct_query],, + AC_MSG_ERROR([libnetfilter-conntrack library not found. Needed for netfilter-conntrack support]), + [-lnetfilter_conntrack]) + AC_CHECK_HEADERS([libnetfilter_conntrack/libnetfilter_conntrack.h \ + libnetfilter_conntrack/libnetfilter_conntrack_tcp.h]) + if test "x$ac_cv_lib_netfilter_conntrack_nfct_query" = "xyes" \ + -a "x$ac_cv_header_libnetfilter_conntrack_h"="xyes" \ + -a "x$ac_cv_header_libnetfilter_conntrack_tcp_h"="xyes"; then + with_netfilter_conntrack=yes + fi + fi +fi + + dnl Enable Large file support buildmodel="" squid_opt_enable_large_files=no @@ -2009,10 +2046,19 @@ 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 "$enable_zph_qos" = "yes" ; then + if test "$with_netfilter_conntrack" = "yes" ; then + AC_MSG_NOTICE([QOS netfilter marking enabled: $with_netfilter_conntrack]) + SQUID_DEFINE_BOOL(USE_QOS_NFMARK,$with_netfilter_conntrack, + [Enable support for QOS netfilter packet marking]) + else + AC_MSG_WARN([--with-netfilter-conntrack not enabled. QOS features will not support Netfilter marking.]) + fi +fi if $CPPUNITCONFIG --help >/dev/null; then squid_cv_cppunit_version="`$CPPUNITCONFIG --version`" === modified file 'doc/release-notes/release-3.2.sgml' --- doc/release-notes/release-3.2.sgml 2010-09-03 13:30:11 +0000 +++ doc/release-notes/release-3.2.sgml 2010-09-05 16:15:22 +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. @@ -479,6 +498,9 @@ Currently one demo helper fake is provided in shell and C++ forms to demonstrate the helper protocol usage and provide exemplar code. + --with-netfiler-conntrack +

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