flag the local socket listener as local.
authoreric <eric@openbsd.org>
Fri, 1 Jul 2016 17:53:23 +0000 (17:53 +0000)
committereric <eric@openbsd.org>
Fri, 1 Jul 2016 17:53:23 +0000 (17:53 +0000)
clarify check for local listeners.

ok gilles@ millert@

usr.sbin/smtpd/parse.y
usr.sbin/smtpd/smtp_session.c

index d4c0fcb..6d14f9a 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.185 2016/06/21 21:35:25 benno Exp $       */
+/*     $OpenBSD: parse.y,v 1.186 2016/07/01 17:53:23 eric Exp $        */
 
 /*
  * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -2093,6 +2093,7 @@ create_sock_listener(struct listen_opts *lo)
        lo->hostname = conf->sc_hostname;
        l->ss.ss_family = AF_LOCAL;
        l->ss.ss_len = sizeof(struct sockaddr *);
+       l->local = 1;
        config_listener(l, lo);
 
        return (l);
index 191cb10..9bfcaa0 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: smtp_session.c,v 1.278 2016/06/29 06:46:06 eric Exp $ */
+/*     $OpenBSD: smtp_session.c,v 1.279 2016/07/01 17:53:23 eric Exp $ */
 
 /*
  * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -694,7 +694,7 @@ smtp_session(struct listener *listener, int sock,
        rfc2822_body_callback(&s->tx->rfc2822_parser,
            dataline_callback, s);
 
-       if (hostname || listener->local || listener->port == 587) {
+       if (listener->local || listener->port == 587) {
                rfc2822_missing_header_callback(&s->tx->rfc2822_parser, "date",
                    header_missing_callback, s);
                rfc2822_missing_header_callback(&s->tx->rfc2822_parser, "message-id",