View | Details | Raw Unified | Return to bug 231622 | Differences between
and this patch

Collapse All | Expand All

(-)net/mpd5/Makefile (-14 / +11 lines)
Lines 14-34 Link Here
14
14
15
LICENSE=	BSD3CLAUSE
15
LICENSE=	BSD3CLAUSE
16
16
17
BROKEN_SSL=	openssl-devel openssl111
17
USES=		ssl
18
BROKEN_SSL_REASON_openss-devel=	needs libfetch(3) linked with system libssl
19
BROKEN_SSL_REASON_openssl111=	needs libfetch(3) linked with system libssl
20
18
21
OPTIONS_DEFINE=	DOCS NG_IPACCT
19
USE_RC_SUBR=	mpd5
22
NG_IPACCT_DESC=	Use ng_ipacct kernel module from port
23
24
HAS_CONFIGURE=	YES
20
HAS_CONFIGURE=	YES
25
CONFIGURE_WRKSRC=	"${WRKSRC}/src"
21
CONFIGURE_WRKSRC=	"${WRKSRC}/src"
22
MAKE_ARGS+=	OSVERSION=${OSVERSION}
26
23
27
USES=		ssl
24
LDFLAGS=	-L${LOCALBASE}/lib
28
25
26
CONFSUF=	conf secret script
27
DOCSDIR=	${PREFIX}/share/doc/mpd5
28
PORTDOCS=	README mpd*
29
PLIST_FILES=	${CONFSUF:S/^/etc\/mpd5\/mpd./:S/$/.sample/} sbin/mpd5
30
29
.include <bsd.port.options.mk>
31
.include <bsd.port.options.mk>
30
32
31
MAKE_ARGS+=	OSVERSION=${OSVERSION}
33
OPTIONS_DEFINE=	DOCS NG_IPACCT
34
NG_IPACCT_DESC=	Use ng_ipacct kernel module from port
32
35
33
.if ${PORT_OPTIONS:MNG_IPACCT}
36
.if ${PORT_OPTIONS:MNG_IPACCT}
34
BUILD_DEPENDS+=	${LOCALBASE}/include/netgraph/ng_ipacct.h:net-mgmt/ng_ipacct
37
BUILD_DEPENDS+=	${LOCALBASE}/include/netgraph/ng_ipacct.h:net-mgmt/ng_ipacct
Lines 39-50 Link Here
39
.endif
42
.endif
40
.endif
43
.endif
41
44
42
USE_RC_SUBR=	mpd5
43
CONFSUF=	conf secret script
44
DOCSDIR=	${PREFIX}/share/doc/mpd5
45
PORTDOCS=	README mpd*
46
PLIST_FILES=	${CONFSUF:S/^/etc\/mpd5\/mpd./:S/$/.sample/} sbin/mpd5
47
48
.if !defined(WITHOUT_MAN)
45
.if !defined(WITHOUT_MAN)
49
PLIST_FILES+=	man/man8/mpd5.8.gz
46
PLIST_FILES+=	man/man8/mpd5.8.gz
50
.endif
47
.endif
(-)net/mpd5/files/patch-console.c (-17 / +17 lines)
Lines 1-15 Link Here
1
--- src/console.h.orig	2016-01-06 22:42:06.000000000 +0700
1
--- src/console.c.orig	2016-01-06 15:42:06 UTC
2
+++ src/console.h	2017-06-16 21:12:59.268715000 +0700
2
+++ src/console.c
3
@@ -119,6 +119,7 @@
4
   extern int	ConsoleStat(Context ctx, int ac, char *av[], void *arg);
5
   extern Context	StdConsoleConnect(Console c);
6
   extern void	ConsoleShutdown(Console c);
7
+  extern void	ConsoleCancelCleanup(void *rwlock);
8
 
9
   extern int	UserCommand(Context ctx, int ac, char *av[], void *arg);
10
   extern int	UserStat(Context ctx, int ac, char *av[], void *arg);
11
--- src/console.c.orig	2016-01-06 22:42:06.000000000 +0700
12
+++ src/console.c	2017-06-16 21:54:48.919442000 +0700
13
@@ -175,6 +175,14 @@ ConsoleClose(Console c)
3
@@ -175,6 +175,14 @@ ConsoleClose(Console c)
14
   return 0;
4
   return 0;
15
 }
5
 }
Lines 25-31 Link Here
25
 /*
15
 /*
26
  * ConsoleStat()
16
  * ConsoleStat()
27
  */
17
  */
28
@@ -192,13 +200,14 @@ ConsoleStat(Context ctx, int ac, char *a
18
@@ -192,13 +200,14 @@ ConsoleStat(Context ctx, int ac, char *av[], void *arg
29
   Printf("\tIP-Address    : %s\r\n", u_addrtoa(&c->addr,addrstr,sizeof(addrstr)));
19
   Printf("\tIP-Address    : %s\r\n", u_addrtoa(&c->addr,addrstr,sizeof(addrstr)));
30
   Printf("\tPort          : %d\r\n", c->port);
20
   Printf("\tPort          : %d\r\n", c->port);
31
 
21
 
Lines 41-47 Link Here
41
 
31
 
42
   Printf("Global options:\r\n");
32
   Printf("Global options:\r\n");
43
   OptStat(ctx, &c->options, gConfList);
33
   OptStat(ctx, &c->options, gConfList);
44
@@ -905,13 +914,14 @@ UserStat(Context ctx, int ac, char *av[]
34
@@ -905,13 +914,14 @@ UserStat(Context ctx, int ac, char *av[], void *arg)
45
     ConsoleUser		u;
35
     ConsoleUser		u;
46
 
36
 
47
     Printf("Configured users:\r\n");
37
     Printf("Configured users:\r\n");
Lines 57-65 Link Here
57
 
47
 
58
     return 0;
48
     return 0;
59
 }
49
 }
60
--- src/log.c.orig	2016-01-06 22:42:06.000000000 +0700
50
--- src/console.h.orig	2016-01-06 15:42:06 UTC
61
+++ src/log.c	2017-06-16 21:16:19.643625000 +0700
51
+++ src/console.h
62
@@ -256,12 +256,13 @@ vLogPrintf(const char *fmt, va_list args
52
@@ -119,6 +119,7 @@
53
   extern int	ConsoleStat(Context ctx, int ac, char *av[], void *arg);
54
   extern Context	StdConsoleConnect(Console c);
55
   extern void	ConsoleShutdown(Console c);
56
+  extern void	ConsoleCancelCleanup(void *rwlock);
57
 
58
   extern int	UserCommand(Context ctx, int ac, char *av[], void *arg);
59
   extern int	UserStat(Context ctx, int ac, char *av[], void *arg);
60
--- src/log.c.orig	2016-01-06 15:42:06 UTC
61
+++ src/log.c
62
@@ -256,12 +256,13 @@ vLogPrintf(const char *fmt, va_list args)
63
 #ifdef SYSLOG_FACILITY
63
 #ifdef SYSLOG_FACILITY
64
         syslog(LOG_INFO, "%s", buf);
64
         syslog(LOG_INFO, "%s", buf);
65
 #endif
65
 #endif
(-)net/mpd5/files/patch-fixbuffer (-125 / +93 lines)
Lines 1-125 Link Here
1
Index: src/iface.c
1
--- src/iface.c.orig	2016-01-06 15:42:06 UTC
2
===================================================================
2
+++ src/iface.c
3
RCS file: /cvsroot/mpd/mpd/src/iface.c,v
3
@@ -161,7 +161,7 @@
4
retrieving revision 1.228
4
 	IfaceSetCommand, NULL, 2, (void *) SET_ADDRS },
5
retrieving revision 1.230
5
     { "route {dest}[/{width}]",		"Add IP route",
6
diff -u -p -r1.228 -r1.230
6
 	IfaceSetCommand, NULL, 2, (void *) SET_ROUTE },
7
--- src/iface.c	17 May 2017 08:47:53 -0000	1.228
7
-    { "mtu {size}",			"Set max allowed interface MTU",
8
+++ src/iface.c	1 Jul 2017 21:32:07 -0000	1.230
8
+    { "mtu {size} [override]",		"Set max allowed or override interface MTU",
9
@@ -141,6 +141,7 @@
9
 	IfaceSetCommand, NULL, 2, (void *) SET_MTU },
10
   static int	IfaceAllocACL (struct acl_pool ***ap, int start, char * ifname, int number);
10
     { "name [{name}]",			"Set interface name",
11
   static int	IfaceFindACL (struct acl_pool *ap, char * ifname, int number);
11
 	IfaceSetCommand, NULL, 2, (void *) SET_NAME },
12
   static char *	IfaceParseACL (char * src, IfaceState iface);
12
@@ -288,6 +288,7 @@ IfaceInit(Bund b)
13
+  static char *	IfaceFixAclForDelete(char *r, char *buf, size_t len);
13
   /* Default configuration */
14
   iface->mtu = NG_IFACE_MTU_DEFAULT;
15
   iface->max_mtu = NG_IFACE_MTU_DEFAULT;
16
+  iface->mtu_override = 0;
17
 #ifdef SIOCSIFDESCR
18
   iface->ifdescr = NULL;
19
   iface->conf.ifdescr = NULL;
20
@@ -1549,15 +1550,30 @@ IfaceSetCommand(Context ctx, int ac, char *av[], void 
21
     case SET_MTU:
22
       {
23
 	int	max_mtu;
24
+	int	override;
25
 
26
 	/* Check */
27
-	if (ac != 1)
28
+	if (ac < 1 || ac > 2)
29
 	  return(-1);
30
 
31
 	max_mtu = atoi(av[0]);
32
+	override = 0;
33
+
34
+	if (ac == 2 && av[1][0]) {
35
+	  if (strcmp(av[1], "override") == 0)
36
+	    override = 1;
37
+	  else
38
+	    Error("Invalid keyword %s", av[1]);
39
+	}
40
+	
41
 	if (max_mtu < IFACE_MIN_MTU || max_mtu > IFACE_MAX_MTU)
42
-	  Error("Invalid interface mtu %d", max_mtu);
43
-	iface->max_mtu = max_mtu;
44
+	  if (!override || max_mtu != 0)
45
+	    Error("Invalid interface mtu %d", max_mtu);
46
+
47
+	if (max_mtu != 0)
48
+	  iface->max_mtu = max_mtu;
49
+	if (override)
50
+	  iface->mtu_override = max_mtu;
51
       }
52
       break;
53
 
54
@@ -1686,6 +1702,7 @@ IfaceStat(Context ctx, int ac, char *av[], void *arg)
55
     Printf("\tGroup           : %s\r\n", iface->conf.ifgroup);
14
 #endif
56
 #endif
57
     Printf("\tMaximum MTU     : %d bytes\r\n", iface->max_mtu);
58
+    Printf("\tMTU override    : %d bytes\r\n", iface->mtu_override);
59
     Printf("\tIdle timeout    : %d seconds\r\n", iface->idle_timeout);
60
     Printf("\tSession timeout : %d seconds\r\n", iface->session_timeout);
61
     if (!u_rangeempty(&iface->conf.self_addr)) {
62
@@ -1816,14 +1833,18 @@ IfaceSetMTU(Bund b, int mtu)
63
 	return;
64
     }
15
 
65
 
16
   static int	IfaceSetName(Bund b, const char * ifname);
66
-    if ((b->params.mtu > 0) && (mtu > b->params.mtu)) {
17
@@ -602,18 +603,18 @@ IfaceUp(Bund b, int ready)
67
+    if (!iface->mtu_override && (b->params.mtu > 0) && (mtu > b->params.mtu)) {
18
   while (acls != NULL) {
68
 	mtu = b->params.mtu;
19
     /* allow both %aX and `peer_addr` macros */
69
 	Log(LG_IFACE2, ("[%s] IFACE: forcing MTU of auth backend: %d bytes",
20
     buf = IfaceParseACL(acls->rule, iface);
70
 	    b->name, mtu));
21
-    strcpy(acls->rule, buf);
22
+    acl = Mdup2(MB_IPFW, acls, sizeof(struct acl), sizeof(struct acl) + strlen(buf));
23
+    strcpy(acl->rule, buf);
24
     Freee(buf);
25
-    acl = Mdup(MB_IPFW, acls, sizeof(struct acl) + strlen(acls->rule));
26
     acl->next = iface->tables;
27
     iface->tables = acl;
28
-    if (strncmp(acls->rule, "peer_addr", 9) == 0) {
29
+    if (strncmp(acl->rule, "peer_addr", 9) == 0) {
30
 	char hisaddr[20];
31
 	ExecCmd(LG_IFACE2, b->name, "%s table %d add %s",
32
-	    PATH_IPFW, acls->real_number,
33
+	    PATH_IPFW, acl->real_number,
34
 	    u_addrtoa(&iface->peer_addr, hisaddr, sizeof(hisaddr)));
35
     } else {
36
-	ExecCmd(LG_IFACE2, b->name, "%s table %d add %s", PATH_IPFW, acls->real_number, acls->rule);
37
+	ExecCmd(LG_IFACE2, b->name, "%s table %d add %s", PATH_IPFW, acl->real_number, acl->rule);
38
     }
71
     }
39
     acls = acls->next;
72
 
40
   };
73
-    /* Limit MTU to configured maximum */
41
@@ -697,8 +698,10 @@ IfaceDown(Bund b)
74
-    if (mtu > iface->max_mtu)
42
         PATH_IPFW, acl->real_number,
75
+    /* Limit MTU to configured maximum/override */
43
         u_addrtoa(&iface->peer_addr, hisaddr, sizeof(hisaddr)));
76
+    if (iface->mtu_override) {
44
     } else {
77
+	mtu = iface->mtu_override;
45
+      char buf[ACL_LEN];
78
+	Log(LG_IFACE2, ("[%s] IFACE: forcing MTU override: %d bytes",
46
       ExecCmd(LG_IFACE2, b->name, "%s table %d delete %s",
79
+	    b->name, mtu));
47
-        PATH_IPFW, acl->real_number, acl->rule);
80
+    } else if (mtu > iface->max_mtu)
48
+        PATH_IPFW, acl->real_number,
81
         mtu = iface->max_mtu;
49
+        IfaceFixAclForDelete(acl->rule, buf, sizeof(buf)));
82
 
50
     }
83
     /* Set MTU on interface */
51
     aclnext = acl->next;
84
@@ -3003,6 +3024,9 @@ IfaceSetupMSS(Bund b, uint16_t maxMSS)
52
     Freee(acl);
85
   /* Send configure message. */
53
@@ -946,6 +949,60 @@ IfaceParseACL (char * src, IfaceState if
86
   memset(&tcpmsscfg, 0, sizeof(tcpmsscfg));
54
     Freee(buf1);
87
   tcpmsscfg.maxMSS = maxMSS;
55
     return(buf);
56
 }
57
+
88
+
58
+/*
89
+  Log(LG_IFACE2, ("[%s] IFACE: Configuring ng_tcpmss %s %u",
59
+ * IfaceFixAclForDelete()
90
+      b->name, path, (unsigned)tcpmsscfg.maxMSS));
60
+ *
61
+ * Removes values from ipfw 'table-key value [...]' expression r, if any.
62
+ * Returns buf pointer for modified expression or original r pointer
63
+ * if no modifications were performed when no values were found or
64
+ * buf found too short.
65
+ *
66
+ * len is size of buf. Strings are zero-terminated.
67
+ * r and buf must point to non-overlapping memory areas.
68
+ */
69
+
70
+static char*
71
+IfaceFixAclForDelete(char *r, char *buf, size_t len)
72
+{
73
+  static const char sep[] = " \t";
74
+  char *limit, *s;
75
+  int  i, state = 0; 
76
+
77
+/*
78
+ * Possible state values:
79
+ *
80
+ * -1: skip value (otherwise copy);
81
+ *  0: first iteration, do copy;
82
+ *  1: not first iteration, do copy.
83
+*/
84
+
85
+  s = buf;
86
+  limit = buf + len;
87
+
88
+  for (r += strspn(r, sep);		/* Skip leading spaces. 	    */
89
+       *r;				/* Check for end of string. 	    */
90
+       r += i, r += strspn(r, sep))	/* Advance and skip spaces again.   */
91
+  {
92
+    i = strcspn(r, sep);		/* Find separator or end of string. */
93
+    if (state == 0 && r[i] == '\0')	/* No separators in the rule?	    */
94
+      return r;
95
+    if (state < 0) {			/* Skip value.			    */
96
+      state = 1;
97
+      continue;
98
+    }
99
+    if (limit - s < i + 1 + state)	/* Check space.			    */
100
+      return r;
101
+    if (state != 0)			/* Insert separator.		    */
102
+      *s++ = ' ';
103
+    memcpy(s, r, i);			/* Copy IP address from the rule.   */
104
+    s += i;
105
+    state = -1;
106
+  }
107
+  *s = '\0';
108
+
109
+  return buf;
110
+}
111
 #endif /* USE_IPFW */
112
 
91
 
113
 /*
92
   snprintf(tcpmsscfg.inHook, sizeof(tcpmsscfg.inHook), "in");
114
Index: src/mbuf.c
93
   snprintf(tcpmsscfg.outHook, sizeof(tcpmsscfg.outHook), "out");
115
===================================================================
94
--- src/mbuf.c.orig	2016-01-06 15:42:06 UTC
116
RCS file: /cvsroot/mpd/mpd/src/mbuf.c,v
95
+++ src/mbuf.c
117
retrieving revision 1.30
96
@@ -55,6 +55,20 @@ Mdup(const char *type, const void *src, size_t size)
118
retrieving revision 1.31
119
diff -u -p -r1.30 -r1.31
120
--- src/mbuf.c	14 Jun 2011 10:40:19 -0000	1.30
121
+++ src/mbuf.c	29 Jun 2017 08:21:35 -0000	1.31
122
@@ -55,6 +55,20 @@ Mdup(const char *type, const void *src, 
123
 }
97
 }
124
 
98
 
125
 void *
99
 void *
Lines 140-153 Link Here
140
 Mstrdup(const char *type, const void *src)
114
 Mstrdup(const char *type, const void *src)
141
 {
115
 {
142
     return (Mdup(type, src, strlen(src) + 1));
116
     return (Mdup(type, src, strlen(src) + 1));
143
Index: src/mbuf.h
117
--- src/mbuf.h.orig	2016-01-06 15:42:06 UTC
144
===================================================================
118
+++ src/mbuf.h
145
RCS file: /cvsroot/mpd/mpd/src/mbuf.h,v
146
retrieving revision 1.25
147
retrieving revision 1.26
148
diff -u -p -r1.25 -r1.26
149
--- src/mbuf.h	7 Oct 2013 11:52:35 -0000	1.25
150
+++ src/mbuf.h	29 Jun 2017 08:21:35 -0000	1.26
151
@@ -73,6 +73,7 @@
119
@@ -73,6 +73,7 @@
152
 
120
 
153
   extern void	*Malloc(const char *type, size_t size) __malloc_like;
121
   extern void	*Malloc(const char *type, size_t size) __malloc_like;
(-)net/mpd5/files/patch-fixstats (-6 / +4 lines)
Lines 1-7 Link Here
1
Index: src/bund.c
1
Index: src/bund.c
2
===================================================================
2
===================================================================
3
--- src/bund.c	(revision 2246)
3
--- src/bund.c.orig	2016-01-06 15:42:06 UTC
4
+++ src/bund.c	(revision 2247)
4
+++ src/bund.c
5
@@ -1394,9 +1394,9 @@ BundUpdateStats(Bund b)
5
@@ -1394,9 +1394,9 @@ BundUpdateStats(Bund b)
6
     b->stats.runts	  += abs(stats.runts - b->oldStats.runts);
6
     b->stats.runts	  += abs(stats.runts - b->oldStats.runts);
7
     b->stats.dupFragments += abs(stats.dupFragments - b->oldStats.dupFragments);
7
     b->stats.dupFragments += abs(stats.dupFragments - b->oldStats.dupFragments);
Lines 13-22 Link Here
13
 #else
13
 #else
14
     NgFuncGetStats64(b, l, &b->stats);
14
     NgFuncGetStats64(b, l, &b->stats);
15
 #endif
15
 #endif
16
Index: src/link.c
16
--- src/link.c.orig	2016-01-06 15:42:06 UTC
17
===================================================================
17
+++ src/link.c
18
--- src/link.c	(revision 2246)
19
+++ src/link.c	(revision 2247)
20
@@ -1359,9 +1359,9 @@ LinkUpdateStats(Link l)
18
@@ -1359,9 +1359,9 @@ LinkUpdateStats(Link l)
21
         l->stats.runts	  += abs(stats.runts - l->oldStats.runts);
19
         l->stats.runts	  += abs(stats.runts - l->oldStats.runts);
22
         l->stats.dupFragments += abs(stats.dupFragments - l->oldStats.dupFragments);
20
         l->stats.dupFragments += abs(stats.dupFragments - l->oldStats.dupFragments);
(-)net/mpd5/files/patch-mtu-override (-97 / +2 lines)
Lines 1-7 Link Here
1
Index: src/iface.h
1
Index: src/iface.h
2
===================================================================
2
===================================================================
3
--- src/iface.h	(revision 2246)
3
--- src/iface.h.orig	2016-01-06 15:42:06 UTC
4
+++ src/iface.h	(working copy)
4
+++ src/iface.h
5
@@ -107,6 +107,7 @@
5
@@ -107,6 +107,7 @@
6
     u_char		traffic[IFACE_IDLE_SPLIT];	/* Mark any traffic */
6
     u_char		traffic[IFACE_IDLE_SPLIT];	/* Mark any traffic */
7
     u_short		mtu;			/* Interface MTU */
7
     u_short		mtu;			/* Interface MTU */
Lines 10-107 Link Here
10
     struct optinfo	options;		/* Configuration options */
10
     struct optinfo	options;		/* Configuration options */
11
     u_int		idle_timeout;		/* Idle timeout */
11
     u_int		idle_timeout;		/* Idle timeout */
12
     u_int		session_timeout;	/* Session timeout */
12
     u_int		session_timeout;	/* Session timeout */
13
Index: src/iface.c
14
===================================================================
15
--- src/iface.c	(revision 2246)
16
+++ src/iface.c	(working copy)
17
@@ -162,7 +162,7 @@
18
 	IfaceSetCommand, NULL, 2, (void *) SET_ADDRS },
19
     { "route {dest}[/{width}]",		"Add IP route",
20
 	IfaceSetCommand, NULL, 2, (void *) SET_ROUTE },
21
-    { "mtu {size}",			"Set max allowed interface MTU",
22
+    { "mtu {size} [override]",		"Set max allowed or override interface MTU",
23
 	IfaceSetCommand, NULL, 2, (void *) SET_MTU },
24
     { "name [{name}]",			"Set interface name",
25
 	IfaceSetCommand, NULL, 2, (void *) SET_NAME },
26
@@ -289,6 +289,7 @@ IfaceInit(Bund b)
27
   /* Default configuration */
28
   iface->mtu = NG_IFACE_MTU_DEFAULT;
29
   iface->max_mtu = NG_IFACE_MTU_DEFAULT;
30
+  iface->mtu_override = 0;
31
 #ifdef SIOCSIFDESCR
32
   iface->ifdescr = NULL;
33
   iface->conf.ifdescr = NULL;
34
@@ -1606,15 +1607,30 @@ IfaceSetCommand(Context ctx, int ac, cha
35
     case SET_MTU:
36
       {
37
 	int	max_mtu;
38
+	int	override;
39
 
40
 	/* Check */
41
-	if (ac != 1)
42
+	if (ac < 1 || ac > 2)
43
 	  return(-1);
44
 
45
 	max_mtu = atoi(av[0]);
46
+	override = 0;
47
+
48
+	if (ac == 2 && av[1][0]) {
49
+	  if (strcmp(av[1], "override") == 0)
50
+	    override = 1;
51
+	  else
52
+	    Error("Invalid keyword %s", av[1]);
53
+	}
54
+	
55
 	if (max_mtu < IFACE_MIN_MTU || max_mtu > IFACE_MAX_MTU)
56
-	  Error("Invalid interface mtu %d", max_mtu);
57
-	iface->max_mtu = max_mtu;
58
+	  if (!override || max_mtu != 0)
59
+	    Error("Invalid interface mtu %d", max_mtu);
60
+
61
+	if (max_mtu != 0)
62
+	  iface->max_mtu = max_mtu;
63
+	if (override)
64
+	  iface->mtu_override = max_mtu;
65
       }
66
       break;
67
 
68
@@ -1743,6 +1759,7 @@ IfaceStat(Context ctx, int ac, char *av[
69
     Printf("\tGroup           : %s\r\n", iface->conf.ifgroup);
70
 #endif
71
     Printf("\tMaximum MTU     : %d bytes\r\n", iface->max_mtu);
72
+    Printf("\tMTU override    : %d bytes\r\n", iface->mtu_override);
73
     Printf("\tIdle timeout    : %d seconds\r\n", iface->idle_timeout);
74
     Printf("\tSession timeout : %d seconds\r\n", iface->session_timeout);
75
     if (!u_rangeempty(&iface->conf.self_addr)) {
76
@@ -1873,14 +1890,18 @@ IfaceSetMTU(Bund b, int mtu)
77
 	return;
78
     }
79
 
80
-    if ((b->params.mtu > 0) && (mtu > b->params.mtu)) {
81
+    if (!iface->mtu_override && (b->params.mtu > 0) && (mtu > b->params.mtu)) {
82
 	mtu = b->params.mtu;
83
 	Log(LG_IFACE2, ("[%s] IFACE: forcing MTU of auth backend: %d bytes",
84
 	    b->name, mtu));
85
     }
86
 
87
-    /* Limit MTU to configured maximum */
88
-    if (mtu > iface->max_mtu)
89
+    /* Limit MTU to configured maximum/override */
90
+    if (iface->mtu_override) {
91
+	mtu = iface->mtu_override;
92
+	Log(LG_IFACE2, ("[%s] IFACE: forcing MTU override: %d bytes",
93
+	    b->name, mtu));
94
+    } else if (mtu > iface->max_mtu)
95
         mtu = iface->max_mtu;
96
 
97
     /* Set MTU on interface */
98
@@ -3061,6 +3082,9 @@ IfaceSetupMSS(Bund b, uint16_t maxMSS)
99
   memset(&tcpmsscfg, 0, sizeof(tcpmsscfg));
100
   tcpmsscfg.maxMSS = maxMSS;
101
 
102
+  Log(LG_IFACE2, ("[%s] IFACE: Configuring ng_tcpmss %s %u",
103
+      b->name, path, (unsigned)tcpmsscfg.maxMSS));
104
+
105
   snprintf(tcpmsscfg.inHook, sizeof(tcpmsscfg.inHook), "in");
106
   snprintf(tcpmsscfg.outHook, sizeof(tcpmsscfg.outHook), "out");
107
   if (NgSendMsg(gLinksCsock, path, NGM_TCPMSS_COOKIE, NGM_TCPMSS_CONFIG,
(-)net/mpd5/files/patch-src_pppoe.c (-3 / +3 lines)
Lines 73-79 Link Here
73
 {
73
 {
74
         union {
74
         union {
75
 		u_char          buf[sizeof(struct ng_mesg) + 2048];
75
 		u_char          buf[sizeof(struct ng_mesg) + 2048];
76
@@ -892,11 +901,6 @@ CreatePppoeNode(struct PppoeIf *PIf, con
76
@@ -892,11 +901,6 @@ CreatePppoeNode(struct PppoeIf *PIf, const char *path,
77
 	uint32_t f;
77
 	uint32_t f;
78
 
78
 
79
 	/* Make sure interface is up. */
79
 	/* Make sure interface is up. */
Lines 94-100 Link Here
94
 		strlcpy(PppoeIfs[free].ifnodepath,
94
 		strlcpy(PppoeIfs[free].ifnodepath,
95
 		    pi->path,
95
 		    pi->path,
96
 		    sizeof(PppoeIfs[free].ifnodepath));
96
 		    sizeof(PppoeIfs[free].ifnodepath));
97
@@ -1673,7 +1677,7 @@ PppoeSetCommand(Context ctx, int ac, cha
97
@@ -1673,7 +1677,7 @@ PppoeSetCommand(Context ctx, int ac, char *av[], void 
98
 {
98
 {
99
 	const PppoeInfo pi = (PppoeInfo) ctx->lnk->info;
99
 	const PppoeInfo pi = (PppoeInfo) ctx->lnk->info;
100
 	const char *hookname = ETHER_DEFAULT_HOOK;
100
 	const char *hookname = ETHER_DEFAULT_HOOK;
Lines 103-109 Link Here
103
 #ifdef NGM_PPPOE_SETMAXP_COOKIE
103
 #ifdef NGM_PPPOE_SETMAXP_COOKIE
104
 	int ap;
104
 	int ap;
105
 #endif
105
 #endif
106
@@ -1684,9 +1688,17 @@ PppoeSetCommand(Context ctx, int ac, cha
106
@@ -1684,9 +1688,17 @@ PppoeSetCommand(Context ctx, int ac, char *av[], void 
107
 			hookname = av[1];
107
 			hookname = av[1];
108
 			/* fall through */
108
 			/* fall through */
109
 		case 1:
109
 		case 1:

Return to bug 231622