From nobody Thu Jan 13 14:53:13 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E2DF11951788; Thu, 13 Jan 2022 14:53:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JZS955f5Nz4mh8; Thu, 13 Jan 2022 14:53:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642085593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f22pMbCKmu+e9YPf3RXiBoSelJTl9UDeqDbVmfzuFI4=; b=ppgGKPPVSynTtgSpBWvfYtMvjYWyA9K25GEp71L8reslFiQ/13lXl2BNVqFhwNbUxhIrcf bcb7BCx6z6yHWHnsiTtOmDfw2CXl49PUNV8KkUidLvaBBA9pXqNzEAsG0KhM43zBEBaiWH IqrN5NxWsam0N4vL0NKfqAyOMXzaBfl57BtjGpyHE4UO9iYofIhFhOd3COlBPD82j4UhKY rvH0MrfHdOrlF/kKBvK6L/CXwDAr1gkY6e8CfFQwoFwSAM41quGY1JcVwM5NZNfvXYXx8I OxxCW4ydswBpRyai5VEL3t/bHbyg0BbNU6H31zfpcRVbqBVbZkmEPJNbU21xTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9670322572; Thu, 13 Jan 2022 14:53:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20DErDec008398; Thu, 13 Jan 2022 14:53:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20DErDir008397; Thu, 13 Jan 2022 14:53:13 GMT (envelope-from git) Date: Thu, 13 Jan 2022 14:53:13 GMT Message-Id: <202201131453.20DErDir008397@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Baptiste Daroussin Subject: git: dc303d54a751 - main - mail/mlmmj: add support for ipv6 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc303d54a75187db7fe6ec5ea59aa9f94a8c409f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642085593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f22pMbCKmu+e9YPf3RXiBoSelJTl9UDeqDbVmfzuFI4=; b=CS/jLhT9L7gzYXVhgByv9+uN5C60BIusJumaw9wTVfPCxeNx4+AYWT/dhgzyxvtuPqTOrd JmB1zQ2/b0A8Mq3XixYqufNJiOior/SF7ixQP2ucKSoSVXNLcn6t4s1fZVj0jvyADBuvck Gf0PQPHHW2yie6MvdLKshGqMIgevvNsAx0A6Z4WwQCF5LXpwqQ7WlQenn7xnVMe+fBjdaE q9dl6qc30yc1lPdpDRAUc8z/4uAkp8s/AVdwqUShg+CcsGZfSjzDG0D0pROSSv5cdKvvgF yYORKCqlCAncT0M3jog8ZZ7v8CrBHCcEQNS8ohxB+Jc1iBpTeOeEgS0N2zhKyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642085593; a=rsa-sha256; cv=none; b=m9/qpP3Ox2mjObxu8p+xqpa3qicYtp4wiQfIeOqrhL7aJ8a17JVGERyFbT9jZf10NKm003 qrFyVmrhg/dH2gSSCFIZQDwkZaRrXwvpY4TToePLriNogyXUKO3NBXNIhVzy9hdjLZSryD 8tkNRZ6gTHzMnk8AoqKdz3DfOUSPV65W0WiWcqaAC0zlfNXBbFro3IiU1xDF/m9rXto0eU u40rwoZuqxyvDF3xi306Q2PdiyXR7yEZXP71qfGb2Me5kFgXtSuOYUcDDZ2xrfEL7UZ870 uD+5VXRUNRPJp93EjZTTzc4oBo8XYToilou3d9rnDDlqeDDZlMXUvWmIjouyTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/ports/commit/?id=dc303d54a75187db7fe6ec5ea59aa9f94a8c409f commit dc303d54a75187db7fe6ec5ea59aa9f94a8c409f Author: Baptiste Daroussin AuthorDate: 2022-01-13 14:44:04 +0000 Commit: Baptiste Daroussin CommitDate: 2022-01-13 14:44:58 +0000 mail/mlmmj: add support for ipv6 --- mail/mlmmj/Makefile | 2 +- mail/mlmmj/files/patch-src_init__sockfd.c | 74 +++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/mail/mlmmj/Makefile b/mail/mlmmj/Makefile index 8d75ef9c50dd..b8b31051d641 100644 --- a/mail/mlmmj/Makefile +++ b/mail/mlmmj/Makefile @@ -2,7 +2,7 @@ PORTNAME= mlmmj PORTVERSION= 1.3.0 -PORTREVISION= 8 +PORTREVISION= 9 CATEGORIES= mail MASTER_SITES= http://mlmmj.org/releases/ diff --git a/mail/mlmmj/files/patch-src_init__sockfd.c b/mail/mlmmj/files/patch-src_init__sockfd.c new file mode 100644 index 000000000000..5eb98647a35d --- /dev/null +++ b/mail/mlmmj/files/patch-src_init__sockfd.c @@ -0,0 +1,74 @@ +--- src/init_sockfd.c.orig 2012-03-13 12:16:36 UTC ++++ src/init_sockfd.c +@@ -22,6 +22,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -29,35 +30,53 @@ + #include + #include + #include ++#include + + #include "init_sockfd.h" + #include "log_error.h" + + void init_sockfd(int *sockfd, const char *relayhost, unsigned short port) + { +- int len, on; +- struct sockaddr_in addr; ++ int on, sd; ++ struct addrinfo *ai = NULL, *curai, hints; ++ char srv[NI_MAXSERV]; ++ *sockfd = -1; + + if (getenv("MLMMJ_TESTING")) { + relayhost = "127.0.0.1"; + port = 10025; + } + +- *sockfd = socket(PF_INET, SOCK_STREAM, 0); ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_socktype = SOCK_STREAM; ++ hints.ai_family = PF_UNSPEC; ++ snprintf(srv, sizeof(srv), "%d", port); ++ if (getaddrinfo(relayhost, srv, &hints, &ai) != 0) { ++ log_error(LOG_ARGS, "Unable to lookup for relayhost %s:%s", ++ relayhost, srv); ++ return; ++ } + if(*sockfd == -1) { + log_error(LOG_ARGS, "Could not get socket"); + return; + } +- addr.sin_family = PF_INET; +- addr.sin_addr.s_addr = inet_addr(relayhost); +- addr.sin_port = htons(port); +- len = sizeof(addr); +- if(connect(*sockfd, (struct sockaddr *)&addr, len) == -1) { ++ for (curai = ai; curai != NULL; curai = curai->ai_next) { ++ if ((sd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol)) < 0) { ++ continue; ++ } ++ if (connect(sd, ai->ai_addr, ai->ai_addrlen) == 0) { ++ close(sd); ++ sd = -1; ++ continue; ++ } ++ break; ++ } ++ freeaddrinfo(ai); ++ if (sd == -1) { + log_error(LOG_ARGS, "Could not connect to %s", relayhost); +- close(*sockfd); +- *sockfd = -1; + return; + } ++ *sockfd = sd; + + on = 1; + if(setsockopt(*sockfd, SOL_SOCKET, SO_KEEPALIVE, (void *)&on,