summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoritojun <itojun@NetBSD.org>2001-01-15 17:49:25 +0000
committeritojun <itojun@NetBSD.org>2001-01-15 17:49:25 +0000
commitef39bb4e09b752d4e06b968e26f3efade438771f (patch)
tree71aacdb8b1d6e5d8247158a0ef9df64946b725e1
parent880b841888b19ac73d9bd2ab28493cd774b1ea95 (diff)
pull DaemonPortOptions modifier for "optional address", from
8.12.x change (Modifiers=O). this will let us use the same sendmail.cf file on IPv4/v6, and IPv4-only kernels. (we do not really need netbsd-proto-IPv4only.cf any more)
-rw-r--r--gnu/dist/sendmail/sendmail/daemon.c10
-rw-r--r--gnu/dist/sendmail/sendmail/sendmail.h2
-rw-r--r--gnu/usr.sbin/sendmail/cf/cf/netbsd-proto.mc7
3 files changed, 16 insertions, 3 deletions
diff --git a/gnu/dist/sendmail/sendmail/daemon.c b/gnu/dist/sendmail/sendmail/daemon.c
index 68ab6c0d881..07d1ed7896a 100644
--- a/gnu/dist/sendmail/sendmail/daemon.c
+++ b/gnu/dist/sendmail/sendmail/daemon.c
@@ -270,6 +270,8 @@ getrequests(e)
{
if (timenow < Daemons[idx].d_refuse_connections_until)
continue;
+ if (bitnset(D_DISABLE, Daemons[idx].d_flags))
+ continue;
if (refuseconnections(Daemons[idx].d_name, e, idx))
{
if (Daemons[idx].d_socket >= 0)
@@ -880,6 +882,14 @@ opendaemonsocket(d, firsttime)
{
save_errno = errno;
syserr("opendaemonsocket: daemon %s: can't create server SMTP socket", d->d_name);
+ if (bitnset(D_OPTIONAL, d->d_flags) &&
+ (save_errno == EAFNOSUPPORT ||
+ save_errno == EPROTONOSUPPORT))
+ {
+ syserr("opendaemonsocket: daemon %s: optional socket disabled", d->d_name);
+ setbitn(D_DISABLE, d->d_flags);
+ return -1;
+ }
severe:
if (LogLevel > 0)
sm_syslog(LOG_ALERT, NOQID,
diff --git a/gnu/dist/sendmail/sendmail/sendmail.h b/gnu/dist/sendmail/sendmail/sendmail.h
index d5d046a9fa8..e353629b3ea 100644
--- a/gnu/dist/sendmail/sendmail/sendmail.h
+++ b/gnu/dist/sendmail/sendmail/sendmail.h
@@ -1444,6 +1444,8 @@ struct termescape
#define D_NOCANON 'C' /* no canonification (cf) */
#define D_NOETRN 'E' /* no ETRN (MSA) */
#define D_ETRNONLY ((char)0x01) /* allow only ETRN (disk low) */
+#define D_OPTIONAL 'O' /* optional socket */
+#define D_DISABLE ((char)0x02) /* optional socket disabled */
/* Flags for submitmode */
#define SUBMIT_UNKNOWN 0x0000 /* unknown agent type */
diff --git a/gnu/usr.sbin/sendmail/cf/cf/netbsd-proto.mc b/gnu/usr.sbin/sendmail/cf/cf/netbsd-proto.mc
index a8ae737a99b..1e2433a249f 100644
--- a/gnu/usr.sbin/sendmail/cf/cf/netbsd-proto.mc
+++ b/gnu/usr.sbin/sendmail/cf/cf/netbsd-proto.mc
@@ -1,4 +1,4 @@
-# $NetBSD: netbsd-proto.mc,v 1.7 2000/08/25 02:54:29 hubertf Exp $
+# $NetBSD: netbsd-proto.mc,v 1.8 2001/01/15 17:49:26 itojun Exp $
#
# This is the prototype file for a configuration that supports SMTP
@@ -8,6 +8,7 @@
# The path is relative to ${CFDIR}/cf, see Makefile:
include(`../../../../usr.sbin/sendmail/cf/cf/netbsd-proto-IPv4only.mc')
-# Enable IPv6:
+# Enable IPv6. IPv6 is marked as optional so the configuration file
+# can be used on IPV4-only kernel as well.
DAEMON_OPTIONS(`Family=inet, address=0.0.0.0, Name=MTA')dnl
-DAEMON_OPTIONS(`Family=inet6, address=::, Name=MTA6')dnl
+DAEMON_OPTIONS(`Family=inet6, address=::, Name=MTA6, Modifiers=O')dnl