Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Sep 2021 22:19:15 GMT
From:      Eugene Grosbein <eugen@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org
Subject:   git: 9cf7566d021e - 2021Q3 - net/mpd5: add L2TP fix from upstream (r2410, r2411).
Message-ID:  <202109082219.188MJFAY029705@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch 2021Q3 has been updated by eugen:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9cf7566d021e448d1bc06b3ab5461277f4fe9a95

commit 9cf7566d021e448d1bc06b3ab5461277f4fe9a95
Author:     Eugene Grosbein <eugen@FreeBSD.org>
AuthorDate: 2021-08-18 12:50:26 +0000
Commit:     Eugene Grosbein <eugen@FreeBSD.org>
CommitDate: 2021-09-08 22:17:01 +0000

    net/mpd5: add L2TP fix from upstream (r2410, r2411).
    
    This change should fix the problem reported in bugs #38 #47 #74.
    It is L2TP interoperability issue with some Juniper, Cisco and
    YAMAHA RTX routers having strict protocol checks.
    
    Move USES to pet portlint.
    
    Reported by: Kikuchan at SourceForge (based on)
    
    (cherry picked from commit fe1375b13d3a9fab5f818fe0502db86e76107405)
---
 net/mpd5/Makefile                     |  5 ++-
 net/mpd5/files/patch-l2tp-ctrl-c.diff | 71 +++++++++++++++++++++++++++++++++++
 2 files changed, 74 insertions(+), 2 deletions(-)

diff --git a/net/mpd5/Makefile b/net/mpd5/Makefile
index 25f30d3f3cf0..1955acfe1817 100644
--- a/net/mpd5/Makefile
+++ b/net/mpd5/Makefile
@@ -2,6 +2,7 @@
 
 PORTNAME=	mpd
 DISTVERSION=	5.9
+PORTREVISION=	1
 CATEGORIES=	net
 MASTER_SITES=	SF/${PORTNAME}/Mpd5/Mpd-${PORTVERSION}
 PKGNAMESUFFIX=	5
@@ -12,14 +13,14 @@ COMMENT=	Multi-link PPP daemon based on netgraph(4)
 
 LICENSE=	BSD3CLAUSE
 
+USES=		ssl
+
 OPTIONS_DEFINE=	DOCS NG_IPACCT
 NG_IPACCT_DESC=	Use ng_ipacct kernel module from port
 
 HAS_CONFIGURE=	YES
 CONFIGURE_WRKSRC=	"${WRKSRC}/src"
 
-USES=		ssl
-
 .include <bsd.port.options.mk>
 
 MAKE_ARGS+=	OSVERSION=${OSVERSION}
diff --git a/net/mpd5/files/patch-l2tp-ctrl-c.diff b/net/mpd5/files/patch-l2tp-ctrl-c.diff
new file mode 100644
index 000000000000..3d7668732aae
--- /dev/null
+++ b/net/mpd5/files/patch-l2tp-ctrl-c.diff
@@ -0,0 +1,71 @@
+Index: src/l2tp_ctrl.c
+===================================================================
+--- src/l2tp_ctrl.c	(revision 2409)
++++ src/l2tp_ctrl.c	(revision 2411)
+@@ -244,7 +244,8 @@ Notes
+ ************************************************************************/
+ 
+ static int	ppp_l2tp_ctrl_setup_1(struct ppp_l2tp_ctrl *ctrl,
+-			struct ppp_l2tp_avp_ptrs *ptrs);
++			struct ppp_l2tp_avp_ptrs *ptrs,
++			struct ppp_l2tp_avp_list *avps);
+ static int	ppp_l2tp_ctrl_setup_2(struct ppp_l2tp_ctrl *ctrl,
+ 			struct ppp_l2tp_avp_ptrs *ptrs);
+ static void	ppp_l2tp_ctrl_send(struct ppp_l2tp_ctrl *ctrl,
+@@ -1031,7 +1032,8 @@ ppp_l2tp_sess_hooked(struct ppp_l2tp_sess *sess) {
+  */
+ static int
+ ppp_l2tp_ctrl_setup_1(struct ppp_l2tp_ctrl *ctrl,
+-	struct ppp_l2tp_avp_ptrs *ptrs)
++	struct ppp_l2tp_avp_ptrs *ptrs,
++	struct ppp_l2tp_avp_list *avps)
+ {
+ 	/* Log */
+ 	Log(LOG_INFO, ("L2TP: connected to \"%s\", version=%u.%u",
+@@ -1092,7 +1094,7 @@ ppp_l2tp_ctrl_setup_1(struct ppp_l2tp_ctrl *ctrl,
+ 		MD5_Update(&md5ctx, &ptrs->challenge->value, ptrs->challenge->length);
+ 		MD5_Final(hash, &md5ctx);
+ 
+-		if (ppp_l2tp_avp_list_append(ctrl->avps, 0,
++		if (ppp_l2tp_avp_list_append(avps, 0,
+ 		    0, AVP_CHALLENGE_RESPONSE, hash, sizeof(hash)) == -1)
+ 		return (0);
+ 	}
+@@ -2085,7 +2087,7 @@ ppp_l2tp_handle_SCCRQ(struct ppp_l2tp_ctrl *ctrl,
+ 
+ ok:
+ 	/* Do control connection setup */
+-	if (ppp_l2tp_ctrl_setup_1(ctrl, ptrs) == -1)
++	if (ppp_l2tp_ctrl_setup_1(ctrl, ptrs, ctrl->avps) == -1)
+ 		return (-1);
+ 
+ 	/* Send response and update state */
+@@ -2098,18 +2100,24 @@ static int
+ ppp_l2tp_handle_SCCRP(struct ppp_l2tp_ctrl *ctrl,
+ 	const struct ppp_l2tp_avp_list *avps, struct ppp_l2tp_avp_ptrs *ptrs)
+ {
++	struct ppp_l2tp_avp_list *avps0;
++
+ 	(void)avps;
++	avps0 = ppp_l2tp_avp_list_create();
++
+ 	/* Do control connection setup */
+-	if (ppp_l2tp_ctrl_setup_1(ctrl, ptrs) == -1)
++	if ((ppp_l2tp_ctrl_setup_1(ctrl, ptrs, avps0) == -1) ||
++	    (ppp_l2tp_ctrl_setup_2(ctrl, ptrs) == -1)) {
++		ppp_l2tp_avp_list_destroy(&avps0);
+ 		return (-1);
+-	if (ppp_l2tp_ctrl_setup_2(ctrl, ptrs) == -1)
+-		return (-1);
++	}
+ 
+ 	/* Send response and update state */
+ 	ctrl->state = CS_ESTABLISHED;
+-	ppp_l2tp_ctrl_send(ctrl, 0, SCCCN, ctrl->avps);
++	ppp_l2tp_ctrl_send(ctrl, 0, SCCCN, avps0);
+ 	if (*ctrl->cb->ctrl_connected != NULL)
+ 	    (*ctrl->cb->ctrl_connected)(ctrl);
++	ppp_l2tp_avp_list_destroy(&avps0);
+ 	return (0);
+ }
+ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109082219.188MJFAY029705>