Commit Graph

1312 Commits

Author SHA1 Message Date
ume
bdc1f5ae63 When session is over, IPv6 default route to tun should be
removed, too.

MFC after:	1 week
2003-04-05 10:10:33 +00:00
ume
eb6d89b383 Set link-local address of tun interface with prefixlen = 64
instead of 128.  It makes RA happy.

Reported by:	rafa@dif.um.es,
		SHIRASAKI Yasuhiro <yasuhiro@nttv6.jp>
Reviewed by:	SHIRASAKI Yasuhiro <yasuhiro@nttv6.jp>
MFC after:	1 week
2003-04-04 11:09:08 +00:00
ume
0d084321c4 If IPCP is disabled, susccess of IPV6CP negotiation is sufficient
to communicate by IPv6.  So, the prompt should be `PPP' rather
than `PPp'.
2003-03-28 18:23:43 +00:00
ume
19228f1dbe Don't install wrong IPv6 route by add command. 2003-03-26 06:30:11 +00:00
brian
ba277a3e14 Passing a u_char to ntohs() is guaranteed to give the wrong answer !
Submitted by:	Francis Dupont <Francis.Dupont@enst-bretagne.fr>
2003-03-26 02:27:32 +00:00
brian
a3b7ff0585 Add a ``force-scripts'' option for using chat scripts with -direct and
-dedicated links.

Submitted by:	Maksim Yevmenkin <myevmenk@exodus.net>
2003-03-26 02:03:08 +00:00
ume
f455bf97a4 Once ppp session is over, the route to ff02::tun0/32 was
deleted, and never came back.  Now, the route to
ff02::tun0/32 is installed at the end of IPV6CP negitiaton.
2003-03-25 17:01:39 +00:00
ume
9285b79003 We need filling scopeid to install routes for link-local
scope addresses.
2003-03-25 16:49:08 +00:00
ume
f92a704df5 Since ppp.link{up,down} is invoked at the end of IPCP negotiation, if
we need ppp.link{up,down}, we couldn't disable IPCP.  Now, if IPCP is
disabled, ppp.link{up,down} is invoked at the end of IPV6CP
negotiation.
2003-03-25 15:59:27 +00:00
schweikh
d3367c5f5d Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
peter
97526c738c utmp.ut_time and lastlog.ll_time are explicitly int32_t rather than
time_t.  Deal with the possibility that time_t != int32_t.  This boils
down to this sort of thing:
 -   time(&ut.ut_time);
 +   ut.ut_time = time(NULL);
and similar for ctime(3) etc.  I've kept it minimal for the stuff
that may need to be portable (or 3rd party code), but used Matt's time32
stuff for cases where that isn't as much of a concern.

Approved by: re (jhb)
2002-11-15 22:42:00 +00:00
brian
f3374bb45c If the peer gives us 0.0.0.0 as his IP number, NAK it rather than accepting
it as being in range.

  set ifaddr 1.2.3.4/0 5.6.7.8/0

no longer allows 0.0.0.0 as a valid IP.

Reported/tested by:	Bohdan Horst <nexus@hoth.amu.edu.pl>
MFC after:		3 days
2002-09-23 22:40:43 +00:00
brian
5070b14ce0 Unbreak -DNOINET6
Submitted by:	Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
MFC after:	1 day
2002-09-02 13:34:27 +00:00
sobomax
1b5413df63 Correctly handle ifr.ifr_flags/ifr.ifr_flagshigh like ifconfig(8) does.
MFC after:	1 day
2002-08-29 12:52:28 +00:00
brian
4a8007c87f - made ppp compliant to RFC 2472 (based on a patch from another
contributor)
- support ipv6cpretry and ipv6cpretries, which are IPv6 versions
  of ipcpretry and ipcpretries.
- improve handling of IPv6 link-local addresses

Submitted by: JINMEI Tatuya <jinmei@isl.rdc.toshiba.co.jp>
2002-08-29 02:44:58 +00:00
brian
f2e99a8ed2 Include the correct file (stdarg.h) and use va_list rather than _BSD_VA_LIST_
Suggested by: mike
2002-08-27 20:11:58 +00:00
brian
b7dfdde9ad Use _BSD_VA_LIST_ rather than __va_list if it's defined 2002-08-27 04:37:04 +00:00
brian
9dd51f0cd2 Correct the FAQ url
Submitted by: Olivier Tharan <olive@oban.frmug.org>
2002-08-26 20:48:07 +00:00
charnier
aa31b7d1e4 Replace various spelling with FALLTHROUGH which is lint()able 2002-08-25 13:30:43 +00:00
mike
9e6f796b0d o Merge <machine/ansi.h> and <machine/types.h> into a new header
called <machine/_types.h>.
o <machine/ansi.h> will continue to live so it can define MD clock
  macros, which are only MD because of gratuitous differences between
  architectures.
o Change all headers to make use of this.  This mainly involves
  changing:
    #ifdef _BSD_FOO_T_
    typedef	_BSD_FOO_T_	foo_t;
    #undef _BSD_FOO_T_
    #endif
  to:
    #ifndef _FOO_T_DECLARED
    typedef	__foo_t	foo_t;
    #define	_FOO_T_DECLARED
    #endif

Concept by:	bde
Reviewed by:	jake, obrien
2002-08-21 16:20:02 +00:00
ru
ce971426f4 mdoc(7) police: Removed redundant .Ns calls. 2002-08-13 16:07:28 +00:00
blackend
38c0bac808 Correct URL to the FAQ
MFC after:	1 week
2002-07-31 10:05:00 +00:00
blackend
8ce62b66d8 Correct links to Handbook's pages, old URLs does not work anymore.
MFC after:	1 week
2002-07-30 21:04:26 +00:00
brian
ae9417246c Do a case insensitive comparison when comparing the ms-chap response
string.
2002-07-30 08:09:26 +00:00
brian
0ffeeffe3e Remove unused calls to inet_addr() 2002-07-18 18:50:05 +00:00
brian
d046f882cc Back out the previous revision
Objected to by: Andre Oppermann <oppermann@pipeline.ch>

After Andre's objection, I've re-examined rfc 2759 and noted that it
says that the domain name shouldn't be used when generating the
NT-Response field.  So it looks like the bug is in freeradius rather
than in ppp.
2002-07-04 23:33:35 +00:00
brian
9ba6d06dcf If we've given a domain name prefix as the authentication name, strip
it off before passing it on to the RADIUS server for authentication.
2002-07-03 20:51:13 +00:00
brian
a8c83ef89c Don't trust the MPPE key lengths passed back from the RADIUS server.
Instead, use the correct values based on the number of bits actually
negotiated.

Spotted by: Sergey Korolew <ds@rt.balakovo.ru>
2002-07-02 00:47:24 +00:00
brian
c90db9b98a Remove some misleading/wrong diagnostics 2002-07-02 00:12:24 +00:00
brian
ab92b92516 Show the port number (tty slot, pppoe session id etc) under
``show physical''.
2002-06-30 01:46:22 +00:00
brian
8368fc422d When a netgraph message is read, look for another before returning.
This removes a bad latency problem during initial setup where we
end up waiting for too long before reading the connected message
and time the connection out.

Problem figured out by:	Andre Albsmeier <andre@albsmeier.net>
2002-06-29 18:49:08 +00:00
brian
edd536143a Don't use SignalBundle if it's not set
Submitted by: Federico G. Schwindt <fgsch@olimpo.com.br>
2002-06-28 09:33:25 +00:00
brian
9e2f577390 Complain about (and fix) misformatted RADIUS attributes rather than silently
fixing them.
2002-06-28 09:18:15 +00:00
brian
fa2f229525 When a RADIUS server is being used, don't use MPPE unless the RADIUS
server says it's ok.
2002-06-28 08:46:21 +00:00
brian
20a617c09d Add a hack to handle RADIUS responses from peers that forget that
there's an ``Ident'' field in the MS-CHAP2-Response and
MS-CHAP-Error attributes.

The RADIATOR server seems to be guilty of this.
2002-06-23 23:38:06 +00:00
brian
cd63f26c91 Don't expect NUL terminated data in all netgraph messages received.
Only display message hook values we understand.
2002-06-22 21:01:47 +00:00
brian
50179a5819 Compensate for dodgy Win98/WinME MSCHAPv2 responses later in the code
path... after we've talked to any RADIUS servers involved, so that we
haven't touched the data before it gets to the server.

Make it clearer in the code that this compensation is done by setting
a flag to a value of zero, a flag which rfc2759 says *MUST* be zero.

While we're here, don't bother passing the peer challenge into
radius_Authenticate().  It's already part of the key we're passing in
(this becomes obvious now that I've structured that data...).

This ``fix'' doesn't help to authenticate Win98/WinME users in my test
environment as ports/net/freeradius seems to ignore the flag
completely anyway, but it may help with other RADIUS servers.
2002-06-17 01:12:38 +00:00
brian
6ff6823d37 A better prinflike fix... 2002-06-15 08:03:59 +00:00
brian
72243fc694 Remove whitespace at the end of lines. 2002-06-15 08:03:30 +00:00
brian
fbed14fd88 Fix a printflike format error 2002-06-15 01:36:36 +00:00
brian
017c077056 Remove a forgotten diagnostic 2002-06-15 01:35:03 +00:00
brian
514fa7d23f If a RAD_FILTER_ID is supplied by the RADIUS server, treat it as an
additional label from ppp.linkup & ppp.linkdown to load.

Suggested and mostly submitted by: andrew pavlov <and@kremenchug.net>
2002-06-12 23:45:15 +00:00
brian
9412fc32d2 Bump the version number to reflect the recent RADIUS commits 2002-06-12 23:00:12 +00:00
brian
81be549dd2 Don't forget to process the Ident field on the front of
RAD_MICROSOFT_MS_CHAP_ERROR and RAD_MICROSOFT_MS_CHAP2_SUCCESS
messages, and remove the hack in chap.c to ignore that ident field
on the client side.

This anomoly was hacked around during development, and I forgot to
go back and fix it properly.

Spotted by: Sergey Korolew <ds@rt.balakovo.ru>
2002-06-12 21:36:07 +00:00
brian
64df596967 Understand the following Microsoft Vendor Specific RADIUS attributes:
RAD_MICROSOFT_MS_MPPE_ENCRYPTION_POLICY
  RAD_MICROSOFT_MS_MPPE_ENCRYPTION_TYPES
  RAD_MICROSOFT_MS_MPPE_RECV_KEY
  RAD_MICROSOFT_MS_MPPE_SEND_KEY

These attributes may be supplied by a RADIUS server when MSCHAPv2 is
used to authenticate.

It *should* now be possible to build ppp with -DNODES and still support
CHAP/MSCHAP/MSCHAPv2/MPPE via a RADIUS server, but the code isn't yet
smart enough to do that (building with -DNODES just looses these
facilities).

Sponsored by: Monzoon
2002-06-12 00:33:17 +00:00
brian
e96dc1713c Cast pid_t to long for printf()ing
Obtained from:	OpenBSD
2002-06-06 01:39:46 +00:00
brian
be443b894f Add a missing ``a''. 2002-06-03 21:36:20 +00:00
brian
f1bf75d03d Don't send a RAD_NAS_IP_ADDRESS attribute as RAD_NAS_IDENTIFIER is
sufficient.

In fact, using both breaks the radiator RADIUS daemon when used with
a db as it maps both attributes to the same field value and then
fails the insert.

I decided to remove RAD_NAS_IP_ADDRESS on the basis that rfc2138 says:

      An Access-Request MUST contain a User-Name attribute.  It SHOULD
      contain either a NAS-IP-Address attribute or NAS-Identifier
      attribute (or both, although that is not recommended).  It MUST

despite the fact that this not recommended bit was removed from the
updated rfc.
2002-06-02 14:27:02 +00:00
brian
6fc921d693 Coerce pid_t to long rather than int for better portability.
Suggested by: Theo de Raadt <deraadt@openbsd.org>
2002-05-27 23:19:53 +00:00
brian
debad274d2 Increase the maximum FSM option length to 50 2002-05-22 21:17:13 +00:00
brian
e2e6ae2d7a Add some missing #includes that weren't required due to namespace polution
in our headers.

Submitted by: bde
2002-05-22 21:08:58 +00:00
brian
d6c7357cf3 Mention our support of the authentication side of rfc2548 2002-05-21 10:54:07 +00:00
brian
d2110d3eba Document RAD_MICROSOFT_MS_CHAP2_SUCCESS. 2002-05-18 23:58:15 +00:00
brian
3c3efb7e19 Put back <string.h> 2002-05-17 00:44:54 +00:00
brian
a821e645fa Add some OpenBSD includes 2002-05-16 14:47:19 +00:00
brian
098eb79132 Fix a mis-placed #else/#endif 2002-05-16 14:28:32 +00:00
brian
6efbe1505f Handle MS-CHAPv2 authentication correctly via the RADIUS server (if it's
configured).
Handle internal failures in radius_Authenticate() correctly.
Bump the ppp version number.

This doesn't yet work with MPPE.  More will follow.

Sponsored by: Mozoon
2002-05-16 13:34:20 +00:00
brian
06388d2280 Fix an include for NetBSD 2002-05-14 17:50:25 +00:00
brian
09439a23da Avoid a rather bizarre warning from gcc 3.1:
/usr/src/usr.sbin/ppp/cbcp.c:566:61: warning: trigraph ??! ignored
2002-05-14 13:32:30 +00:00
brian
c2da7c8697 o Clean up some #includes
o Bump version number to 3.0.4
o When talking to a RADIUS server, provide a NAS-Port-Type.

  When the NAS-Port-Type is Ethernet, provide a NAS-Port value equal
  to the SESSIONID from the environment in direct mode or the
  NGM_PPPOE_SESSIONID message in other modes.  If no SESSIONID is found,
  default to the interface index in client mode or zero in server mode.

  When the NAS-Port-Type is ISDN, set the NAS-Port to the minor number
  of the physical device (ie, the N in /dev/i4brbchN).

  This makes it easier for the RADIUS server to identify the client
  WRT accounting data etc.

Prompted by:	lsz8425 <lsz8425@mail.cd.hn.cn>
2002-05-14 12:55:39 +00:00
brian
def93d7c3c Calculate the number of open links properly when deciding on whether to
just send PROTO_IP packets when we've got only one link up in multi-link
mode.

Problem noted by:	Adrian Close <adrian@fernhilltec.com.au>
MFC after:		1 week
2002-05-14 00:59:28 +00:00
brian
f9345cd242 Fix a syntax error 2002-05-13 20:25:47 +00:00
brian
e7542a26ed We don't need to include arpa/inet.h here. In fact, only FreeBSD needs
netinet/in.h.
2002-05-11 17:04:01 +00:00
brian
80f4fb7cc7 #include netinet/in.h when !__FreeBSD__ to silence some warnings from
the inclusion of arpa/inet.h
2002-05-11 10:54:45 +00:00
brian
02509bfc4b NetBSD keeps des.h in /usr/include/openssl these days 2002-05-11 03:47:15 +00:00
brian
1947582c12 Add support for MS-CHAP authentication via a RADIUS server.
Add support for Reply-Message and MS-CHAP-Error.

Sponsored by:	Monzoon
2002-05-10 03:11:35 +00:00
brian
87ffeeba8e Don't corrupt MP fragments when they're put back on the front of our
inbound queue.

Submitted by:	"Amit K. Rao" <arao@niksun.com>
PR:		37813
MFC after:	1 week

Also fix a typo while I'm here.
2002-05-07 12:48:45 +00:00
brian
920f339ee0 Understand the Session-Timeout RADIUS attribute
Store the Filter-Id attribute (we don't do anything with it yet)

Submitted mostly by: andrew pavlov <and@kremenchug.net>
2002-05-07 10:06:54 +00:00
brian
7bc3ad5ab7 Tweak a data type from char * to u_char * 2002-05-04 21:47:43 +00:00
brian
e2ff55c530 Make ``set mru'' require a context. In multi-link mode, there's no
point in being allowed to ``set mru'' for the MP lcp layer.

Spotted by:	Richard Browne <richb@timestone.com.au>
MFC after:	1 month
2002-05-04 19:38:43 +00:00
brian
d6c25b14c5 Bump the version to mark the fixed FSM TLD ordering 2002-05-01 10:08:10 +00:00
brian
e9f489edca If we receive a config request while Open, call TLD *before* decoding
the request as TLD may initialise fields that are set when decoding the
request.

MFC after:	1 week
2002-05-01 10:04:49 +00:00
brian
e8c453a543 Allow the peer to modify the LQR interval 2002-05-01 07:49:07 +00:00
des
4d6b787d2d Usage style sweep: spell "usage" with a small 'u'.
Also change one case of blatant __progname abuse (several more remain)
This commit does not touch anything in src/{contrib,crypto,gnu}/.
2002-04-22 13:44:47 +00:00
brian
734c0c9c89 Don't load the netgraph line discipline. When it's in use, TIOCMGET
fails and on loss of carrier, the device doesn't become selectable with
0 bytes to read.

Problem reported by: ache
2002-04-21 02:00:29 +00:00
brian
f57b9edeb5 Add variable substitutions for SOCKNAME, IPOCTETSIN, IPOCTETSOUT, IPPACKETSIN,
IPPACKETSOUT, IPV6OCTETSIN, IPV6OCTETSOUT, IPV6PACKETSIN, IPV6PACKETSOUT,
OCTETSIN, OCTETSOUT, PACKETSIN, PACKETSOUT and SOCKNAME.
2002-04-17 12:38:59 +00:00
brian
f84972208c Don't display an extraneous ``: '' with some packets in/packets out diagnostics 2002-04-16 23:57:21 +00:00
brian
b86a2d03f8 Make the way FSM options are processed easier to read by using structures
instead of u_char *.

The changes are cosmetic except:

  RecvConfigAck() now displays the options that are being ACK'd
  Huge (bogus) options sent from the peer won't cause an infinite loop
  SendIdent and ReceiveIdent are displayed consistenlty with other FSM data
  LCP AUTHPROTO options that aren't understood are NAK'd, not REJ'd
2002-04-16 23:57:09 +00:00
brian
99e79d7fa0 When it's necessary to kldload tun(4), don't forget to re-try to open
tun0.

Submitted by:	qhwt@myrealbox.com
2002-04-15 00:14:40 +00:00
hosokawa
cce077344b Get tun P2P address from the local pool if RADIUS server returned
255.255.255.254 as client ipaddr.

Reviewed-By:	freebsd-net mailing list
2002-04-04 08:43:00 +00:00
brian
5e89c7151f Fix a typo 2002-03-31 01:57:06 +00:00
brian
ab4711b90a Add a missing ``#ifndef NONETGRAPH'' 2002-03-31 01:56:34 +00:00
brian
b222d9573a Remove some extraneous whitespace 2002-03-31 01:51:15 +00:00
brian
05e0b92acd Include arpa/inet.h 2002-03-31 01:36:08 +00:00
ru
ea17e5024d Fix CLEANFILES. 2002-03-30 17:57:51 +00:00
brian
631238220a Add a sprinkling of mp_Down() calls to ensure that we don't think that
the multi-link NCP is up when it isn't.
2002-03-30 12:52:55 +00:00
brian
4aad533fbf Don't use the RTF_GATEWAY flag and pass the RTA_GATEWAY address when updating
routes.
2002-03-30 12:50:49 +00:00
brian
1dda0c6402 Add a missing break 2002-03-30 12:47:29 +00:00
brian
ee9763124d Merge the NETGRAPH branch into HEAD. tty devices now use netgraph's line
discipline to do the async escaping, but no other benefits are available yet.

Change ``ifdef HAVE_DES'' to ``ifndef NODES'' for consistency.

Make the Makefile a little more sane WRT RELEASE_CRUNCH.
2002-03-30 12:30:09 +00:00
brian
a80a96a3d8 Fix a typo
Submitted by:	dirk
2002-03-25 14:14:31 +00:00
ru
fbd982bb93 mdoc(7) police: .Va -> .Ev. 2002-03-15 17:03:05 +00:00
brian
783a07fdf2 Use the return value from snprintf() to keep a track of the length of
the display string in MPPEDispOpts.

PR:		35836
MFC After:	2 weeks
2002-03-13 10:21:19 +00:00
brian
e3b5feb1f5 Handle B460800 and B921600 being defined in <termios.h> 2002-03-12 16:05:26 +00:00
brian
ca8983659d Don't drop the last character from ut_line in ID0logout().
PR:		35531
MFC after:	2 weeks
2002-03-05 13:03:11 +00:00
brian
e1efcab9b5 Don't blow away ``set escape'' settings when we've completed the
login phase.  Just initialise the correct parts.

Originially submitted by:	Vladimir B. Machulsky <bofhmail@yahoo.com>
2002-03-04 10:08:57 +00:00
brian
9e9f75c5de Document NGM_PPPOE_ACNAME handling. 2002-02-20 15:53:47 +00:00
brian
1af410bad4 Handle NGM_PPPOE_ACNAME messages.
Submitted by:	Andre Albsmeier <andre@albsmeier.net>
Approved by:	julian
2002-02-20 15:52:20 +00:00
mike
bcee06d42c o Move NTOHL() and associated macros into <sys/param.h>. These are
deprecated in favor of the POSIX-defined lowercase variants.
o Change all occurrences of NTOHL() and associated marcros in the
  source tree to use the lowercase function variants.
o Add missing license bits to sparc64's <machine/endian.h>.
  Approved by: jake
o Clean up <machine/endian.h> files.
o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>.
o Remove prototypes for non-existent bswapXX() functions.
o Include <machine/endian.h> in <arpa/inet.h> to define the
  POSIX-required ntohl() family of functions.
o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>,
  and <sys/param.h>.
o Prepend underscores to the ntohl() family to help deal with
  complexities associated with having MD (asm and inline) versions, and
  having to prevent exposure of these functions in other headers that
  happen to make use of endian-specific defines.
o Create weak aliases to the canonical function name to help deal with
  third-party software forgetting to include an appropriate header.
o Remove some now unneeded pollution from <sys/types.h>.
o Add missing <arpa/inet.h> includes in userland.

Tested on:	alpha, i386
Reviewed by:	bde, jake, tmm
2002-02-18 20:35:27 +00:00
brian
2cd83c2da4 Detect if a udp socket on STDIN_FILENO is connected by calling
getpeername() and don't set PASSIVE mode if it's is.
2002-01-23 23:36:35 +00:00
brian
153455a7d2 Cross reference the NETWORK ADDRESS TRANSLATION section when describing
the -nat flag.

Requested by:	eivind
2002-01-23 21:11:33 +00:00