- updated QoS patch, including upstream comments and AF_INET6 4-in-6 support

This commit is contained in:
Jaroslav Škarvada 2011-01-12 11:48:49 +01:00
parent f823fb2a17
commit 91beabb023
2 changed files with 139 additions and 47 deletions

View File

@ -1,5 +1,5 @@
--- sendmail-8.14.3/cf/m4/proto.m4.orig 2008-01-24 16:42:01.000000000 -0700
+++ sendmail-8.14.3/cf/m4/proto.m4 2010-04-01 11:24:43.000000000 -0600
--- sendmail-8.14.4/cf/m4/proto.m4.orig 2011-01-11 20:02:14.000000000 -0700
+++ sendmail-8.14.4/cf/m4/proto.m4 2011-01-11 20:02:14.000000000 -0700
@@ -251,6 +251,9 @@ _OPTION(SevenBitInput, `confSEVEN_BIT_IN
# 8-bit data handling
_OPTION(EightBitMode, `confEIGHT_BIT_HANDLING', `pass8')
@ -10,9 +10,9 @@
# wait for alias file rebuild (default units: minutes)
_OPTION(AliasWait, `confALIAS_WAIT', `5m')
--- sendmail-8.14.3/cf/cf/submit.mc.orig 2006-04-04 23:54:41.000000000 -0600
+++ sendmail-8.14.3/cf/cf/submit.mc 2010-03-19 12:08:25.000000000 -0600
@@ -22,6 +22,8 @@
--- sendmail-8.14.4/cf/cf/submit.mc.orig 2011-01-11 20:02:14.000000000 -0700
+++ sendmail-8.14.4/cf/cf/submit.mc 2011-01-11 20:02:14.000000000 -0700
@@ -22,6 +22,8 @@ define(`__OSTYPE__',`')dnl dirty hack to
define(`_USE_DECNET_SYNTAX_', `1')dnl support DECnet
define(`confTIME_ZONE', `USE_TZ')dnl
define(`confDONT_INIT_GROUPS', `True')dnl
@ -21,57 +21,106 @@
define(`confPID_FILE', `/var/run/sm-client.pid')dnl
dnl define(`confDIRECT_SUBMISSION_MODIFIERS',`C')dnl
FEATURE(`use_ct_file')dnl
--- sendmail-8.14.3/sendmail/sendmail.h.orig 2008-02-15 16:19:58.000000000 -0700
+++ sendmail-8.14.3/sendmail/sendmail.h 2009-11-28 14:11:51.000000000 -0700
@@ -2373,7 +2373,9 @@ EXTERN struct termescape TermEscape; /*
--- sendmail-8.14.4/sendmail/sendmail.h.orig 2009-12-18 10:08:01.000000000 -0700
+++ sendmail-8.14.4/sendmail/sendmail.h 2011-01-11 20:39:35.000000000 -0700
@@ -2387,7 +2387,14 @@ EXTERN struct termescape TermEscape; /*
EXTERN SOCKADDR ConnectOnlyTo; /* override connection address (for testing) */
EXTERN SOCKADDR RealHostAddr; /* address of host we are talking to */
extern const SM_EXC_TYPE_T EtypeQuickAbort; /* type of a QuickAbort exception */
-
+#if defined(SOL_IP) && defined(IP_TOS)
+EXTERN int InetQoS; /* QoS mapping */
+#if _FFR_QOS
+# if !defined(SOL_IP) && defined(IPPROTO_IP)
+# define SOL_IP IPPROTO_IP
+# endif
+# if defined(SOL_IP) && defined(IP_TOS)
+EXTERN int InetQoS; /* QoS mapping */
+# endif
+#endif
EXTERN int ConnectionRateWindowSize;
--- sendmail-8.14.3/sendmail/daemon.c.orig 2008-02-13 17:20:26.000000000 -0700
+++ sendmail-8.14.3/sendmail/daemon.c 2009-11-28 14:16:37.000000000 -0700
@@ -104,6 +104,8 @@
--- sendmail-8.14.4/sendmail/conf.c.orig 2011-01-11 20:02:14.000000000 -0700
+++ sendmail-8.14.4/sendmail/conf.c 2011-01-11 20:24:29.000000000 -0700
@@ -6298,6 +6298,10 @@ char *FFRCompileOptions[] =
#if _FFR_QF_PARANOIA
"_FFR_QF_PARANOIA",
#endif /* _FFR_QF_PARANOIA */
+#if _FFR_QOS && defined(SOL_IP) && defined(IP_TOS)
+ /* QoS */
+ "_FFR_QOS",
+#endif /* _FFR_QOS && defined(SOL_IP) && defined(IP_TOS) */
#if _FFR_QUEUEDELAY
/* Exponential queue delay; disabled in 8.13 since it isn't used. */
"_FFR_QUEUEDELAY",
--- sendmail-8.14.4/sendmail/daemon.c.orig 2009-12-17 18:12:40.000000000 -0700
+++ sendmail-8.14.4/sendmail/daemon.c 2011-01-11 20:46:37.000000000 -0700
@@ -104,6 +104,10 @@ static int NDaemons = 0; /* actual num
static time_t NextDiskSpaceCheck = 0;
+#if _FFR_QOS && defined(SOL_IP) && defined(IP_TOS)
+int InetQoS = 0; /* none by default */
+#endif /* _FFR_QOS && defined(SOL_IP) && defined(IP_TOS) */
+
/*
** GETREQUESTS -- open mail IPC port and get requests.
**
@@ -1131,6 +1131,12 @@ opendaemonsocket(d, firsttime)
@@ -1131,6 +1135,16 @@ opendaemonsocket(d, firsttime)
(void) setsockopt(d->d_socket, SOL_SOCKET,
SO_KEEPALIVE, (char *)&on, sizeof(on));
+#if defined(SOL_IP) && defined(IP_TOS)
+ if (d->d_addr.sa.sa_family == AF_INET && InetQoS != 0x00)
+ (void) setsockopt(d->d_socket, SOL_IP,
+ IP_TOS, (char *)&InetQoS, sizeof(InetQoS));
+#endif
+#if _FFR_QOS && defined(SOL_IP) && defined(IP_TOS)
+ if (InetQoS != 0x00
+ && (d->d_addr.sa.sa_family == AF_INET
+ || (d->d_addr.sin6.sin6_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(d->d_addr.sin6.sin6_addr.s6_addr32)))) {
+ if (setsockopt(d->d_socket, SOL_IP,
+ IP_TOS, (char *)&InetQoS, sizeof(InetQoS)) < 0)
+ syserr("opendaemonsock: daemon %s: setsockopt(IP_TOS)", d->d_name);
+ }
+#endif /* _FFR_QOS && defined(SOL_IP) && defined(IP_TOS) */
+
#ifdef SO_RCVBUF
if (d->d_tcprcvbufsize > 0)
{
--- sendmail-8.14.3/sendmail/readcf.c.orig 2008-02-14 10:25:14.000000000 -0700
+++ sendmail-8.14.3/sendmail/readcf.c 2009-12-10 00:12:23.000000000 -0700
@@ -2271,6 +2271,10 @@
@@ -2565,6 +2579,16 @@ gothostent:
return EX_TEMPFAIL;
}
+#if _FFR_QOS && defined(SOL_IP) && defined(IP_TOS)
+ if (InetQoS != 0x00
+ && (family == AF_INET
+ || (family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(addr.sin6.sin6_addr.s6_addr32))))
+ {
+ if (setsockopt(s, SOL_IP, IP_TOS,
+ (char *)&InetQoS, sizeof(InetQoS)) < 0)
+ syserr("makeconnection: setsockopt(IP_TOS)");
+ }
+#endif /* _FFR_QOS && defined(SOL_IP) && defined(IP_TOS) */
#ifdef SO_SNDBUF
if (ClientSettings[family].d_tcpsndbufsize > 0)
{
--- sendmail-8.14.4/sendmail/readcf.c.orig 2009-10-26 11:47:00.000000000 -0600
+++ sendmail-8.14.4/sendmail/readcf.c 2011-01-11 20:37:35.000000000 -0700
@@ -18,6 +18,7 @@
#if NETINET || NETINET6
# include <arpa/inet.h>
+# include <netinet/ip.h>
#endif /* NETINET || NETINET6 */
#define SECONDS
@@ -2271,6 +2271,10 @@ static struct optioninfo
# define O_RCPTTHROTDELAY 0xe6
{ "BadRcptThrottleDelay", O_RCPTTHROTDELAY, OI_SAFE },
#endif /* _FFR_RCPTTHROTDELAY */
+#if defined(SOL_IP) && defined(IP_TOS)
+#if _FFR_QOS && defined(SOL_IP) && defined(IP_TOS)
+# define O_INETQOS 0xe7
+ { "InetQoS", O_INETQOS, OI_NONE },
+#endif
{ NULL, '\0', OI_NONE }
};
@@ -2351,6 +2355,37 @@
@@ -2351,6 +2355,77 @@ static struct ssl_options
};
#endif /* STARTTLS && _FFR_TLS_1 */
@ -81,26 +130,66 @@
+ char *name; /* name of the setting */
+ int value; /* corresponding setsockopt() value */
+} QoSMap[] = {
+ { "CS0", 0x00 },
+ { "CS1", 0x20 },
+ { "AF11", 0x28 },
+ { "AF12", 0x30 },
+ { "AF13", 0x38 },
+ { "CS2", 0x40 },
+ { "AF21", 0x48 },
+ { "AF22", 0x50 },
+ { "AF23", 0x58 },
+ { "CS3", 0x60 },
+ { "AF31", 0x68 },
+ { "AF32", 0x70 },
+ { "AF33", 0x78 },
+ { "CS4", 0x80 },
+ { "AF41", 0x88 },
+ { "AF42", 0x90 },
+ { "AF43", 0x98 },
+ { "CS5", 0xa0 },
+ { "CS6", 0xc0 },
+ { "CS7", 0xe0 },
+#ifdef IPTOS_CLASS_CS0
+ { "CS0", IPTOS_CLASS_CS0 },
+#endif
+#ifdef IPTOS_CLASS_CS1
+ { "CS1", IPTOS_CLASS_CS1 },
+#endif
+#ifdef IPTOS_DSCP_AF11
+ { "AF11", IPTOS_DSCP_AF11 },
+#endif
+#ifdef IPTOS_DSCP_AF12
+ { "AF12", IPTOS_DSCP_AF12 },
+#endif
+#ifdef IPTOS_DSCP_AF13
+ { "AF13", IPTOS_DSCP_AF13 },
+#endif
+#ifdef IPTOS_CLASS_CS2
+ { "CS2", IPTOS_CLASS_CS2 },
+#endif
+#ifdef IPTOS_DSCP_AF21
+ { "AF21", IPTOS_DSCP_AF21 },
+#endif
+#ifdef IPTOS_DSCP_AF22
+ { "AF22", IPTOS_DSCP_AF22 },
+#endif
+#ifdef IPTOS_DSCP_AF23
+ { "AF23", IPTOS_DSCP_AF23 },
+#endif
+#ifdef IPTOS_CLASS_CS3
+ { "CS3", IPTOS_CLASS_CS3 },
+#endif
+#ifdef IPTOS_DSCP_AF31
+ { "AF31", IPTOS_DSCP_AF31 },
+#endif
+#ifdef IPTOS_DSCP_AF32
+ { "AF32", IPTOS_DSCP_AF32 },
+#endif
+#ifdef IPTOS_DSCP_AF33
+ { "AF33", IPTOS_DSCP_AF33 },
+#endif
+#ifdef IPTOS_CLASS_CS4
+ { "CS4", IPTOS_CLASS_CS4 },
+#endif
+#ifdef IPTOS_DSCP_AF41
+ { "AF41", IPTOS_DSCP_AF41 },
+#endif
+#ifdef IPTOS_DSCP_AF42
+ { "AF42", IPTOS_DSCP_AF42 },
+#endif
+#ifdef IPTOS_DSCP_AF43
+ { "AF43", IPTOS_DSCP_AF43 },
+#endif
+#ifdef IPTOS_CLASS_CS5
+ { "CS5", IPTOS_CLASS_CS5 },
+#endif
+#ifdef IPTOS_CLASS_CS6
+ { "CS6", IPTOS_CLASS_CS6 },
+#endif
+#ifdef IPTOS_CLASS_CS7
+ { "CS7", IPTOS_CLASS_CS7 },
+#endif
+ { "none", 0x00 },
+ { NULL, 0 }
+};
@ -109,7 +198,7 @@
# define CANONIFY(val)
@@ -3985,6 +4020,33 @@
@@ -3985,6 +4060,33 @@ setoption(opt, val, safe, sticky, e)
break;
#endif /* _FFR_BADRCPT_SHUTDOWN */

View File

@ -14,7 +14,7 @@
Summary: A widely used Mail Transport Agent (MTA)
Name: sendmail
Version: 8.14.4
Release: 18%{?dist}
Release: 19%{?dist}
License: Sendmail
Group: System Environment/Daemons
URL: http://www.sendmail.org/
@ -209,7 +209,7 @@ sed -i 's|/usr/local/bin/perl|%{_bindir}/perl|' contrib/*.pl
cat > redhat.config.m4 << EOF
define(\`confMAPDEF', \`-DNEWDB -DNIS -DHESIOD -DMAP_REGEX -DSOCKETMAP -DNAMED_BIND=1')
define(\`confOPTIMIZE', \`\`\`\`${RPM_OPT_FLAGS}'''')
define(\`confENVDEF', \`-I%{_includedir}/libdb -I/usr/kerberos/include -Wall -DXDEBUG=0 -DTCPWRAPPERS -DNETINET6 -DHES_GETMAILHOST -DUSE_VENDOR_CF_PATH=1 -D_FFR_TLS_1 -D_FFR_LINUX_MHNL')
define(\`confENVDEF', \`-I%{_includedir}/libdb -I/usr/kerberos/include -Wall -DXDEBUG=0 -DTCPWRAPPERS -DNETINET6 -DHES_GETMAILHOST -DUSE_VENDOR_CF_PATH=1 -D_FFR_TLS_1 -D_FFR_LINUX_MHNL -D_FFR_QOS')
define(\`confLIBDIRS', \`-L/usr/kerberos/%{_lib}')
define(\`confLIBS', \`-lnsl -lwrap -lhesiod -lcrypt -ldb -lresolv')
define(\`confMANOWN', \`root')
@ -648,6 +648,9 @@ exit 0
%changelog
* Wed Jan 12 2011 Jaroslav Škarvada <jskarvad@redhat.com> - 8.14.4-19
- updated QoS patch, including upstream comments and AF_INET6 4-in-6 support
* Mon Jan 10 2011 Jaroslav Škarvada <jskarvad@redhat.com> - 8.14.4-18
- add QoS support, patch from Philip Prindeville <philipp@fedoraproject.org>
upstream reserved option ID 0xe7 for testing of this new feature (#576643)