Commit Graph

45 Commits

Author SHA1 Message Date
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
itojun 4eb5250694 fix operator precedence (& and &&). do not transmit too much message
from LCP layer to NCP layer.  PR 11161.
2000-10-08 02:37:42 +00:00
itojun b8453a0291 fix compilation without INET 2000-10-02 03:53:47 +00:00
sommerfeld c93db19567 Merge if_spppsubr.c PPP protocol declarations list with the one found
in ppp_defs.h, and have if_spppsubr.c include ppp_defs.h rather than
duplicate its definitions.

[This is a stopgap measure to clean up build lossage.]
2000-07-02 17:38:09 +00:00
itojun 3c67584219 propose better IPv6 ifid alternative to the peer, when ifid collides
during IPv6CP negotiation.  it is very rare to see collision.
2000-05-16 05:45:27 +00:00
itojun aee9bb5b5f IPv6CP support. if IPv6 link-local address is configured to the interface,
the interface tries to negotiate ifid with the other end by using IPv6CP.

other changes:
- do not share ppp sequence number across protocols.
- if LCP proto-rej is received, drop the protocol mentioned by the message.
  this is to be friendly with non-IPv6 peer (if the peer complains due to
  lack of IPv6CP, drop IPv6CP).  this basically implements "RXJ+" state
  transition in the RFC.
- cleanup debugging message.  always print blank just before message.

CAVEAT:
- if the peer uses the same MAC address as our side (pretty unlikely)
  the code may go into req-rej loop.
- even though we negotiate ifid, we don't configure destination address
  onto the interface.  it is not really necessary to do so (IMHO).
- I've tested this code on a NetBSD 1.4.2 node, which was with fair amount
  of modifications.  not sure if the committed code does it right... (please
  test and send reports)
2000-05-02 12:43:16 +00:00
itojun c24f5b5068 add more IPv6 cases. not tested.
TODO: IPv6CP support.  currently IPv6 packet will be generated right
after link up (spec violation)
2000-04-12 10:51:15 +00:00
thorpej fc96443d15 New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
2000-03-23 07:01:25 +00:00
thorpej e1ed9178a1 Add the `packed' attribute to structures which describe wire protocol
data formats.
1999-11-19 20:41:19 +00:00
itojun 06c350054d remove reference to in6_systm.h (file itself will be removed afterwords) 1999-07-30 10:35:34 +00:00
explorer 9350aaaee9 Add NetBSD rcsid tags, and preserve old ones from i4b source 1999-04-04 06:57:03 +00:00
explorer a6a18662a2 switch to the i4b version of if_sppp*.[ch] (with mods) 1999-04-04 06:07:56 +00:00
explorer f388d47b3b put RCS ids in the right place. And yes, this is a SYNC ppp interface,
used for high-speed (T1, HSSI, DS3) interfaces.
1999-03-25 05:25:42 +00:00
explorer 2a91ea8a57 port FreeBSD's serial ppp layer to NetBSD. The PPP part seems broken still,
but the lmc driver uses the HDLC bits from here anyway.
1999-03-25 03:38:00 +00:00