summaryrefslogtreecommitdiffstats
path: root/sys/net/radix.c
Commit message (Collapse)AuthorAgeFilesLines
* The code in rn_walktree_from() that checks if we backed up too farqingli2006-02-071-1/+9
| | | | | | | | | | | | did not stop at the right node. Change the backtracking check from smaller-than to smaller-or-equal to prevent this from happening. While here fix one additional problem where the insertion of the default route traversed the entire tree. PR: kern/38752 Submitted by: qingli (before I became committer) Reviewed by: andre MFC after: 3 days
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+1
|
* Readability fixes:luigi2004-04-211-12/+76
| | | | | | | | | | | | | | | | | | | | | | Clearly comment the assumptions on the structure of keys (addresses) and masks, and introduce a macro, LEN(p), to extract the size of these objects instead of using *(u_char *)p which might be confusing. Comment the confusion in the types used to pass around pointers to keys and masks, as a reminder to fix that at some point. Add a few comments on what some functions do. Comment a probably inefficient (but still correct) section of code in rn_walktree_from() The object code generated after this commit is the same as before. At some point we should also change same variable identifiers such as "t, tt, ttt" to fancier names such as "root, left, right" (just in case someone wants to understand the code!), replace misspelling of NULL as 0, remove 'register' declarations that make little sense these days.
* Add some comments, move a static array of constants in the only placeluigi2004-04-191-8/+16
| | | | | where it is used, and replace R_Malloc with R_Zalloc in a couple of places removing the corresponding bzero()'s
* + move MKGet()/MKFree() into the only file that can use them.luigi2004-04-181-13/+19
| | | | | | | | + remove useless wrappers around bcmp(), bcopy(), bzero(). The code assumes that bcmp() returns 0 if the size is 0, but this is true for both the libc and the libkern versions. + nuke Bcmp, Bzero, Bcopy from radix.h now that nobody uses them anymore.
* Remove advertising clause from University of California Regent'simp2004-04-071-4/+0
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* While cleaning out my tree, fix another strict alias warning that wouldpeter2003-09-221-1/+1
| | | | be happening if we didn't stop compiling with -fno-strict-aliasing.
* Make the radix tree code compilable in userland. Requested by ru.hsu2003-02-081-0/+4
| | | | Some style fixes requested by bde.
* Typo in function name.ru2002-12-251-4/+4
|
* A month after pst@ has committed his revision 1.8, it wasru2002-12-251-3/+6
| | | | incorporated by UCB as revision 8.5. Do a diff reduction.
* SMP locking for radix nodes.hsu2002-12-241-0/+1
|
* o Untangle the confusion with the malloc flags {M_WAITOK, M_NOWAIT} andbmilekic2002-12-191-1/+0
| | | | | | | | | | the mbuf allocator flags {M_TRYWAIT, M_DONTWAIT}. o Fix a bpf_compat issue where malloc() was defined to just call bpf_alloc() and pass the 'canwait' flag(s) along. It's been changed to call bpf_alloc() but pass the corresponding M_TRYWAIT or M_DONTWAIT flag (and only one of those two). Submitted by: Hiten Pandya <hiten@unixdaemons.com> (hiten->commit_count++)
* Fix instances of macros with improperly parenthasized arguments.alfred2002-11-091-1/+1
| | | | Verified by: md5
* just merged cosmetic changes from KAME to ease sync between KAME and FreeBSD.suz2002-04-191-1/+1
| | | | | | | (based on freebsd4-snap-20020128) Reviewed by: ume MFC after: 1 week
* Fixed some style bugs in the removal of __P(()). The main ones werebde2002-03-241-5/+5
| | | | | | not removing tabs before "__P((", and not outdenting continuation lines to preserve non-KNF lining up of code with parentheses. Switch to KNF formatting and/or rewrap the whole prototype in some cases.
* Remove __P.alfred2002-03-191-13/+13
|
* Initialize rn_mklist in rn_newpair(). The undocumented assumptionwollman2000-10-271-0/+1
| | | | | | | | | seems to be that the nodes are bzero'd beforehand, but the submitter found that this was not always the case, and in any event defensive programming here costs epsilon squared. PR: 22244 Submitted by: Dave Gillam <daveg@chiaro.com>
* A couple months ago, Kirk and I were doing a walkthrough of the radix-treewollman2000-04-231-145/+190
| | | | | | | | search routine, and scratching our heads over why it was so obfuscated. This delta fixes a number of confusing style bugs and renames several structure members to have more meaningful names. There remain a number of odd control-flow structures. These changes do not affect the generated code.
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-291-2/+2
| | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Never return the root node itself from rn_match(); return NULL instead.pb1999-06-251-2/+5
| | | | | | | | | | | | This caused a panic in rtfreee() called with a root node from the routing socket code (when processing a RTM_GET message looking for the default route while there is none). Since no existing code seems to have any use getting the root node from rn_match(), it seems cleaner never to return it rather than check for this condition at the caller's. PR: kern/12265
* Postpone route_init() until all domains are attached.luoqi1999-04-291-2/+1
|
* Temporary hack. The radix code shouldn't need this, it should bepeter1999-04-261-1/+2
| | | | | | | | able to expand the zeros, ones etc masks on the fly. It seems a good number of domains don't set the rn_maxkey variable anyway, and because this is a domain itself, there is no guarantee we've been called after a protocol that actually has set it (ie: inet), so start with a maxkey of a relatively sane size as a base point until it can adapt on the fly.
* Fixed printf format errors.bde1998-07-111-3/+4
|
* Unstaticized rn_delete() and rn_lookup(). They are used in dark cornersbde1997-11-241-9/+5
| | | | | | of netatalk (if NETATALKDEBUG is configured). Removed stray semicolons.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Another mega commit to staticize things.phk1995-12-141-13/+21
|
* Completed function declarations and/or added prototypes.bde1995-12-021-3/+17
|
* Remove trailing whitespace.rgrimes1995-05-301-13/+13
|
* Incorporate new radix code from UCB. This fixes the orphaned mask bugs.pst1995-04-281-146/+295
| | | | | | | | | This submission was done by hand-applying FreeBSD local modifications on top of the UCB code, rather than trying to patch the UCB code in on top of the FreeBSD code due to the extensive changes. Reviewed by: pst (been handling 30k routes for 4+ months) Obtained from: Sklower/Woody/Honing/Traina (8.4 UCB release)
* radix.c: correct exit condition in rn_walktree_from()wollman1995-03-231-2/+18
| | | | | route.c: be a little more careful when running deleting children of dying . routes
* Better fix for the deletion of parents of cloned routes problem,wollman1995-03-201-1/+80
| | | | | superseding the `nextchild' hack. This also provides a way forward to fix RTM_CHANGE and RTM_ADD as well.
* moved a message into a #ifdef DEBUG. This message comes out if a kernelphk1994-10-151-1/+3
| | | | | doesn't have any networking in it. For instance the new "MINI" install- kernel.
* Cosmetics: to silence gcc -wall.phk1994-10-081-12/+14
|
* Added $Id$dg1994-08-021-0/+1
|
* The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.rgrimes1994-05-251-1/+1
| | | | | Reviewed by: Rodney W. Grimes Submitted by: John Dyson and David Greenman
* BSD 4.4 Lite Kernel Sourcesrgrimes1994-05-241-0/+757
OpenPOWER on IntegriCloud