From nobody Sat Nov 27 19:06:32 2021 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 635A518C7F9C; Sat, 27 Nov 2021 19:06:33 +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 4J1h1475nrz4ngL; Sat, 27 Nov 2021 19:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 D57AD20FEE; Sat, 27 Nov 2021 19:06:32 +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 1ARJ6W1j095848; Sat, 27 Nov 2021 19:06:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ARJ6Wvt095847; Sat, 27 Nov 2021 19:06:32 GMT (envelope-from git) Date: Sat, 27 Nov 2021 19:06:32 GMT Message-Id: <202111271906.1ARJ6Wvt095847@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Eugene Grosbein Subject: git: 993b356ba11d - main - net/mpd5: undo recent change for L2TP server. 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: eugen X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 993b356ba11d11177c3fc60a558a734d27b2e8a2 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638039993; 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=VBUP8/9kw9bCjJaktHzgTia0wWxHLUST/UvLvxl4M00=; b=k2fTseQichf+C1Jwkhq6vX4v+LNNU+Ei62KgGzuSAEIQZidPPZbBb1nTgdGPm04vwpmQVf VPxNtptfUvwGhFmasi9Et0igl+IVfS/+cpn0zia8nwjeVoOHD4toertmGQc4n44gs1sdfF wtShNQxpYvQfWxwrUip0uRly25piULH7VLVWlFjGWaBm90+yLE7SPAH0qZNGJsASImP4oQ UAIjotTDo738LnUw2SClX7xjDa4Je67ncX8iv0MrHRqljaFA1a4oqzTxYk8fs039IsRvx1 wYmWz3fwQBwUjh6+lbb1/uW4AIJt3dJWoseQ7vJDN9RyiM51wjejPasyxH/oDA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638039993; a=rsa-sha256; cv=none; b=h04GDpWDfnCG1AmRz5oOuG8AHh5aJIxWshIl7wzmRLe5jMMPetpqy9WQxPnQw8fRJIdUzq 4Hzd1UK7B3t3ndhUgE1WVAhu8nZyrN/yWdNchXkjjINpPqd0iR4iXH/cJU/z3Zk5oNfOmQ 34hpnztSXXYU/rYW6+E/7jL6U4S5CL5USGKfNRcZiCaW6UXrneJQ0z21ZUKyNc28Lw+QRL 6fJ6CaiCC5zk8aft/BcQBleeszsYy+F3vrMQ1emg3i4I4YIwWZSEi4h4xWcW4WUTAgONWw dKWC0nPKPHXsiOSm0UHydeGgYMfVnZ/jxaWOAKWYnpJFkck21rct5QQ9MoD8vQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/ports/commit/?id=993b356ba11d11177c3fc60a558a734d27b2e8a2 commit 993b356ba11d11177c3fc60a558a734d27b2e8a2 Author: Eugene Grosbein AuthorDate: 2021-11-27 19:02:07 +0000 Commit: Eugene Grosbein CommitDate: 2021-11-27 19:02:07 +0000 net/mpd5: undo recent change for L2TP server. Temporary remove a change to L2TP server introduced after mpd5-5.9_2 (an attempt to improve multi-homed server behavior) because of discovered bug that can result in a hang of the process. Fixed version will be added later after more testing. Reported by: Eugene Selin at SourceForge --- net/mpd5/files/patch-l2tp-multihomed | 124 ----------------------------------- 1 file changed, 124 deletions(-) diff --git a/net/mpd5/files/patch-l2tp-multihomed b/net/mpd5/files/patch-l2tp-multihomed deleted file mode 100644 index 477c817b9f29..000000000000 --- a/net/mpd5/files/patch-l2tp-multihomed +++ /dev/null @@ -1,124 +0,0 @@ -Index: src/l2tp.c -=================================================================== ---- src/l2tp.c (revision 2418) -+++ src/l2tp.c (revision 2420) -@@ -1415,9 +1415,21 @@ L2tpServerEvent(int type, void *arg) - tun->self_port = s->self_port; - tun->alive = 1; - -- Log(LG_PHYS, ("Incoming L2TP packet from %s %d", -- u_addrtoa(&tun->peer_addr, namebuf, sizeof(namebuf)), tun->peer_port)); -+ if (u_addrempty(&tun->self_addr) && -+ !GetSockDstAddress(s->sock, &tun->self_addr)) -+ Log(LG_PHYS, ("Incoming L2TP packet from %s %d", -+ u_addrtoa(&tun->peer_addr, namebuf, sizeof(namebuf)), -+ tun->peer_port)); -+ else { -+ char buf3[INET_ADDRSTRLEN]; - -+ Log(LG_PHYS, ("Incoming L2TP packet from %s %d to %s %d", -+ u_addrtoa(&tun->peer_addr, namebuf, sizeof(namebuf)), -+ tun->peer_port, -+ u_addrtoa(&tun->self_addr, buf3, sizeof(buf3)), -+ tun->self_port)); -+ } -+ - /* Examine all L2TP links to get best possible fit tunnel parameters. */ - for (k = 0; k < gNumLinks; k++) { - Link l2; -@@ -1552,7 +1564,7 @@ L2tpServerEvent(int type, void *arg) - } - - /* Bind socket to a new port */ -- u_addrtosockaddr(&s->self_addr,s->self_port,&sas); -+ u_addrtosockaddr(&tun->self_addr,tun->self_port,&sas); - if (NgSendMsg(csock, namebuf, NGM_KSOCKET_COOKIE, - NGM_KSOCKET_BIND, &sas, sas.ss_len) == -1) { - Perror("L2TP: bind"); -@@ -1649,6 +1661,10 @@ L2tpListen(Link l) - SO_REUSEPORT, &one, sizeof(one)) == -1) { - Perror("L2TP: setsockopt"); - goto fail; -+ } -+ if (u_addrempty(&s->self_addr)) { -+ int on = 1; -+ setsockopt(s->sock, IPPROTO_IP, IP_RECVDSTADDR, &on, sizeof(on)); - } - u_addrtosockaddr(&s->self_addr, s->self_port, &sa); - if (bind(s->sock, (struct sockaddr *)&sa, sa.ss_len) == -1) { -Index: src/util.c -=================================================================== ---- src/util.c (revision 2418) -+++ src/util.c (revision 2420) -@@ -16,8 +16,9 @@ - #include - #include - #include --#include -+#include - #include -+#include - #include - #include - #include -@@ -1544,5 +1545,48 @@ IfaceSetFlag(const char *ifname, int value) - return (-1); - } - close(s); -+ return (0); -+} -+ -+/* -+ * Obtain destination address of SOCK_DGRAM IPv4 UDP socket, if possible. -+ */ -+int GetSockDstAddress(int sock, struct u_addr *addr) -+{ -+ struct { -+ struct msghdr msg; -+ struct iovec iov; -+ } b; -+ union { /* ensure correct alignment for space */ -+ struct cmsghdr cm; -+ char space[CMSG_SPACE(sizeof(struct in_addr))]; -+ } buf; -+ -+ char io[1024]; -+ struct cmsghdr *p; -+ ssize_t size; -+ -+ /* Sanity check */ -+ if (addr->family != AF_INET) -+ return (0); -+ -+ memset(&b, 0, sizeof(b)); -+ b.msg.msg_iov = &b.iov; -+ b.msg.msg_iovlen = 1; -+ b.msg.msg_control = &buf; -+ b.msg.msg_controllen = sizeof(buf); -+ b.iov.iov_base = &io; -+ b.iov.iov_len = sizeof(io); -+ -+ if ((size = recvmsg(sock, &b.msg, 0)) < 0) { -+ Perror("%s: recvmsg: %s", __FUNCTION__, strerror(errno)); -+ return (0); -+ } -+ -+ p = CMSG_FIRSTHDR(&b.msg); -+ if (p && p->cmsg_level == IPPROTO_IP && p->cmsg_type == IP_RECVDSTADDR) { -+ memcpy(&addr->u.ip4, CMSG_DATA(p), sizeof(addr->u.ip4)); -+ return (1); -+ } - return (0); - } -Index: src/util.h -=================================================================== ---- src/util.h (revision 2418) -+++ src/util.h (revision 2420) -@@ -98,6 +98,7 @@ extern u_long GenerateMagic(void); - extern int GetAnyIpAddress(struct u_addr *ipaddr, const char *ifname); - extern int GetEther(struct u_addr *addr, struct sockaddr_dl *hwaddr); - extern int GetPeerEther(struct u_addr *addr, struct sockaddr_dl *hwaddr); -+extern int GetSockDstAddress(int sock, struct u_addr *addr); - extern void ppp_util_ascify(char *buf, size_t max, const char *bytes, size_t len); - extern int IfaceSetFlag(const char *ifname, int value); -