summaryrefslogtreecommitdiffstats
path: root/sys/net/if_spppsubr.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Make the LCP restart timer configurable.joerg2001-12-271-9/+20
| | | | | | | | | This (effectively) merges rev 1.36 of i4b's old if_spppsubr.c, albeit in a slightly different manner (we export the timer in millisecond values as exposed to tick values from/to userland). Obtained from: i4b MFC after: 1 month
* Implement VJ header compression for sppp.joerg2001-12-271-5/+153
| | | | | | | | | | This is the logical merge of rev 1.32 of i4b's old if_spppsubr.c (which was based on PR misc/11767), plus (i4b) rev 1.6 of i4b's if_ispppsubr.c, albeit with numerous stylistic and cosmetic changes. PR: misc/11767 Submitted by: i4b, Joachim Kuebart MFC after: 1 month
* Don't log RXJ+ protocol rejects unless we are in debug mode. (RXJ-joerg2001-12-261-6/+7
| | | | | events are always logged.) This stops sppp from spamming the syslog files in case the remote peer is not configured to negotiate IPv6.
* Ignore (and silently conf-ack) conf-reqs for an Async-Control-joerg2001-12-261-11/+15
| | | | | | | Character-Map. RFC 1662 demands it for the sake of async to sync PPP protocol converters (like Win9* :). This merges rev 1.26/1.27 of the old i4b sppp changes.
* For SIOCSIFADDR, don't call if_up() since it would attempt to add thejoerg2001-12-261-1/+2
| | | | | | | | | route to the destination twice. Now that brian has fixed route.c to no longer accept this second route, this long-standing nuisance became a showstopper bug for sppp users. In retrospect, this is the same fix as the one in rev 1.78 of if_sl.c; most likely the original version of sppp has been cloned from SLIP. ;-)
* Update the hash table when sppp mucks directly with the interface address.jlemon2001-10-011-0/+4
|
* If LCP proto-rej is received, drop the protocol mentioned by the message.ume2001-07-311-1/+59
| | | | | | | | 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. Obtained from: NetBSD
* Fix warning: 848: warning: label `nosupport' defined but not usedpeter2001-06-151-1/+0
|
* Make compilable. addlog(...) was replaced with log(-1, ...)ume2001-06-131-18/+18
| | | | Reported by: peter
* Restore the code wrongly nuked by previous commit.ume2001-06-121-0/+1
| | | | | | | | Following changed was made by previous commit: - IPV6CP supporting in kernel level ppp from NetBSD. Submitted by: y.shirasaki@ntt.com
* Sync with recent KAME.ume2001-06-111-22/+773
| | | | | | | | | | | | | | | | | | This work was based on kame-20010528-freebsd43-snap.tgz and some critical problem after the snap was out were fixed. There are many many changes since last KAME merge. TODO: - The definitions of SADB_* in sys/net/pfkeyv2.h are still different from RFC2407/IANA assignment because of binary compatibility issue. It should be fixed under 5-CURRENT. - ip6po_m member of struct ip6_pktopts is no longer used. But, it is still there because of binary compatibility issue. It should be removed under 5-CURRENT. Reviewed by: itojun Obtained from: KAME MFC after: 3 weeks
* Move the decision whether we want to request authentication from ourjoerg2001-04-081-8/+8
| | | | | | | peer out from sppp_lcp_open() to sppp_lcp_up(). For one, this makes things look more symmetrical to sppp_lcp_close(), and somehow it also just occurred to me that an Up event following the open caused the value of the authentication option to be clobbered.
* This is another MFC candidate.joerg2001-03-251-2/+2
| | | | | | | | | | | Fix a serious bug in sppp where anyone could obtain a successful PAP authentication by supplying a null password. I've only stumpled across the PR while browsing for all sppp-related PRs. Should we also file a security advisory for this? PR: 21592 Submitted by: <dli@3bc.de> Dirk Liebke
* (MFC candidate, see below).joerg2001-03-231-0/+14
| | | | | | | | | | | | | | | | | | | | When we get an Open event in stopped state, experience shows that this is usually means we've somehow missed a previous Down event. This has occasionally bitten people for the IPCP layer with ISDN, apparently a previously aborted IPCP negotiation must have caused this. As a bandaid, we quickly pretent a Down event by advancing to starting state; this effectively implements the `restart' option mentioned in RFC 1663. While i'm not yet fully convinced this is the best thing to do (and is fully compliant with RFC 1661), i've seen a number of reports here on the German mailing lists where people have been bitten by the previous behaviour which usually causes quickly looping ISDN reconnects (thus loss of money...), and where just this patch fixes the problem. For this, i'd even like to see it MFC'd if possible. Submitted by: Helmut Kreft <kreft@zeus.ai-lab.fh-furtwangen.de>
* Use <sys/queue.h> macro api rather than fondle its implementation detals.phk2001-02-031-4/+4
| | | | | Created with: /usr/bin/sed Reviewed by: /sbin/md5
* Various fixes to make leased line operation more robust. On lcp_up, startjhay2000-12-191-49/+100
| | | | | | | | | to negotiate from scratch. Make leased lines survive being put into loopback mode. Bits and pieces and ideas taken from PRs 11238 and 21771. Make it a module so that it can be kldloaded. Whitespace cleanup. (Can be ignored with "cvs diff -b".) PR: 11238 and 21771 (bits and pieces)
* Make log(-1, ...) do what addlog(...) did.phk2000-11-261-89/+89
| | | | | | | | Replace all uses of addlog(...) with log(-1, ...) Remove bogus "register" keywords in subr_prf.c Make log() return void.
* Lock down the network interface queues. The queue mutex must be obtainedjlemon2000-11-251-53/+16
| | | | | | | | | | | | | | before adding/removing packets from the queue. Also, the if_obytes and if_omcasts fields should only be manipulated under protection of the mutex. IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on the queue. An IF_LOCK macro is provided, as well as the old (mutex-less) versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which needs them, but their use is discouraged. Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF, which takes care of locking/enqueue, and also statistics updating/start if necessary.
* * Use sys/sys/random.h rather than a i386 specific one.obrien2000-04-241-4/+1
| | | | | * There was nothing that should be machine dependant about i386/isa/random_machdep.c, so it is now sys/kern/kern_random.c.
* Clean up some loose ends in the network code, including the X.25 and ISOpeter2000-02-131-23/+0
| | | | | | | #ifdefs. Clean out unused netisr's and leftover netisr linker set gunk. Tested on x86 and alpha, including world. Approved by: jkh
* udp IPv6 support, IPv6/IPv4 tunneling support in kernel,shin1999-12-071-1/+18
| | | | | | | | | | packet divert at kernel for IPv6/IPv4 translater daemon This includes queue related patch submitted by jburkhol@home.com. Submitted by: queue related patch from jburkhol@home.com Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project
* When getting a RCN event in state ACK_RCVD, RFC 1661 demands that wejoerg1999-10-291-1/+1
| | | | | | | go to REQ_SENT (and we probably should also log this since it should only happen in a cross-linked connection). Submitted by: Mark Tinguely <tinguely@plains.NoDak.edu>
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* rganize the various modes (CISCO/AUTO/DEMAND/LEASED) a little bit better,phk1999-03-301-27/+48
| | | | | | centralize the code. Remember to call TLF/TLS on the hardware in CISCO mode.
* Misplaces brace puts important code into debug section.phk1999-02-231-5/+5
| | | | | Reviewed by: phk Submitted by: Stefan Bethke <stefan.bethke@hanse.de>
* Remove all the #ifdef notyet stuff, it is probably never going to happenphk1999-02-191-77/+27
| | | | | | | | | | | | | | in the first place. Use 3sec timeout as recommended. Reorder some debug messages. Label som of the 0x%x in debug messages Make sppp_print_bytes() use %*D and handle zero length. If we don't have MAGIC numbers, don't yell loopback if 0 == 0
* Update sppp support to i4b level. This includes the new spppcontrolphk1998-12-271-33/+115
| | | | program to set PPP options like authentication with.
* More isdn4bsd convergence: cleanup log messages.phk1998-12-261-18/+24
|
* Converge further on the isdn4bsd version of this file.phk1998-12-261-27/+25
|
* clean up more timeout/untimeout portability stuff.phk1998-12-261-34/+19
| | | | make sure flags and stuff are set sensibly.
* Straigthen out the use of the tls and tlf callbacks.phk1998-12-161-9/+14
| | | | | | | | | Not tested on the if_sr, if_cx and if_ar drivers, but expected to work just the same as it used to. Any users of these drivers (or even better: donors of hardware for them) please contact phk@freebsd.org so we can test the next batch of changes to if_sppp.
* *** empty log message ***phk1998-12-111-7/+12
|
* Examine all occurrences of sprintf(), strcat(), and str[n]cpy()archie1998-12-041-6/+6
| | | | | | | | | | | | | | for possible buffer overflow problems. Replaced most sprintf()'s with snprintf(); for others cases, added terminating NUL bytes where appropriate, replaced constants like "16" with sizeof(), etc. These changes include several bug fixes, but most changes are for maintainability's sake. Any instance where it wasn't "immediately obvious" that a buffer overflow could not occur was made safer. Reviewed by: Bruce Evans <bde@zeta.org.au> Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Reviewed by: Mike Spengler <mks@networkcs.com>
* Minor cleanup: kill a couple of unused variables, and a couple ofjoerg1998-10-061-3/+7
| | | | | | uninitialized variables. Obtained from: The isdn4bsd project (partially)
* In an attempt to reduce the huge number of differences between thejoerg1998-10-061-225/+337
| | | | | | | | | | | | | | | | | | | | | | | | | | FreeBSD repository version of this file and the isdn4bsd version, adopt those changes from the i4b version that make this file BSD-version independent. I attempted to avoid uglifying this file too much, thus deviated a little from the i4b version (and hope they will adopt the changes, too). The diffs mostly concentrate on: . #include differences between the systems . different callout handling between FreeBSD vs. Net/OpenBSD . interface naming (Net/OpenBSD store the ASCII name including the unit # in struct ifnet, FreeBSD only the name) . use of random() in FreeBSD vs. time-based pseudo-randomization in Net/OpenBSD (for loopback detection ad CHAP challenges -- i assume at least OpenBSD could also benefit from random(), but that's the way i've got this file) . interface address list elements are named a little differently between FreeBSD and Net/OpenBSD I attempted to segregate those compat fixes from other code fixes and enhancements. Obtained from: The isdn4bsd project
* Fix a =/== confusion that caused the CHAP type renegotiation tojoerg1998-10-051-2/+2
| | | | | | completely fail. Obtained from: The isdn4bsd project (original author unknown right now)
* Fixed printf format errors. sppp_dotted_quad() was yet another private,bde1998-08-171-9/+10
| | | | broken, version of inet_ntoa(). It should go away.
* Fixed yet more ioctl breakage due to the type of the `cmd' arg changingbde1998-08-151-5/+5
| | | | from int to u_long but not changing here.
* Removed unused includes.bde1998-06-211-2/+1
|
* s/nanoruntime/nanouptime/gphk1998-05-171-2/+2
| | | | | | s/microruntime/microuptime/g Reviewed by: bde
* Use random() for seq numbers and read_random for CHAP challenge.phk1998-04-061-6/+11
|
* Make read_random() take a (void *) argument instead of (char *)phk1998-04-061-4/+4
|
* Time changes mark 2:phk1998-04-041-4/+6
| | | | | | | | | | | | | | | | | * Figure out UTC relative to boottime. Four new functions provide time relative to boottime. * move "runtime" into struct proc. This helps fix the calcru() problem in SMP. * kill mono_time. * add timespec{add|sub|cmp} macros to time.h. (XXX: These may change!) * nanosleep, select & poll takes long sleeps one day at a time Reviewed by: bde Tested by: ache and others
* Eradicate the variable "time" from the kernel, using various measures.phk1998-03-301-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "time" wasn't a atomic variable, so splfoo() protection were needed around any access to it, unless you just wanted the seconds part. Most uses of time.tv_sec now uses the new variable time_second instead. gettime() changed to getmicrotime(0. Remove a couple of unneeded splfoo() protections, the new getmicrotime() is atomic, (until Bruce sets a breakpoint in it). A couple of places needed random data, so use read_random() instead of mucking about with time which isn't random. Add a new nfs_curusec() function. Mark a couple of bogosities involving the now disappeard time variable. Update ffs_update() to avoid the weird "== &time" checks, by fixing the one remaining call that passwd &time as args. Change profiling in ncr.c to use ticks instead of time. Resolution is the same. Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call hzto() which subtracts time" sequences. Reviewed by: bde
* Fixed syntax error in previous commit.bde1998-03-011-2/+2
|
* Make it possible to indicate that we don't care about the remotephk1998-02-281-3/+6
| | | | sides IP address, as long as it isn't 0.0.0.0
* Staticize.eivind1998-02-091-6/+6
|
* Make INET a proper option.eivind1998-01-081-1/+4
| | | | | | | | | | | | This will not make any of object files that LINT create change; there might be differences with INET disabled, but hardly anything compiled before without INET anyway. Now the 'obvious' things will give a proper error if compiled without inet - ipx_ip, ipfw, tcp_debug. The only thing that _should_ work (but can't be made to compile reasonably easily) is sppp :-( This commit move struct arpcom from <netinet/if_ether.h> to <net/if_arp.h>.
* Reviewed by: Joerg Wunschgj1998-01-011-10/+3
| | | | | | | | | | | | | | | In sppp_chap_input: 1) in the CHAP_CHALLENGE case don't output the peer's name if it is not what we expected (DEBUG) since it will be printed out in the course of events anyway. 2) in the CHAP_SUCCESS case test whether the peer is required to authenticate himself [(sp->lcp.opts & (1 << LCP_OPT_AUTH_PROTO))], otherwise the state machine may never switch into the network state. I saw this case against 2 different ISPs; they never bothered to authenticate themselves to me. In sppp_pap_input: in the PAP_ACK case do the same as in 2) above for the same reason.
* Throw options IPX, IPXIP and IPTUNNEL into opt_ipx.h.eivind1997-12-151-1/+3
| | | | | | | | The #ifdef IPXIP in netipx/ipx_if.h is OK (used from ipx_usrreq.c and ifconfig.c only). I also fixed a typo IPXTUNNEL -> IPTUNNEL (and #ifdef'ed out the code inside, as it never could have compiled - doh.)
OpenPOWER on IntegriCloud