History log of /src/sys/netatalk/at_proto.c |
Revision | | Date | Author | Comments |
1.23 |
| 03-Sep-2022 |
thorpej | Convert NETATALK from a legacy netisr to pktqueue.
|
1.22 |
| 21-Sep-2017 |
ozaki-r | Invalidate rtcache based on a global generation counter
The change introduces a global generation counter that is incremented when any routes have been added or deleted. When a rtcache caches a rtentry into itself, it also stores a snapshot of the generation counter. If the snapshot equals to the global counter, the cache is still valid, otherwise invalidated.
One drawback of the change is that all rtcaches of all protocol families are invalidated when any routes of any protocol families are added or deleted. If that matters, we should have separate generation counters based on protocol families.
This change removes LIST_ENTRY from struct route, which fixes a part of PR kern/52515.
|
1.21 |
| 21-Jan-2016 |
riastradh | branches: 1.21.10; Revert previous: ran cvs commit when I meant cvs diff. Sorry!
Hit up-arrow one too few times.
|
1.20 |
| 21-Jan-2016 |
riastradh | Give proper prototype to ip_output.
|
1.19 |
| 20-Jan-2016 |
riastradh | Eliminate struct protosw::pr_output.
You can't use this unless you know what it is a priori: the formal prototype is variadic, and the different instances (e.g., ip_output, route_output) have different real prototypes.
Convert the only user of it, raw_send in net/raw_cb.c, to take an explicit callback argument. Convert the only instances of it, route_output and key_output, to such explicit callbacks for raw_send. Use assertions to make sure the conversion to explicit callbacks is warranted.
Discussed on tech-net with no objections: https://mail-index.netbsd.org/tech-net/2016/01/16/msg005484.html
|
1.18 |
| 18-May-2014 |
rmind | branches: 1.18.4; Add struct pr_usrreqs with a pr_generic function and prepare for the dismantling of pr_usrreq in the protocols; no functional change intended. PRU_ATTACH/PRU_DETACH changes will follow soon.
Bump for struct protosw. Welcome to 6.99.62!
|
1.17 |
| 31-Mar-2011 |
dyoung | branches: 1.17.14; 1.17.18; 1.17.28; Hide the radix-trie implementation of the forwarding table so that we will have an easier time replacing it with something different, even if it is a second radix-trie implementation.
sys/net/route.c and sys/net/rtsock.c no longer operate directly on radix_nodes or radix_node_heads.
Hopefully this will reduce the temptation to implement multipath or source-based routing using grotty hacks to the grotty old radix-trie code, too. :-)
|
1.16 |
| 24-Apr-2008 |
ad | branches: 1.16.24; 1.16.30; Merge the socket locking patch:
- Socket layer becomes MP safe. - Unix protocols become MP safe. - Allows protocol processing interrupts to safely block on locks. - Fixes a number of race conditions.
With much feedback from matt@ and plunky@.
|
1.15 |
| 30-Aug-2007 |
dyoung | branches: 1.15.20; 1.15.22; 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.
|
1.14 |
| 06-May-2007 |
dyoung | branches: 1.14.2; 1.14.6; 1.14.8; In AppleTalk, IPv4, and IPv6 routing domains, help sockaddr_cmp() avoid an indirect function call by comparing the family, length, and bytes [dom->dom_sa_cmpofs, dom->dom_sa_cmpofs + dom->dom_sa_cmplen), corresponding to the the sockaddrs' "address" members.
For ISO, actually use sockaddr_iso_cmp, for a change. Thanks to yamt@ for pointing out my error.
|
1.13 |
| 02-May-2007 |
dyoung | 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.
|
1.12 |
| 18-Feb-2007 |
matt | branches: 1.12.4; 1.12.6; Convert atalksw to structure initializers.
|
1.11 |
| 09-Dec-2006 |
dyoung | branches: 1.11.2; Here are various changes designed to protect against bad IPv4 routing caused by stale route caches (struct route). Route caches are sprinkled throughout PCBs, the IP fast-forwarding table, and IP tunnel interfaces (gre, gif, stf).
Stale IPv6 and ISO route caches will be treated by separate patches.
Thank you to Christoph Badura for suggesting the general approach to invalidating route caches that I take here.
Here are the details:
Add hooks to struct domain for tracking and for invalidating each domain's route caches: dom_rtcache, dom_rtflush, and dom_rtflushall.
Introduce helper subroutines, rtflush(ro) for invalidating a route cache, rtflushall(family) for invalidating all route caches in a routing domain, and rtcache(ro) for notifying the domain of a new cached route.
Chain together all IPv4 route caches where ro_rt != NULL. Provide in_rtcache() for adding a route to the chain. Provide in_rtflush() and in_rtflushall() for invalidating IPv4 route caches. In in_rtflush(), set ro_rt to NULL, and remove the route from the chain. In in_rtflushall(), walk the chain and remove every route cache.
In rtrequest1(), call rtflushall() to invalidate route caches when a route is added.
In gif(4), discard the workaround for stale caches that involves expiring them every so often.
Replace the pattern 'RTFREE(ro->ro_rt); ro->ro_rt = NULL;' with a call to rtflush(ro).
Update ipflow_fastforward() and all other users of route caches so that they expect a cached route, ro->ro_rt, to turn to NULL.
Take care when moving a 'struct route' to rtflush() the source and to rtcache() the destination.
In domain initializers, use .dom_xxx tags.
KNF here and there.
|
1.10 |
| 10-Oct-2006 |
dogcow | change the MOWNER_INIT define to take two args; fix extant struct mowner decls to use it. Makes options MBUFTRACE compile again and not whinge about missing structure declarations. (Also makes initialization consistent.)
|
1.9 |
| 27-Aug-2006 |
christos | branches: 1.9.2; 1.9.4; Fix initializers
|
1.8 |
| 25-Aug-2006 |
matt | One step closer to loadable domains. Store pointers to a domain's soft interrupt queues so if_detach can remove packets to removed interfaces from them. This eliminates a lot of conditional ugly code in if.c
|
1.7 |
| 11-Dec-2005 |
christos | branches: 1.7.4; 1.7.8; merge ktrace-lwp.
|
1.6 |
| 23-Jan-2005 |
matt | branches: 1.6.8; Commit missing files with domain list sets.
|
1.5 |
| 22-Apr-2004 |
matt | branches: 1.5.4; Constify protosw arrays. This can reduce the kernel .data section by over 4K (if all the network protocols) are loaded.
|
1.4 |
| 15-Nov-2001 |
lukem | branches: 1.4.16; don't need <sys/types.h> when including <sys/param.h>
|
1.3 |
| 13-Nov-2001 |
lukem | add RCSIDs
|
1.2 |
| 14-Jan-1999 |
thorpej | branches: 1.2.20; 1.2.22; Domains are associated with protocol families, not address families.
|
1.1 |
| 02-Apr-1997 |
christos | Appletalk networking stack. Code based on netatalk release beta-970220 from toccata.fugue.com. Ported to netbsd by Bill Studenmund. Changes: - KNF - remove endian.h - adapt to the new arp code. - fix small biff's with spl/splx.
|
1.2.22.1 |
| 10-Jan-2002 |
thorpej | Sync kqueue branch with -current.
|
1.2.20.2 |
| 08-Jan-2002 |
nathanw | Catch up to -current.
|
1.2.20.1 |
| 14-Nov-2001 |
nathanw | Catch up to -current.
|
1.4.16.4 |
| 24-Jan-2005 |
skrll | Sync with HEAD.
|
1.4.16.3 |
| 21-Sep-2004 |
skrll | Fix the sync with head I botched.
|
1.4.16.2 |
| 18-Sep-2004 |
skrll | Sync with HEAD.
|
1.4.16.1 |
| 03-Aug-2004 |
skrll | Sync with HEAD
|
1.5.4.1 |
| 29-Apr-2005 |
kent | sync with -current
|
1.6.8.3 |
| 03-Sep-2007 |
yamt | sync with head.
|
1.6.8.2 |
| 26-Feb-2007 |
yamt | sync with head.
|
1.6.8.1 |
| 30-Dec-2006 |
yamt | sync with head.
|
1.7.8.1 |
| 03-Sep-2006 |
yamt | sync with head.
|
1.7.4.1 |
| 09-Sep-2006 |
rpaulo | sync with head
|
1.9.4.2 |
| 10-Dec-2006 |
yamt | sync with head.
|
1.9.4.1 |
| 22-Oct-2006 |
yamt | sync with head
|
1.9.2.2 |
| 12-Jan-2007 |
ad | Sync with head.
|
1.9.2.1 |
| 18-Nov-2006 |
ad | Sync with head.
|
1.11.2.2 |
| 07-May-2007 |
yamt | sync with head.
|
1.11.2.1 |
| 27-Feb-2007 |
yamt | - sync with head. - move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
|
1.12.6.1 |
| 11-Jul-2007 |
mjf | Sync with head.
|
1.12.4.2 |
| 09-Oct-2007 |
ad | Sync with head.
|
1.12.4.1 |
| 08-Jun-2007 |
ad | Sync with head.
|
1.14.8.1 |
| 06-Nov-2007 |
matt | sync with HEAD
|
1.14.6.1 |
| 03-Sep-2007 |
jmcneill | Sync with HEAD.
|
1.14.2.1 |
| 03-Sep-2007 |
skrll | Sync with HEAD.
|
1.15.22.1 |
| 18-May-2008 |
yamt | sync with head.
|
1.15.20.1 |
| 02-Jun-2008 |
mjf | Sync with HEAD.
|
1.16.30.1 |
| 06-Jun-2011 |
jruoho | Sync with HEAD.
|
1.16.24.1 |
| 21-Apr-2011 |
rmind | sync with head
|
1.17.28.1 |
| 10-Aug-2014 |
tls | Rebase.
|
1.17.18.1 |
| 28-Aug-2013 |
rmind | Checkpoint work in progress: - Initial split of the protocol user-request method into the following methods: pr_attach, pr_detach and pr_generic for old the pr_usrreq. - Adjust socreate(9) and sonewconn(9) to call pr_attach without the socket lock held (as a preparation for the locking scheme adjustment). - Adjust all pr_attach routines to assert that PCB is not set. - Sprinkle various comments, document some routines and their locking. - Remove M_PCB, replace with kmem(9). - Fix few bugs spotted on the way.
|
1.17.14.2 |
| 03-Dec-2017 |
jdolecek | update from HEAD
|
1.17.14.1 |
| 20-Aug-2014 |
tls | Rebase to HEAD as of a few days ago.
|
1.18.4.1 |
| 19-Mar-2016 |
skrll | Sync with HEAD
|
1.21.10.1 |
| 24-Oct-2017 |
snj | Pull up following revision(s) (requested by ozaki-r in ticket #305): distrib/sets/lists/tests/mi: revision 1.762 sys/net/route.c: revision 1.198-1.201 sys/net/route.h: revision 1.114 sys/netatalk/at_proto.c: revision 1.22 sys/netinet/in_proto.c: revision 1.124 sys/netinet6/in6_proto.c: revision 1.118 sys/netmpls/mpls_proto.c: revision 1.31 sys/netnatm/natm_proto.c: revision 1.18 sys/rump/net/lib/libsockin/sockin.c: revision 1.65 sys/sys/domain.h: revision 1.33 tests/net/route/Makefile: revision 1.6 tests/net/route/t_rtcache.sh: revision 1.1 Add tests of rtcache invalidation Remove unnecessary NULL check of rt_ifp It's always non-NULL. Invalidate rtcache based on a global generation counter The change introduces a global generation counter that is incremented when any routes have been added or deleted. When a rtcache caches a rtentry into itself, it also stores a snapshot of the generation counter. If the snapshot equals to the global counter, the cache is still valid, otherwise invalidated. One drawback of the change is that all rtcaches of all protocol families are invalidated when any routes of any protocol families are added or deleted. If that matters, we should have separate generation counters based on protocol families. This change removes LIST_ENTRY from struct route, which fixes a part of PR kern/52515. Remove the global lock for rtcache Thanks to removal of LIST_ENTRY of struct route, rtcaches are accessed only by their users. And in existing usages a rtcache is guranteed to be not accessed simultaneously. So the rtcache framework doesn't need any exclusion controls in itself. Synchronize on rtcache_generation with rtlock It's racy if NET_MPSAFE is enabled. Pointed out by joerg@
|