f823fb2a17
upstream reserved option ID 0xe7 for testing of this new feature (#576643)
146 lines
4.0 KiB
Diff
146 lines
4.0 KiB
Diff
--- 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
|
|
@@ -251,6 +251,9 @@ _OPTION(SevenBitInput, `confSEVEN_BIT_IN
|
|
# 8-bit data handling
|
|
_OPTION(EightBitMode, `confEIGHT_BIT_HANDLING', `pass8')
|
|
|
|
+# DSCP marking of traffic (IP_TOS)
|
|
+_OPTION(InetQoS, `confINET_QOS', `none')
|
|
+
|
|
# 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 @@
|
|
define(`_USE_DECNET_SYNTAX_', `1')dnl support DECnet
|
|
define(`confTIME_ZONE', `USE_TZ')dnl
|
|
define(`confDONT_INIT_GROUPS', `True')dnl
|
|
+dnl # If you're operating in a DSCP/RFC-4594 environment with QoS
|
|
+dnl define(`confINET_QOS', `AF11')dnl
|
|
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; /*
|
|
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 */
|
|
+#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 @@
|
|
|
|
static time_t NextDiskSpaceCheck = 0;
|
|
|
|
+int InetQoS = 0; /* none by default */
|
|
+
|
|
/*
|
|
** GETREQUESTS -- open mail IPC port and get requests.
|
|
**
|
|
@@ -1131,6 +1131,12 @@ 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
|
|
+
|
|
#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 @@
|
|
# define O_RCPTTHROTDELAY 0xe6
|
|
{ "BadRcptThrottleDelay", O_RCPTTHROTDELAY, OI_SAFE },
|
|
#endif /* _FFR_RCPTTHROTDELAY */
|
|
+#if defined(SOL_IP) && defined(IP_TOS)
|
|
+# define O_INETQOS 0xe7
|
|
+ { "InetQoS", O_INETQOS, OI_NONE },
|
|
+#endif
|
|
|
|
{ NULL, '\0', OI_NONE }
|
|
};
|
|
@@ -2351,6 +2355,37 @@
|
|
};
|
|
#endif /* STARTTLS && _FFR_TLS_1 */
|
|
|
|
+#ifdef O_INETQOS
|
|
+static struct qosmap
|
|
+{
|
|
+ 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 },
|
|
+ { "none", 0x00 },
|
|
+ { NULL, 0 }
|
|
+};
|
|
+#endif
|
|
+
|
|
|
|
# define CANONIFY(val)
|
|
|
|
@@ -3985,6 +4020,33 @@
|
|
break;
|
|
#endif /* _FFR_BADRCPT_SHUTDOWN */
|
|
|
|
+#ifdef O_INETQOS
|
|
+ case O_INETQOS:
|
|
+ {
|
|
+ struct qosmap *qmp;
|
|
+ InetQoS = -1;
|
|
+
|
|
+ for (qmp = QoSMap; qmp->name != NULL; ++qmp) {
|
|
+ if (!strcmp(val, qmp->name)) {
|
|
+ InetQoS = qmp->value;
|
|
+ break;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ /*
|
|
+ ** we could allow writing it as a hex value, but
|
|
+ ** we don't at this time.
|
|
+ **/
|
|
+ if (qmp->name == NULL) {
|
|
+ (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT,
|
|
+ "Warning: Option: %s unknown parameter '%s'\n",
|
|
+ OPTNAME, val);
|
|
+ break;
|
|
+ }
|
|
+ break;
|
|
+ }
|
|
+#endif
|
|
+
|
|
default:
|
|
if (tTd(37, 1))
|
|
{
|