-* Wed Sep 14 2005 Brendan O'Dea <bod@optus.net> 2.1.6
+* Thu Sep 15 2005 Brendan O'Dea <bod@optus.net> 2.1.6
- Any traffic on a tunnel resets lastrec, not just control messages.
- Use a unique identifier for LCP.
- Fix Code-Reject/Protocol-Reject.
+- Make MRU configurable, NAK config requests for larger values.
* Sat Sep 3 2005 Brendan O'Dea <bod@optus.net> 2.1.5
- Avoid Code-Reject loop.
<a href="ftp://ftp.rfc-editor.org/in-notes/rfc1661.txt">RFC1661</a>.
</LI>
+<LI><B>ppp_mru</B> (int)<BR>
+PPP link MRU (default: 1452).
+</LI>
+
<LI><B>primary_dns</B> (ip address)
<LI><B>secondary_dns</B> (ip address)<BR>
Whenever a PPP connection is established, DNS servers will be sent to the
.de Id
.ds Dt \\$4 \\$5
..
-.Id $Id: startup-config.5,v 1.13 2005/09/02 23:59:56 bodea Exp $
+.Id $Id: startup-config.5,v 1.14 2005/09/15 09:34:49 bodea Exp $
.TH STARTUP-CONFIG 5 "\*(Dt" L2TPNS "File Formats and Conventions"
.SH NAME
startup\-config \- configuration file for l2tpns
Number of Configure-Nak requests to send before sending a
Configure-Reject (default: 5).
.TP
+.B ppp_mru
+PPP link MRU (default: 1452).
+.TP
.BR primary_dns , " secondary_dns"
Whenever a PPP connection is established, DNS servers will be sent to the
user, both a primary and a secondary. If either is set to 0.0.0.0, then that
#set ppp_max_configure 10
#set ppp_max_failure 5
+# Link MRU
+#set ppp_mru 1452
+
# Only 2 DNS server entries are allowed
set primary_dns 10.0.0.1
set secondary_dns 10.0.0.2
// Copyright (c) 2002 FireBrick (Andrews & Arnold Ltd / Watchfront Ltd) - GPL licenced
// vim: sw=8 ts=8
-char const *cvs_id_l2tpns = "$Id: l2tpns.c,v 1.131 2005/09/13 14:27:14 bodea Exp $";
+char const *cvs_id_l2tpns = "$Id: l2tpns.c,v 1.132 2005/09/15 09:34:48 bodea Exp $";
#include <arpa/inet.h>
#include <assert.h>
CONFIG("ppp_restart_time", ppp_restart_time, INT),
CONFIG("ppp_max_configure", ppp_max_configure, INT),
CONFIG("ppp_max_failure", ppp_max_failure, INT),
+ CONFIG("ppp_mru", ppp_mru, INT),
CONFIG("primary_dns", default_dns1, IPv4),
CONFIG("secondary_dns", default_dns2, IPv4),
CONFIG("primary_radius", radiusserver[0], IPv4),
if (amagic == 0) amagic = time_now;
session[s].magic = amagic; // set magic number
session[s].l2tp_flags = aflags; // set flags received
- session[s].mru = DEFAULT_MRU;
+ session[s].mru = config->ppp_mru;
controlnull(t); // ack
// start LCP
config->ppp_restart_time = 3;
config->ppp_max_configure = 10;
config->ppp_max_failure = 5;
+ config->ppp_mru = DEFAULT_MRU;
strcpy(config->random_device, RANDOMDEVICE);
log_stream = stderr;
setbuf(log_stream, NULL);
}
+ if (config->ppp_mru < 0) config->ppp_mru = 0;
+
// Update radius
config->numradiusservers = 0;
for (i = 0; i < MAXRADSERVER; i++)
// L2TPNS Global Stuff
-// $Id: l2tpns.h,v 1.89 2005/09/13 14:23:07 bodea Exp $
+// $Id: l2tpns.h,v 1.90 2005/09/15 09:34:49 bodea Exp $
#ifndef __L2TPNS_H__
#define __L2TPNS_H__
#include <sys/types.h>
#include <libcli.h>
-#define VERSION "2.1.6"
+#define VERSION "2.1.7"
// Limits
#define MAXTUNNEL 500 // could be up to 65535
int ppp_restart_time; // timeout for PPP restart
int ppp_max_configure; // max lcp configure requests to send
int ppp_max_failure; // max lcp configure naks to send
+ int ppp_mru; // MRU to advertise
char radiussecret[64];
int radius_accounting;
%attr(644,root,root) /usr/share/man/man[58]/*
%changelog
-* Wed Sep 14 2005 Brendan O'Dea <bod@optus.net> 2.1.6-1
+* Thu Sep 15 2005 Brendan O'Dea <bod@optus.net> 2.1.6-1
- 2.1.6 release, see /usr/share/doc/l2tpns-2.1.6/Changes
// L2TPNS PPP Stuff
-char const *cvs_id_ppp = "$Id: ppp.c,v 1.80 2005/09/13 14:23:07 bodea Exp $";
+char const *cvs_id_ppp = "$Id: ppp.c,v 1.81 2005/09/15 09:34:49 bodea Exp $";
#include <stdio.h>
#include <string.h>
switch (type)
{
case 1: // Maximum-Receive-Unit
- session[s].mru = ntohs(*(uint16_t *)(o + 2));
+ {
+ uint16_t mru = ntohs(*(uint16_t *)(o + 2));
+ if (!config->ppp_mru || mru <= config->ppp_mru)
+ {
+ session[s].mru = mru;
+ break;
+ }
+
+ LOG(3, s, t, " Remote requesting MRU of %u. Rejecting.\n", mru);
+ mru = htons(config->ppp_mru);
+ q = ppp_conf_nak(s, b, sizeof(b), PPPLCP, &response, q, p, o, (uint8_t *) &mru, sizeof(mru));
+ }
break;
case 2: // Async-Control-Character-Map
case 1: // Maximum-Receive-Unit
if (*p == ConfigNak)
{
- session[s].mru = ntohs(*(uint16_t *)(o + 2));
- LOG(3, s, t, " Remote requested MRU of %u\n", session[s].mru);
+ session[s].mru = 0;
+ LOG(3, s, t, " Remote requested MRU of %u; removing option\n",
+ ntohs(*(uint16_t *)(o + 2)));
}
else
{