--- network_io/unix/sockopt.c (revision 1184904) +++ network_io/unix/sockopt.c (working copy) @@ -17,6 +17,9 @@ #include "apr_arch_networkio.h" #include "apr_strings.h" +#if !defined(SOL_IP) +#define SOL_IP IPPROTO_IP +#endif static apr_status_t soblock(int sd) { @@ -330,6 +333,14 @@ return APR_ENOTIMPL; #endif break; + case APR_SO_IPTOS: +#if defined(IP_TOS) + if (setsockopt(sock->socketdes, SOL_IP, IP_TOS, (void *)&on, sizeof(int)) == -1) { + return errno; + } +#else + return APR_ENOTIMPL; +#endif default: return APR_EINVAL; } --- include/apr.h.in (revision 1184904) +++ include/apr.h.in (working copy) @@ -82,8 +82,10 @@ #define APR_HAVE_MSWSOCK_H @mswsockh@ #define APR_HAVE_NETDB_H @netdbh@ #define APR_HAVE_NETINET_IN_H @netinet_inh@ +#define APR_HAVE_NETINET_IN_SYSTM_H @netinet_in_systmh@ #define APR_HAVE_NETINET_SCTP_H @netinet_sctph@ #define APR_HAVE_NETINET_SCTP_UIO_H @netinet_sctp_uioh@ +#define APR_HAVE_NETINET_IP_H @netinet_iph@ #define APR_HAVE_NETINET_TCP_H @netinet_tcph@ #define APR_HAVE_PROCESS_H @processh@ #define APR_HAVE_PTHREAD_H @pthreadh@ --- include/apr.hw (revision 1184904) +++ include/apr.hw (working copy) @@ -128,8 +128,10 @@ #define APR_HAVE_MSWSOCK_H APR_NOT_IN_WCE #define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 +#define APR_HAVE_NETINET_IN_SYSTM_H 0 #define APR_HAVE_NETINET_SCTP_H 0 #define APR_HAVE_NETINET_SCTP_UIO_H 0 +#define APR_HAVE_NETINET_IP_H 0 #define APR_HAVE_NETINET_TCP_H 0 #define APR_HAVE_PROCESS_H 1 #define APR_HAVE_PTHREAD_H 0 --- include/arch/unix/apr_arch_networkio.h (revision 1184904) +++ include/arch/unix/apr_arch_networkio.h (working copy) @@ -52,6 +52,12 @@ #if APR_HAVE_NETINET_TCP_H #include #endif +#if APR_HAVE_NETINET_IN_SYSTM_H +#include +#endif +#if APR_HAVE_NETINET_IP_H +#include +#endif #if APR_HAVE_NETINET_SCTP_UIO_H #include #endif --- include/apr_network_io.h (revision 1184904) +++ include/apr_network_io.h (working copy) @@ -105,6 +105,7 @@ */ #define APR_SO_BROADCAST 65536 /**< Allow broadcast */ +#define APR_SO_IPTOS 131072 /**< Set IP ToS markings on traffic. */ /** @} */ --- include/apr.hnw (revision 1184904) +++ include/apr.hnw (working copy) @@ -92,13 +92,16 @@ #define APR_HAVE_ARPA_INET_H 0 #define APR_HAVE_NETDB_H 0 #define APR_HAVE_NETINET_IN_H 0 +#define APR_HAVE_NETINET_IN_SYSTM_H 0 #else #define APR_HAVE_ARPA_INET_H 1 #define APR_HAVE_NETDB_H 1 #define APR_HAVE_NETINET_IN_H 1 +#define APR_HAVE_NETINET_IN_SYSTM_H 1 #endif #define APR_HAVE_NETINET_SCTP_H 0 #define APR_HAVE_NETINET_SCTP_UIO_H 0 +#define APR_HAVE_NETINET_IP_H 0 #define APR_HAVE_NETINET_TCP_H 0 #define APR_HAVE_PTHREAD_H 0 #define APR_HAVE_SIGNAL_H 1 --- configure.in (revision 1184904) +++ configure.in (working copy) @@ -1316,6 +1316,7 @@ kernel/OS.h \ net/errno.h \ netinet/in.h \ + netinet/in_systm.h \ netinet/sctp.h \ netinet/sctp_uio.h \ sys/file.h \ @@ -1368,6 +1369,27 @@ netinet_tcph=0 fi +# Debian has a similiar problem with wihich prevents it +# from being included by itself. Check for manually, +# including another header file first. +AC_CACHE_CHECK([for netinet/ip.h], [apr_cv_hdr_netinet_ip_h], +[AC_TRY_CPP( +[#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN_SYSTM_H +#include +#endif +#include +], [apr_cv_hdr_netinet_ip_h=yes], [apr_cv_hdr_netinet_ip_h=no])]) +cat conftest.c >> /dev/tty +if test "$apr_cv_hdr_netinet_ip_h" = "yes"; then + netinet_iph=1 + AC_DEFINE([HAVE_NETINET_IP_H], 1, [Defined if netinet/ip.h is present]) +else + netinet_iph=0 +fi + AC_SUBST(arpa_ineth) AC_SUBST(conioh) AC_SUBST(ctypeh) @@ -1381,6 +1403,8 @@ AC_SUBST(mswsockh) AC_SUBST(netdbh) AC_SUBST(netinet_inh) +AC_SUBST(netinet_in_systmh) +AC_SUBST(netinet_iph) AC_SUBST(netinet_sctph) AC_SUBST(netinet_sctp_uioh) AC_SUBST(netinet_tcph) --- build/aprenv.py (revision 1184904) +++ build/aprenv.py (working copy) @@ -225,7 +225,9 @@ kernel/OS.h net/errno.h netinet/in.h + netinet/in_systm.h netinet/sctp.h + netinet/ip.h netinet/tcp.h netinet/sctp_uio.h sys/file.h