summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/tun.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-01-28 01:56:34 +0000
committerbrian <brian@FreeBSD.org>1999-01-28 01:56:34 +0000
commitc970e06ccf646c8d420b2216f605eefeef3cdc0d (patch)
treebb4ef8e30fe918a76dda062613ff6dce7f4acf28 /usr.sbin/ppp/tun.c
parentbada4b37ff3f7d5effb75895357b4276798f82de (diff)
downloadFreeBSD-src-c970e06ccf646c8d420b2216f605eefeef3cdc0d.zip
FreeBSD-src-c970e06ccf646c8d420b2216f605eefeef3cdc0d.tar.gz
Initial RADIUS support (using libradius). See the man page for
details. Compiling with -DNORADIUS (the default for `release') removes support. TODO: The functionality in libradius::rad_send_request() needs to be supplied as a set of routines so that ppp doesn't have to wait indefinitely for the radius server(s). Instead, we need to get a descriptor back, select() on the descriptor, and ask libradius to service it when necessary. For now, ppp blocks SIGALRM while in rad_send_request(), so it misses PAP/CHAP retries & timeouts if they occur. Only PAP is functional. When CHAP is attempted, libradius complains that no User-Password has been specified... rfc2138 says that it *mustn't* be used for CHAP :-( Sponsored by: Internet Business Solutions Ltd., Switzerland
Diffstat (limited to 'usr.sbin/ppp/tun.c')
-rw-r--r--usr.sbin/ppp/tun.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/usr.sbin/ppp/tun.c b/usr.sbin/ppp/tun.c
index 6d97e38..d8edbd8 100644
--- a/usr.sbin/ppp/tun.c
+++ b/usr.sbin/ppp/tun.c
@@ -23,10 +23,10 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: tun.c,v 1.9 1998/08/09 16:41:01 brian Exp $
+ * $Id: tun.c,v 1.10 1998/10/22 02:32:50 brian Exp $
*/
-#include <sys/types.h>
+#include <sys/param.h>
#include <sys/socket.h> /* For IFF_ defines */
#include <net/if.h> /* For IFF_ defines */
#include <netinet/in.h>
@@ -57,6 +57,9 @@
#include "ccp.h"
#include "link.h"
#include "mp.h"
+#ifndef NORADIUS
+#include "radius.h"
+#endif
#include "bundle.h"
#include "tun.h"
@@ -67,7 +70,15 @@ tun_configure(struct bundle *bundle, int mtu)
memset(&info, '\0', sizeof info);
info.type = IFT_PPP;
- info.mtu = mtu;
+#ifndef NORADIUS
+ if (bundle->radius.valid && bundle->radius.mtu && bundle->radius.mtu < mtu) {
+ log_Printf(LogLCP, "Reducing MTU to radius value %lu\n",
+ bundle->radius.mtu);
+ info.mtu = bundle->radius.mtu;
+ } else
+#endif
+ info.mtu = mtu;
+
info.baudrate = bundle->ifSpeed;
#ifdef __OpenBSD__
info.flags = IFF_UP|IFF_POINTOPOINT;
OpenPOWER on IntegriCloud