Commit Graph

1777 Commits

Author SHA1 Message Date
dyoung
a7ae782635 Make rtcache() and rtflush() block IPL_NET while they add/remove
a route from the cached routes list, so that the list won't change
out from under them.
2007-08-30 02:22:29 +00:00
dyoung
b3fc296326 Use malloc(9) for sockaddrs instead of pool(9), and remove dom_sa_pool
and dom_sa_len members from struct domain.  Pools of fixed-size
objects are too rigid for sockaddr_dls, whose size can vary over
a wide range.

Return sockaddr_dl to its "historical" size.  Now that I'm using
malloc(9) instead of pool(9) to allocate sockaddr_dl, I can create
a sockaddr_dl of any size in the kernel, so expanding sockaddr_dl
is useless.

Avoid using sizeof(struct sockaddr_dl) in the kernel.

Introduce sockaddr_dl_alloc() for allocating & initializing an
arbitrary sockaddr_dl on the heap.

Add an argument, the sockaddr length, to sockaddr_alloc(),
sockaddr_copy(), and sockaddr_dl_setaddr().

Constify: LLADDR() -> CLLADDR().

Where the kernel overwrites LLADDR(), use sockaddr_dl_setaddr(),
instead.  Used properly, sockaddr_dl_setaddr() will not overrun
the end of the sockaddr.
2007-08-30 02:17:34 +00:00
dyoung
b4ed197c2d LLADDR -> CLLADDR. 2007-08-27 14:59:11 +00:00
dyoung
d93512cce5 Remove dead code. 2007-08-27 14:57:47 +00:00
dyoung
ae7a571b06 Add a new routing message type, RTM_SETGATE. We can use an
RTM_SETGATE message to ask the link layer to fill in the link-layer
nexthop before we try to detect a duplicate route in a multipath-capable
kernel.
2007-08-27 00:34:01 +00:00
dyoung
5204966a96 Constify: LLADDR -> CLLADDR. I'm aiming here to make it easier to
identify sockaddr_dl abuse that remains in the kernel, especially
the potential for overwriting memory past the end of a sockaddr_dl
with, e.g., memcpy(LLADDR(), ...).

Use sockaddr_dl_setaddr() in a few places.
2007-08-26 22:59:08 +00:00
dyoung
e7e5e02759 Overhaul gre(4), especially the GRE in UDP bits:
* Create the kernel thread in gre_clone_create() instead of trying
  to create it in gre_ioctl().  (Thanks ad@ for suggesting it, and
  pointing out that I can't kthread_create while I hold a spin
  lock.)  Run the thread always, but put it to sleep while the
  gre(4) is not in UDP mode.

* Use sockaddr_in_init().

* Move some thread state off of the stack and into the softc.

* Extract subroutines gre_do_recv(), gre_do_send(), and gre_reconf()
  from gre_thread1(), making the code more readable.
2007-08-24 23:38:31 +00:00
skd
d4509b0376 Clean up net compat ioctls, and clean up handling of wireless ioctls. 2007-08-20 04:49:40 +00:00
joerg
b2dde09db1 Explicitly assert that the protocol out pr_ctloutput before calling it. 2007-08-14 16:03:48 +00:00
seanb
7a700a611e - Check IFF_RUNNING | IFF_UP in gre_output() correctly. 2007-08-14 13:36:50 +00:00
dyoung
3aa180f03a As a stopgap measure to avoid dependency on net/if.h, don't use
IFNAMSIZ.
2007-08-07 04:59:46 +00:00
dyoung
97ecf3fcfd Constify. bcopy -> memcpy. 2007-08-07 04:41:46 +00:00
dyoung
9ca94f6e09 Use satocsdl() instead of SDL(). 2007-08-07 04:41:15 +00:00
dyoung
846a5ed688 Use satocsdl() instead of SDL(). bcopy -> memcpy. 2007-08-07 04:39:34 +00:00
dyoung
e3b7db6399 Constify. 2007-08-07 04:37:44 +00:00
dyoung
59d43281b6 Use sockaddr_dl_measure() and sockaddr_dl_init(). Erase unnecessary
cast.
2007-08-07 04:27:44 +00:00
dyoung
1cf606d23a In if_alloc_sadl(), use sockaddr_dl_init() and satocsdl(). Introduce
variable 'mask' for the netmask, and use it instead of assigning
to 'sdl' twice.

In ifa_ifwithnet(), use satocsdl().
2007-08-07 04:14:37 +00:00
dyoung
04d14f227e Lengthen sockaddr_dl so that a 16-byte FireWire address will fit
into sdl_data[].

Move the macro satocsdl() to net/if_dl.h, and introduce satosdl().

Add some helpers for initializing sockaddr_dl (sockaddr_dl_init),
for finding out the length to put in a sockaddr_dl's sdl_len member
(sockaddr_dl_measure), and for setting the link-layer address in
a sockaddr_dl to a new value (sockaddr_dl_setaddr).

Make sockaddr_copy() panic if the caller tries to copy a sockaddr
to a destination where it will not fit.
2007-08-07 04:06:20 +00:00
yamt
cf51ee04a5 don't forget to maintain ama_addrs. reported by Coverity via Arnaud Lacombe. 2007-08-02 12:37:47 +00:00
yamt
5e1e651c3e agrport_mc_del_callback: s/SIOCADDMULTI/SIOCDELMULTI/ 2007-08-02 12:34:23 +00:00
dyoung
edc2327d04 Cosmetic: remove superfluous parentheses. Compare pointers with
NULL instead of testing "truth."  Remove unnecessary casts to void*
in memset() calls.
2007-07-21 03:12:10 +00:00
dyoung
49412ed4f9 Use NULL instead of 0 for null pointers. 2007-07-21 02:24:11 +00:00
dyoung
08e6f22226 Take steps to hide the radix_node implementation of the forwarding table
from the forwarding table's users:

        Introduce rt_walktree() for walking the routing table and
        applying a function to each rtentry.  Replace most
        rn_walktree() calls with it.

        Use rt_getkey()/rt_setkey() to get/set a route's destination.
        Keep a pointer to the sockaddr key in the rtentry, so that
        rtentry users do not have to grovel in the radix_node for
        the key.

        Add a RTM_GET method to rtrequest.  Use that instead of
        radix_node lookups in, e.g., carp(4).

Add sys/net/link_proto.c, which supplies sockaddr routines for
link-layer socket addresses (sockaddr_dl).

Cosmetic:

        Constify.  KNF.  Stop open-coding LIST_FOREACH, TAILQ_FOREACH,
        et cetera.  Use NULL instead of 0 for null pointers.  Use
        __arraycount().  Reduce gratuitous parenthesization.

        Stop using variadic arguments for rip6_output(), it is
        unnecessary.

        Remove the unnecessary rtentry member rt_genmask and the
        code to maintain it, since nothing actually used it.

        Make rt_maskedcopy() easier to read by using meaningful variable
        names.

        Extract a subroutine intern_netmask() for looking up a netmask in
        the masks table.

        Start converting backslash-ridden IPv6 macros in
        sys/netinet6/in6_var.h into inline subroutines that one
        can read without special eyeglasses.

One functional change: when the kernel serves an RTM_GET, RTM_LOCK,
or RTM_CHANGE request, it applies the netmask (if supplied) to a
destination before searching for it in the forwarding table.

I have changed sys/netinet/ip_carp.c, carp_setroute(), to remove
the unlawful radix_node knowledge.

Apart from the changes to carp(4), netiso, ATM, and strip(4), I
have run the changes on three nodes in my wireless routing testbed,
which involves IPv4 + IPv6 dynamic routing acrobatics, and it's
working beautifully so far.
2007-07-19 20:48:52 +00:00
ad
bba99c25aa Generic soft interrupts are mandatory. 2007-07-14 21:02:36 +00:00
dyoung
690f9353c0 Cosmetic: KNF. Shorten a staircase. 2007-07-12 04:28:59 +00:00
xtraeme
746fb9e8e8 Replace a simple lock with a mutex and make it static (as it's only used
on this file). Ok by ad@.
2007-07-11 21:26:53 +00:00
dyoung
911c7b0317 Cosmetic: KNF. 2007-07-11 00:53:14 +00:00
ad
88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
scw
2346befecc If the underlying link's MTU is less than PP_MTU (e.g. PPPoE), set our
MRU to the link's MTU and initiate an MRU negotiation with the peer.

This is useful when the PPP session is bridged from Ethernet to ATM
by an ADSL modem (such as the Linksys AM200). Unless we negotiate the
lower MRU, the peer is unaware that 1500-byte packets will not make
it umolested across the link (the Linksys AM200 silently truncates them
to 1498 bytes, creating a nice PMTU blackhole).

Note that the PPP RFC says peers MUST accept 1500 byte packets,
regardless of the negotiated MRU, so most ISPs which use PPPoA will
probably still send 1500-byte packets. However, I persuaded my ISP
(Andrews and Arnold) to modify their software to generate an ICMP error
"fragment needed" for packets with IP.DF set which are larger than the
negotiated MRU. They will still forward non-IP.DF packets, with the
associated truncation, but at least my PMTU troubles have gone.
2007-06-23 08:45:25 +00:00
dyoung
cb3da2abc3 Remove unnecessary __UNCONST(). 2007-06-13 05:08:02 +00:00
dyoung
95edb940c2 Get rid of radix_node_head.rnh_walktree, because it is only ever
set to rn_walktree.

Introduce rt_walktree(), which applies a subroutine to every route
in a particular address family.  Use it instead of rn_walktree()
virtually everywhere.  This helps to hide the routing table
implementation.
2007-06-09 03:07:21 +00:00
christos
89734304c6 - fix unused variable when none of the compat options are defined.
- remove debugging
2007-06-01 15:41:15 +00:00
enami
723ff30abc Fix some bugs in ifconf():
- maintain space left correctly.  the pointer is advanced by the size
  of struct ifreq when length of address is small.
- single sizeof operator is enough to take the size of struct.
- the type of `sz' must be singed type since it is/was compared against to
  the variable which may become negative.
- no need to traverse rest of interfaces once we got an error.  note that
  the latter `break' statement was inside inner loop.
2007-06-01 09:35:47 +00:00
christos
f6ca3502bf provide the minimum ifreq size (when sockaddr is empty) 2007-05-31 02:56:50 +00:00
christos
d81aadc176 Move the nasty ifdefs in one place. Requested by ad and dyoung. 2007-05-30 21:02:02 +00:00
christos
781021f65e fix unused variable. 2007-05-29 23:32:41 +00:00
xtraeme
967c5e0168 Initialize oifr to fix build with COMPAT_40. 2007-05-29 22:05:01 +00:00
christos
20bfd9898e Add a sockaddr_storage member to "struct ifreq" maintaining backwards
compatibility with the older ioctls. This avoids stack smashing and
abuse of "struct sockaddr" when ioctls placed "struct sockaddr_foo's" that
were longer than "struct sockaddr".
XXX: Some of the emulations might be broken; I tried to add code for
them but I did not test them.
2007-05-29 21:32:27 +00:00
yamt
a5e5b20e90 use mutex. 2007-05-20 07:57:03 +00:00
christos
885ed2ab13 return POLLERR instead of ENXIO since we are expecting an revents mask not
an errno.
2007-05-17 18:01:57 +00:00
dyoung
752b247e01 Cosmetic: make the macro 'equal' into an inline subroutine, bcmp
-> memcmp, bcopy -> memcpy, 0 -> NULL, shorten staircases, remove
needless cast to int.
2007-05-06 06:21:26 +00:00
dyoung
d9b62cfaed Switch from spl(9) to mutex(9) and condvar(9).
Fix a defect in the locking of file descriptors as we delegate a
UDP socket from userland to the kernel.  Move sc_fp out of sc_soparm.
Synchronize access to sc_fp by gre_ioctl() and the kernel thread
using a condition variable.  For simplicity's sake, make it the
kernel helper thread's responsibility to close its UDP socket.
2007-05-06 02:47:52 +00:00
dyoung
680f00f8b5 Factor rtcache_lookup2() out of rtcache_lookup1(), for re-use in
the IPv6 stack.  rtcache_lookup2() takes an int * argument that it
writes with 1 if we had a cache 'hit', 0 if there was a cache
'miss'.
2007-05-06 02:17:54 +00:00
dyoung
f650cb5d03 Free the route cache after detaching the interface w/ if_detach()
instead of before, because if_detach() may cause the cache to be
reloaded.  (I already fixed this in both etherip(4) and gre(4).
Ewww, rampant code duplication.)
2007-05-06 02:15:34 +00:00
yamt
3c8e37e03e agrether_hashmbuf: feed ipv6 flowlabel to hash calculation. 2007-05-05 18:23:23 +00:00
dyoung
72f0a6dfb0 Eliminate address family-specific route caches (struct route, struct
route_in6, struct route_iso), replacing all caches with a struct
route.

The principle benefit of this change is that all of the protocol
families can benefit from route cache-invalidation, which is
necessary for correct routing.  Route-cache invalidation fixes an
ancient PR, kern/3508, at long last; it fixes various other PRs,
also.

Discussions with and ideas from Joerg Sonnenberger influenced this
work tremendously.  Of course, all design oversights and bugs are
mine.

DETAILS

1 I added to each address family a pool of sockaddrs.  I have
  introduced routines for allocating, copying, and duplicating,
  and freeing sockaddrs:

        struct sockaddr *sockaddr_alloc(sa_family_t af, int flags);
        struct sockaddr *sockaddr_copy(struct sockaddr *dst,
                                       const struct sockaddr *src);
        struct sockaddr *sockaddr_dup(const struct sockaddr *src, int flags);
        void sockaddr_free(struct sockaddr *sa);

  sockaddr_alloc() returns either a sockaddr from the pool belonging
  to the specified family, or NULL if the pool is exhausted.  The
  returned sockaddr has the right size for that family; sa_family
  and sa_len fields are initialized to the family and sockaddr
  length---e.g., sa_family = AF_INET and sa_len = sizeof(struct
  sockaddr_in).  sockaddr_free() puts the given sockaddr back into
  its family's pool.

  sockaddr_dup() and sockaddr_copy() work analogously to strdup()
  and strcpy(), respectively.  sockaddr_copy() KASSERTs that the
  family of the destination and source sockaddrs are alike.

  The 'flags' argumet for sockaddr_alloc() and sockaddr_dup() is
  passed directly to pool_get(9).

2 I added routines for initializing sockaddrs in each address
  family, sockaddr_in_init(), sockaddr_in6_init(), sockaddr_iso_init(),
  etc.  They are fairly self-explanatory.

3 structs route_in6 and route_iso are no more.  All protocol families
  use struct route.  I have changed the route cache, 'struct route',
  so that it does not contain storage space for a sockaddr.  Instead,
  struct route points to a sockaddr coming from the pool the sockaddr
  belongs to.  I added a new method to struct route, rtcache_setdst(),
  for setting the cache destination:

        int rtcache_setdst(struct route *, const struct sockaddr *);

  rtcache_setdst() returns 0 on success, or ENOMEM if no memory is
  available to create the sockaddr storage.

  It is now possible for rtcache_getdst() to return NULL if, say,
  rtcache_setdst() failed.  I check the return value for NULL
  everywhere in the kernel.

4 Each routing domain (struct domain) has a list of live route
  caches, dom_rtcache.  rtflushall(sa_family_t af) looks up the
  domain indicated by 'af', walks the domain's list of route caches
  and invalidates each one.
2007-05-02 20:40:22 +00:00
dyoung
7ff356f18d Free route cache after detaching an etherip(4) instance. 2007-04-23 05:05:03 +00:00
xtraeme
df40909241 rtcache_clear is defined as static void in route.c, but it's used
in netinet/in_route.c. Move the prototype into route.h to fix
the build.
2007-04-22 13:05:21 +00:00
dyoung
3ce5c94b0e In gre_clone_destroy(), free the route cache after calling if_detach(),
because if_detach() may cause us to transmit a packet, which
ordinarily entails reloading the route cache.  This fixes a bug
where the kernel would panic later in rtflush().  Thanks Michael
Earnhart for reporting the bug.

In gre_output(), do not leak mbufs.
2007-04-14 22:41:42 +00:00
martin
de3603e82a caddr_t fallout (only visible with options PPPOE_SERVER) 2007-03-31 11:00:23 +00:00
ad
9982390dd6 lwp::l_acflag is no longer used. 2007-03-29 16:51:21 +00:00
dyoung
be7bb25d74 Make all debug messages use GRE_DPRINTF(). Get rid of a redundant
if_ierrors++.  Change (type *)0 to NULL.  Get rid of unnecessary
casts to void *.
2007-03-21 03:18:08 +00:00
dyoung
271d77fa58 If we do not recognize the protocol of a received packet, then
increase ifi_noproto.  If the GRE header contains routing options,
increase the input-error count, ifi_ierrors.

While I am here, make some cosmetic changes: remove unnecessary
'proto' argument from gre_input3().  Shorten some staircases.
2007-03-21 01:56:05 +00:00
dyoung
cafee584b5 KNF: compare pointers with NULL instead of 0, and do not "test
truth" of either integers or pointers, so that it's clear
     what's going on.  Remove superfluous () from return statements.
     bcmp -> memcmp, bcopy -> memcpy.

Misc. cosmetic: join some lines, remove a few empty lines, remove
spaces from type casts.  Don't open-code IFNET_FOREACH().  Shorten
some staircases.
2007-03-18 20:59:38 +00:00
dyoung
912b6eb53e The departure of IPv6 interfaces does not agree with pf. The pfil
hooks that signal the interface's departure run before IPv6 sends
messages to indicate that it is leaving its multicast groups; when
pf filters the departure messages, it does not recognize the output
interface, so it complains at the departure of gre65, for example:

pf_test6: kif == NULL, if_xname gre65

I have changed if_detach() so that it calls pr_usrreq(PRU_PURGEIF)
before pfil_run_hooks(PFIL_IFNET_DETACH), instead of the other way
around.  That quiets the pf_test6: messages.
2007-03-18 20:05:52 +00:00
dyoung
72d41408ef bcopy -> memcpy, bcmp -> memcmp.
Don't open-code LIST_FOREACH().
2007-03-17 06:36:05 +00:00
ad
59d979c5f1 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-12 18:18:22 +00:00
drochner
814e248430 don't use DVUNIT_ANY as unit number to attach pseudo devices,
use FSTATE_STAR and cf_unit=0 like normal devices.
Thanks to Arnaud Degroote for the bug report and testing.
2007-03-09 18:42:22 +00:00
liamjfoy
8aa640dadd Add IPv6 Fast Forward - the IPv4 counterpart:
If ip6_forward successfully forwards a packet, a cache, in this case a
ip6flow struct entry, will be created. ether_input and friends will
then be able to call ip6flow_fastforward with the packet which will then
be passed to if_output (unless an issue is found - in that case the packet
is passed back to ip6_input).

ok matt@ christos@ dyoung@ and joerg@
2007-03-07 22:20:04 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
cube
f361d6e858 Remove unnecessary output and reduce verbosity in dmesg(8) output. That
makes the output consistent with etherip(4).

Suggested by Nino Dehne on current-users@.
2007-02-26 23:52:18 +00:00
dyoung
6a5d57a4de In gif_clone_destroy(), free the cached route before freeing the
interface.
2007-02-23 06:15:31 +00:00
dyoung
2bc5758505 Cosmetic: remove gratuitous () from return statements. 2007-02-23 06:13:24 +00:00
dyoung
6917e4364d If we enter gre_output() without a route in the cache, call
rtcache_init() to try to fill the cache.  rtcache_check() was not
sufficient.
2007-02-23 06:10:40 +00:00
dyoung
9020519740 Destroy route cache before destroying the interface. 2007-02-23 04:20:02 +00:00
dyoung
fea99925e4 Cosmetic: use TAILQ_EMPTY, TAILQ_FOREACH. 2007-02-22 09:23:38 +00:00
thorpej
7cc07e11dc TRUE -> true, FALSE -> false 2007-02-22 06:16:03 +00:00
thorpej
712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
dyoung
58cb526fa7 Use __arraycount(). 2007-02-21 02:24:14 +00:00
dyoung
af8be3e751 Remove extraneous parentheses. bcopy -> memcpy. 2007-02-20 08:55:54 +00:00
dyoung
818fe8ed7b Remove unused #define SIN.
Constify.
2007-02-20 08:32:14 +00:00
dyoung
b700519db9 Remove unused #define SIN(). From he@. 2007-02-19 21:18:23 +00:00
dyoung
ba2aee81a0 Fix fallout from if_output constification. Thanks, Havard Eidnes,
for reporting the problem and testing my patch.
2007-02-19 21:17:03 +00:00
matt
58aa85753d Initialize routeswitch with structure initializers. 2007-02-18 22:46:32 +00:00
dyoung
3365b046ad Use satocsin to cast to const struct sockaddr_in *. 2007-02-18 07:17:48 +00:00
dogcow
27a0c93811 constify struct sockaddr. 2007-02-18 06:20:10 +00:00
dyoung
5493f188c7 KNF: de-__P, bzero -> memset, bcmp -> memcmp. Remove extraneous
parentheses in return statements.

Cosmetic: don't open-code TAILQ_FOREACH().

Cosmetic: change types of variables to avoid oodles of casts: in
   in6_src.c, avoid casts by changing several route_in6 pointers
   to struct route pointers.  Remove unnecessary casts to caddr_t
   elsewhere.

Pave the way for eliminating address family-specific route caches:
   soon, struct route will not embed a sockaddr, but it will hold
   a reference to an external sockaddr, instead.  We will set the
   destination sockaddr using rtcache_setdst().  (I created a stub
   for it, but it isn't used anywhere, yet.)  rtcache_free() will
   free the sockaddr.  I have extracted from rtcache_free() a helper
   subroutine, rtcache_clear().  rtcache_clear() will "forget" a
   cached route, but it will not forget the destination by releasing
   the sockaddr.  I use rtcache_clear() instead of rtcache_free()
   in rtcache_update(), because rtcache_update() is not supposed
   to forget the destination.

Constify:

   1 Introduce const accessor for route->ro_dst, rtcache_getdst().

   2 Constify the 'dst' argument to ifnet->if_output().  This
     led me to constify a lot of code called by output routines.

   3 Constify the sockaddr argument to protosw->pr_ctlinput.  This
     led me to constify a lot of code called by ctlinput routines.

   4 Introduce const macros for converting from a generic sockaddr
     to family-specific sockaddrs, e.g., sockaddr_in: satocsin6,
     satocsin, et cetera.
2007-02-17 22:34:07 +00:00
dyoung
3267be0b29 Cosmetic: don't open-code LIST_FOREACH(). Remove extraneous
parentheses.  Bzero -> memset.  Shorten staircase in rt_timer_add().
2007-02-17 07:50:49 +00:00
dyoung
7cfeb3c2ed Clean this code up some.
Extract subroutine rn_delete1() to ease RADIX_MPATH integration,
should we ever do that.

Remove RN_DEBUG code that does not compile.

Join some lines of the type

        type var1;
        type var2;
        type var3;

making

        type var1, var2, var3.

Break lines of the type if (expr) stmt1; else stmt2; so that normal
people can read them.
2007-02-17 07:46:38 +00:00
bouyer
53bfe8e81c Drop M_PROMISC before passing the packet to a carp device, for the same
reason it's dropped before passing to bridge: when a vlan interface is
in promisc mode, it will loop the packet back to ether_input() with
M_PROMISC set, and when carp calls ether_input again the flag is still
there and the packet is dropped. If the carp interface doesn't take
the packet M_PROMISC is set just after is needed anyway.
Tested on a box with multiple carp on vlans, no comments about this patch
on tech-net@
2007-01-29 22:13:14 +00:00
cbiere
bcfa6c3c08 Use be16dec() and be32dec() instead of reimplementing them. 2007-01-27 07:16:01 +00:00
cbiere
6b77c2af74 Use a plain memcpy() instead of alignment- and endian-specific hacks. 2007-01-27 07:12:16 +00:00
dyoung
2115f7da2f Fix the check for a routing loop. 2007-01-26 19:32:32 +00:00
dyoung
832c31b2c6 Mark some shared variables as volatile. 2007-01-26 03:01:32 +00:00
isaki
7525ed1e40 Install <net/if_pflog.h>. 2007-01-13 14:13:53 +00:00
mouse
8fb29141e0 Hook srt into the rest of the kernel build machinery, so it works to
just uncomment the pseudo-device line (which arguably should go into
other ports' GENERICs too, and at some point may).

OKed by perry.
2007-01-11 05:36:29 +00:00
bouyer
9403f4d239 Don't define dropanyway: label unless ISO or NETATALK is defined. Fix
kern/35364 by Gene ENonymous
2007-01-06 20:38:14 +00:00
joerg
8632294e2e Add a debug option for the route cache to help tracing down issues
like PR 35272 and 35318. When the kernel is compiled with
-DRTCACHE_DEBUG, all rtcache entries are logged to a list with the place
they got initialised. This allows overwrites, double inits and other
manual messing to be detected.
2007-01-05 16:40:08 +00:00
mouse
9707fdff94 Add workarounds for include-file bugs exposed by this file. (Ideal, of
course, would be to fix the include-file bugs; that may follow later.)
2007-01-05 06:32:48 +00:00
elad
b2eb9a5389 Consistent usage of KAUTH_GENERIC_ISSUSER. 2007-01-04 19:07:03 +00:00
wiz
0b5301abc7 Add RCS Id. 2006-12-29 10:39:59 +00:00
mouse
ebc746c114 Very first import of the source-address-based routing pseudo-device,
before any cleanup at all, per discussion with perry@.
2006-12-29 04:20:14 +00:00
joerg
eb04733c4e Introduce new helper functions to abstract the route caching.
rtcache_init and rtcache_init_noclone lookup ro_dst and store
the result in ro_rt, taking care of the reference counting and
calling the domain specific route cache.
rtcache_free checks if a route was cashed and frees the reference.
rtcache_copy copies ro_dst of the given struct route, checking that
enough space is available and incrementing the reference count of the
cached rtentry if necessary.
rtcache_check validates that the cached route is still up. If it isn't,
it tries to look it up again. Afterwards ro_rt is either a valid again
or NULL.
rtcache_copy is used internally.

Adjust to callers of rtalloc/rtflush in the tree to check the sanity of
ro_dst first (if necessary). If it doesn't fit the expectations, free
the cache, otherwise check if the cached route is still valid. After
that combination, a single check for ro_rt == NULL is enough to decide
whether a new lookup needs to be done with a different ro_dst.
Make the route checking in gre stricter by repeating the loop check
after revalidation.
Remove some unused RADIX_MPATH code in in6_src.c. The logic is slightly
changed here to first validate the route and check RTF_GATEWAY
afterwards. This is sementically equivalent though.
etherip doesn't need sc_route_expire similiar to the gif changes from
dyoung@ earlier.

Based on the earlier patch from dyoung@, reviewed and discussed with
him.
2006-12-15 21:18:52 +00:00
christos
5abf774808 initialize error, cause gcc3 says so. 2006-12-10 23:12:37 +00:00
is
dc12fff4c3 Explain XID magic constants, correcting the format ID 2006-12-10 14:52:29 +00:00
is
8812d0414b oops, forgot lan_hdr_len length offset 2006-12-10 14:49:43 +00:00
is
e80820a117 oops, forgot the m_adj 2006-12-10 14:47:40 +00:00
is
9c9b34873f was wrong magic constant. no functional change. 2006-12-10 14:45:09 +00:00
is
d227658f6b Avoid overlapping struct assignment, like in the Ethernet and FDDI cases. 2006-12-10 14:39:03 +00:00
is
60ee96c865 Explain llc XID magic constants, correcting the XID header format tag. 2006-12-10 14:21:32 +00:00