Commit Graph

63 Commits

Author SHA1 Message Date
tron 0cbe3d790b Use MRU negotiated with remote system as MTU. This fixes PR kern/18850
by Curt Sampson.
2003-01-28 15:36:38 +00:00
simonb f77e8353aa Remove a break after a goto. 2003-01-19 23:45:33 +00:00
kristerw 83b5a18c99 Restore the system priority level in case of errors.
OK:ed by martin.
2002-12-28 21:09:14 +00:00
itojun 501bf56348 license clarification from the author, via openbsd
>BSD-style license from Serge Vakulenko <vak@cronyx.ru>
2002-09-27 06:20:30 +00:00
itojun c40ace5ea0 KNF 2002-09-25 07:24:06 +00:00
itojun 822449ac65 KNF - return is not a function. 2002-09-11 05:36:26 +00:00
martin 1caaa903fa If the peer did not answer LCP echo requests in-time, but we got user
data through within the last LCP keepalive interval, do not count this
as a keepalive failure.

Addresses parts of kern/17723.
2002-09-01 18:54:12 +00:00
christos d64bbf607d Fix async map handling. Many thanks to Joerg Wunsch for the explanation. 2002-07-30 13:16:35 +00:00
christos 42f6b6f836 Patches from Frank Kardel:
- length was one off in names and secrets.
- add win 98 kludge but we keep it disabled for now.
- setup the authorization bit early so that we don't end up doing ppp
  negotiations without authorization.
2002-07-28 22:16:47 +00:00
christos 59d3d6c274 Don't throw away the name and the secret lengths. This eliminates all the
strlen() calls, and there was a whole bunch of them.
2002-07-28 19:54:47 +00:00
christos 450091b937 avoid modifying the buffers, by checking for matching lengths first. From
Frank Kardel.
2002-07-28 15:12:29 +00:00
christos ca989d9a38 Use strcmp() instead of memcmp() because if we get passed a 0 length name
and secret, we'll authenticate successfully! While there, rename passwd to
secret so that code looks nicer.
2002-07-27 19:09:07 +00:00
martin 5d9a5f68c8 Use "mono_time" instead of "time" for timeout calculations. 2002-07-13 11:08:03 +00:00
yamt 43b3a8007f don't access freed memory. 2002-07-11 21:37:51 +00:00
yamt c56faa76d8 don't access freed memory. 2002-07-11 21:21:53 +00:00
itojun c6f53f281c correct tcp header chasing in pp_fastq processing. should fix kern/17491. 2002-07-06 18:33:45 +00:00
itojun eee0912fd7 don't panic on invalid CONF_ACK from remote (in general, issueing panic
on remote input is bad practice)
2002-05-29 01:38:46 +00:00
martin 75a925b327 "if (debug)" some log messages not signaling real errors but happening
in normal operation.
2002-04-29 16:29:29 +00:00
martin 493d3dde20 Add support to query the peer for DNS addreses when negotiating IPCP.
Add ioctls to retrieve the results.

While here remove a malloc()/free() of an unused buffer.
2002-03-02 16:23:42 +00:00
martin 39764a5363 Use IF_IS_EMPTY and IFQ_IS_EMPTY instead of accessing queue members
directly. Noticed by Thomas Klausner.
2002-02-10 15:17:21 +00:00
martin 6121a90ba1 Fix copy&pasto: truncate strings copied in at *their* right length, not
some other strings length.

Found by Arne Helme.
2002-01-21 11:37:29 +00:00
jdolecek ec531589ce couple cosmetic style fixes, and drop ^L's 2002-01-18 22:39:12 +00:00
martin 301dca6ef4 Make fields in ioctl parameters that are not allowed to be negative u_ints.
Better range & sanity checking for ioctl arguments (thanks, Jaromir!)
2002-01-15 12:28:08 +00:00
martin 78ce6cb0f8 Initialize the activity timestamp when opening a connection. Only idle-
timeout connection that made it to phase NETWORK yet. (For drivers using
the internal timeout mechanism; isdnd, that does the timeout handling for
ISDN drivers, still needs to be fixed.)

Thanks to Wolfgang Solfrank for finding this.
2002-01-14 07:39:14 +00:00
martin da249d7da1 Implement a retry counter for failed authorizations and limit it to
a configurable maximum (default: 5).

Some ISPs shut down accounts (at least temporarily) after to many bad
retries. This hit me recently due to a stupid pilot error and the fast
retry rate.
2002-01-07 10:49:02 +00:00
martin 45514531fd Implement an activity timestamp, recording the last time payload data
passed through.

Implement optional idle timeout.
2002-01-06 20:14:29 +00:00
thorpej ce4f05c0a3 Fix LP64 printf format problem. 2002-01-05 19:26:44 +00:00
martin 99772f59c4 Move net/if_sppp.h to net/if_spppvar.h, create a new net/if_sppp.h
containing the userland visible thinks (i.e. ioctl definitions).

Remove all (both) old ioctls, as they had a brain dead API and made keeping
binary compatibility more or less impossible.

Replace by several new ioctls. While there, remove any arbitrary limits
(resulting from the old, broken ioctls) and allow any length of names
and passwords.
2002-01-04 12:21:24 +00:00
martin 61eb776b48 Remove yet another spurious (debug?) output. 2001-12-16 23:55:28 +00:00
martin c8006a73d3 Remove some spurious (debug?) output. 2001-12-16 00:55:40 +00:00
martin f19c69323c Make reconnects after LCP keepalive detected an error actually work. 2001-12-15 20:40:37 +00:00
martin d585188042 We explicitly close LCP when going to state CLOSED, so we better open
it again when going from INITIAL to STARTING. This has been done for
passive or auto-conecting interfaces always, but not for permanent
ones.

This fixes session reestablishement for PPPoE interfaces without LINK1 set,
and probably also closes PR kern/11161.

Thanks to Jared D. McNeill and Ross Harvey for sugesting debug methology.
2001-12-10 00:22:21 +00:00
martin b1554100e7 Change the way IPCP negotiation is handled.
Collect both local and remote address and set them to the interface in
one step (the peer adress was not set at all before).

This causes the peer address now to show up on the interface and all
messages to the routing socket to be send with correct data. The latter
has been the last missing piece to complete PPPoE support.
2001-12-08 19:46:39 +00:00
ross cbaa950b62 code cleanup for portability 2001-12-04 21:32:15 +00:00
lukem 34d65a3414 add RCSIDs 2001-11-12 23:49:33 +00:00
matt b5e785f38d Switch to using queue access macros instead of refering to the member
fields explicitly.
2001-11-05 18:02:15 +00:00
martin 4e61daf35e In preparation for further changes: remove big parts of the ifdef mess
for OSes we no longer share this file with.
2001-10-29 19:15:48 +00:00
itojun 2697773fb1 IFQ_PURGE cannot be used against ifqueue. use IF_PURGE. 2001-08-23 00:56:03 +00:00
thorpej cbf41a143a bzero -> memset 2001-07-18 16:43:09 +00:00
martin 86774df023 Fix a slight bug introduced with revision 1.9 (IPv6 integration) where
the bit mask of open NCPs got out of sync.
Defer the (potential) closing of LCP after a NCP went down until after
the state machines got updated.

This fixes PR kern/11161.
2001-07-17 19:12:02 +00:00
thorpej bf2dcec4f5 Remove the use of splimp() from the NetBSD kernel. splnet()
and only splnet() is allowed for the protection of data structures
used by network devices.
2001-04-13 23:29:55 +00:00
martin 8f8dc65f89 Add another option for encapsulation: PP_NOFRAMING.
In this mode, the PPP packets start with the protocol identifier and don't
have any explicit framing (which may be added by the lower level driver).

Make input/output statistics a little bit more correct by adding a hardware
driver adjustable framing length for each packet (instead of the constant
value "3" used before).

While there, bump authentication name length from 32 to 48 (I have a
connection where I need more than 32). XXX - this should not be artificialy
limited at all.
2001-04-09 19:33:01 +00:00
martin f7f12c9b64 Make the 'cmd' argument to ioctl an unsigned long, as it is everywhere
else.
2001-03-25 19:39:20 +00:00
thorpej fc5dafc79b Fix a rather annoying problem where the sockaddr_dl which holds
the link level name for the interface (ifp->if_sadl) is allocated
before ifp->if_addrlen is initialized, which could lead to allocating
too little space for the link level address.

Do this by splitting allocation of the link level name out of
if_attach() and into if_alloc_sadl(), which is normally called
by functions like ether_ifattach().  Network interfaces which
don't have a link-specific attach routine must call if_alloc_sadl()
themselves (example: gif).

Link level names are freed by if_free_sadl(), which can be called
from e.g. ether_ifdetach().  Drivers never need call if_free_sadl()
themselves as if_detach() will do it if it is not already done.

While here, add the ability to pass an AF_LINK address to
SIOCSIFADDR in ether_ioctl() (this is what caused me to notice
the problem that the above fixes).
2001-01-17 00:30:49 +00:00
itojun 72f7f224db run IPCP only if we have IPv4 in kernel 2001-01-16 15:28:27 +00:00
martin 89e8f275be Don't peek at part of a structure via fuword. Does not work well on
64bit architectures. XXX - have to check other changes in the I4B
distribution, this had been fixed there a long time ago.
2001-01-15 13:40:35 +00:00
martin 6b82e7fe42 64bit police.
Rumors say there are archs without ISA busses, so avoid including
(uneccesarily) isa bus headers in MI files.
XXX this is the minimal solution, layer interface calls will have
XXX to be revisited later
2001-01-07 21:47:24 +00:00
thorpej 023adb3093 Use IFQ_PURGE(). 2000-12-18 20:50:36 +00:00
thorpej 3dc1664f57 Add ALTQ glue. 2000-12-13 22:07:50 +00:00
itojun 014e2a97b5 fix comment (s/IPv6/IP/) 2000-10-10 11:43:51 +00:00