summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/nd6.c
Commit message (Collapse)AuthorAgeFilesLines
* For all files including net/vnet.h directly include opt_route.h andbz2009-02-271-0/+1
| | | | | | | | | | | | | | net/route.h. Remove the hidden include of opt_route.h and net/route.h from net/vnet.h. We need to make sure that both opt_route.h and net/route.h are included before net/vnet.h because of the way MRT figures out the number of FIBs from the kernel option. If we do not, we end up with the default number of 1 when including net/vnet.h and array sizes are wrong. This does not change the list of files which depend on opt_route.h but we can identify them now more easily.
* Shuffle the vimage.h includes or add where missing.bz2009-02-271-1/+1
|
* Remove unused local MACROs.bz2009-01-311-1/+0
| | | | | Submitted by: Christoph Mallon christoph.mallon@gmx.de MFC after: 2 weeks
* in6_clsroute() was applied to prefix routes causing someqingli2008-12-171-10/+9
| | | | | | of them to expire. in6_clsroute() was only applied to cloned routes that are no longer applicable after the arp-v2 commit.
* - Simplify handling of the deferring of mbuf transmit until after lle lock dropkmacy2008-12-161-12/+28
| | | | - add a couple of comments to clarify intent
* convert more pointer validation checks to checking against NULLkmacy2008-12-161-2/+2
|
* explicitly check return of lla_lookup against NULLkmacy2008-12-161-5/+5
|
* advance tail pointer in nd6_output_lle and check lla_output return against NULLkmacy2008-12-161-4/+8
|
* Initialize the variable "router", and apply "static_route" flagqingli2008-12-161-4/+7
| | | | across the entire nd6_cache_lladdr() function.
* fix two use after frees in nd6_cache_lladdr caused by last minute unlock ↵kmacy2008-12-161-2/+6
| | | | shuffling
* This main goals of this project are:qingli2008-12-151-648/+393
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. separating L2 tables (ARP, NDP) from the L3 routing tables 2. removing as much locking dependencies among these layers as possible to allow for some parallelism in the search operations 3. simplify the logic in the routing code, The most notable end result is the obsolescent of the route cloning (RTF_CLONING) concept, which translated into code reduction in both IPv4 ARP and IPv6 NDP related modules, and size reduction in struct rtentry{}. The change in design obsoletes the semantics of RTF_CLONING, RTF_WASCLONE and RTF_LLINFO routing flags. The userland applications such as "arp" and "ndp" have been modified to reflect those changes. The output from "netstat -r" shows only the routing entries. Quite a few developers have contributed to this project in the past: Glebius Smirnoff, Luigi Rizzo, Alessandro Cerri, and Andre Oppermann. And most recently: - Kip Macy revised the locking code completely, thus completing the last piece of the puzzle, Kip has also been conducting active functional testing - Sam Leffler has helped me improving/refactoring the code, and provided valuable reviews - Julian Elischer setup the perforce tree for me and has helped me maintaining that branch before the svn conversion
* Conditionally compile out V_ globals while instantiating the appropriatezec2008-12-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | container structures, depending on VIMAGE_GLOBALS compile time option. Make VIMAGE_GLOBALS a new compile-time option, which by default will not be defined, resulting in instatiations of global variables selected for V_irtualization (enclosed in #ifdef VIMAGE_GLOBALS blocks) to be effectively compiled out. Instantiate new global container structures to hold V_irtualized variables: vnet_net_0, vnet_inet_0, vnet_inet6_0, vnet_ipsec_0, vnet_netgraph_0, and vnet_gif_0. Update the VSYM() macro so that depending on VIMAGE_GLOBALS the V_ macros resolve either to the original globals, or to fields inside container structures, i.e. effectively #ifdef VIMAGE_GLOBALS #define V_rt_tables rt_tables #else #define V_rt_tables vnet_net_0._rt_tables #endif Update SYSCTL_V_*() macros to operate either on globals or on fields inside container structs. Extend the internal kldsym() lookups with the ability to resolve selected fields inside the virtualization container structs. This applies only to the fields which are explicitly registered for kldsym() visibility via VNET_MOD_DECLARE() and vnet_mod_register(), currently this is done only in sys/net/if.c. Fix a few broken instances of MODULE_GLOBAL() macro use in SCTP code, and modify the MODULE_GLOBAL() macro to resolve to V_ macros, which in turn result in proper code being generated depending on VIMAGE_GLOBALS. De-virtualize local static variables in sys/contrib/pf/net/pf_subr.c which were prematurely V_irtualized by automated V_ prepending scripts during earlier merging steps. PF virtualization will be done separately, most probably after next PF import. Convert a few variable initializations at instantiation to initialization in init functions, most notably in ipfw. Also convert TUNABLE_INT() initializers for V_ variables to TUNABLE_FETCH_INT() in initializer functions. Discussed at: devsummit Strassburg Reviewed by: bz, julian Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation
* Rather than using hidden includes (with cicular dependencies),bz2008-12-021-0/+2
| | | | | | | | | | | directly include only the header files needed. This reduces the unneeded spamming of various headers into lots of files. For now, this leaves us with very few modules including vnet.h and thus needing to depend on opt_route.h. Reviewed by: brooks, gnn, des, zec, imp Sponsored by: The FreeBSD Foundation
* Change the initialization methodology for global variables scheduledzec2008-11-191-18/+53
| | | | | | | | | | | | | | | | | | | | | | | | for virtualization. Instead of initializing the affected global variables at instatiation, assign initial values to them in initializer functions. As a rule, initialization at instatiation for such variables should never be introduced again from now on. Furthermore, enclose all instantiations of such global variables in #ifdef VIMAGE_GLOBALS blocks. Essentialy, this change should have zero functional impact. In the next phase of merging network stack virtualization infrastructure from p4/vimage branch, the new initialization methology will allow us to switch between using global variables and their counterparts residing in virtualization containers with minimum code churn, and in the long run allow us to intialize multiple instances of such container structures. Discussed at: devsummit Strassburg Reviewed by: bz, julian Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation
* Step 1.5 of importing the network stack virtualization infrastructurezec2008-10-021-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from the vimage project, as per plan established at devsummit 08/08: http://wiki.freebsd.org/Image/Notes200808DevSummit Introduce INIT_VNET_*() initializer macros, VNET_FOREACH() iterator macros, and CURVNET_SET() context setting macros, all currently resolving to NOPs. Prepare for virtualization of selected SYSCTL objects by introducing a family of SYSCTL_V_*() macros, currently resolving to their global counterparts, i.e. SYSCTL_V_INT() == SYSCTL_INT(). Move selected #defines from sys/sys/vimage.h to newly introduced header files specific to virtualized subsystems (sys/net/vnet.h, sys/netinet/vinet.h etc.). All the changes are verified to have zero functional impact at this point in time by doing MD5 comparision between pre- and post-change object files(*). (*) netipsec/keysock.c did not validate depending on compile time options. Implemented by: julian, bz, brooks, zec Reviewed by: julian, bz, brooks, kris, rwatson, ... Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation
* Fix some of the formatting fixes.. It's amazing how some thing stand outjulian2008-08-201-1/+1
| | | | in a commit message.
* A bunch of formatting fixes brough to light by, or created by the Vimage commitjulian2008-08-201-4/+5
| | | | a few days ago.
* Commit step 1 of the vimage project, (network stack)bz2008-08-171-54/+55
| | | | | | | | | | | | | | | | | | | | | | | | virtualization work done by Marko Zec (zec@). This is the first in a series of commits over the course of the next few weeks. Mark all uses of global variables to be virtualized with a V_ prefix. Use macros to map them back to their global names for now, so this is a NOP change only. We hope to have caught at least 85-90% of what is needed so we do not invalidate a lot of outstanding patches again. Obtained from: //depot/projects/vimage-commit2/... Reviewed by: brooks, des, ed, mav, julian, jamie, kris, rwatson, zec, ... (various people I forgot, different versions) md5 (with a bit of help) Sponsored by: NLnet Foundation, The FreeBSD Foundation X-MFC after: never V_Commit_Message_Reviewed_By: more people than the patch
* un-__P()obrien2008-01-081-6/+6
|
* Clean up VCS Ids.obrien2007-12-101-3/+5
|
* Move towards more explicit support for various network protocol stacksrwatson2007-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | in the TrustedBSD MAC Framework: - Add mac_atalk.c and add explicit entry point mac_netatalk_aarp_send() for AARP packet labeling, rather than using a generic link layer entry point. - Add mac_inet6.c and add explicit entry point mac_netinet6_nd6_send() for ND6 packet labeling, rather than using a generic link layer entry point. - Add expliict entry point mac_netinet_arp_send() for ARP packet labeling, and mac_netinet_igmp_send() for IGMP packet labeling, rather than using a generic link layer entry point. - Remove previous genering link layer entry point, mac_mbuf_create_linklayer() as it is no longer used. - Add implementations of new entry points to various policies, largely by replicating the existing link layer entry point for them; remove old link layer entry point implementation. - Make MAC_IFNET_LOCK(), MAC_IFNET_UNLOCK(), and mac_ifnet_mtx global to the MAC Framework rather than static to mac_net.c as it is now needed outside of mac_net.c. Obtained from: TrustedBSD Project
* Rename 'mac_mbuf_create_from_firewall' to 'mac_netinet_firewall_send' asrwatson2007-10-261-1/+1
| | | | | | | | | | we move towards netinet as a pseudo-object for the MAC Framework. Rename 'mac_create_mbuf_linklayer' to 'mac_mbuf_create_linklayer' to reflect general object-first ordering preference. Sponsored by: SPARTA (original patches against Mac OS X) Obtained from: TrustedBSD Project, Apple Computer
* Close a race when trying to lookup a gateway route in rt_check().jhb2007-10-221-1/+3
| | | | | | | | | | | | | | | | | | | | | Specifically, if two threads were doing concurrent lookups and the existing gateway was marked down, the the first thread would drop a reference on the gateway route and then unlock the "root" route while it tried to allocate a new route. The second thread could then also drop a reference on the same gateway route resulting in a reference underflow. Fix this by clearing the gateway route pointer after dropping the reference count but before dropping the lock. Secondly, in this same case, the second thread would overwrite the gateway route pointer w/o free'ing a reference to the route installed by the first thread. In practice this would probably just fix a lost reference that would result in a route never being freed. This fixes panics observed in rt_check() and rtexpunge(). MFC after: 1 week PR: kern/112490 Insight from: mehuljv at yahoo.com Reviewed by: ru (found the "not-setting it to NULL" part) Tested by: several
* Space cleanupdelphij2007-07-051-3/+3
| | | | Approved by: re (rwatson)
* ANSIfy[1] plus some style cleanup nearby.delphij2007-07-051-79/+38
| | | | | | Discussed with: gnn, rwatson Submitted by: Karl Sj?dahl - dunceor <dunceor gmail com> [1] Approved by: re (rwatson)
* Fix 'assignment used as truth value' warningpeter2007-07-051-1/+2
| | | | Approved by: re (rwatson)
* Commit the change from FAST_IPSEC to IPSEC. The FAST_IPSECgnn2007-07-031-5/+8
| | | | | | | | option is now deprecated, as well as the KAME IPsec code. What was FAST_IPSEC is now IPSEC. Approved by: re Sponsored by: Secure Computing
* Commit IPv6 support for FAST_IPSEC to the tree.gnn2007-07-011-5/+0
| | | | | | | | | This commit includes only the kernel files, the rest of the files will follow in a second commit. Reviewed by: bz Approved by: re Supported by: Secure Computing
* Force the alignment of the chars arrays, as they are casted later tocognet2007-05-211-2/+2
| | | | | | | | structs. gcc 4.2 doesn't do it by default, and that results in unaligned access on arm. Reviewed by: gnn, imp
* some minor modification to the previous commit to sys/netinet6/nd6.c and ↵suz2007-05-051-1/+6
| | | | | | | | | | nd6_nbr.c. - added some clarification comments - removed an unnecesary code Obtained from: KAME MFC after: 1 week
* fixed a memory leak in unresolved ND queue processingsuz2007-05-041-11/+4
| | | | | Obtained from: KAME MFC after: 1 week
* ng_iface requiers neighbor cache as well.ume2007-02-031-0/+1
| | | | MFC after: 3 days
* Revert nd6.c revs. 1.67, 1.68, 1.69, 1.70 in an attempt to unbreakbmah2007-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | IPv6 over point-to-point gif(4) tunnels. These revisions caused a host route to the destination of a point-to-point gif(4) interface to not get installed when the interface and destination addresses were assigned. This caused "no route to host" errors when trying to send traffic over the interface. The first packet arriving inbound over the tunnel, however, would cause the correct route to get installed, allowing subsequent outbound traffic to be routed correctly. gif(4) interfaces with prefix lengths of less than 128 bits (i.e. no explicit destination address assigned) were not affected by this bug. This bug fix is a possible candidate for a 6.2-RELEASE errata note. Approved by: jhay (original committer) Discussed with: jhay, JINMEI Tatuya MFC after: 3 days
* MFp4: 92972, 98913 + one more changebz2006-12-121-6/+12
| | | | | | | In ip6_sprintf no longer use and return one of eight static buffers for printing/logging ipv6 addresses. The caller now has to hand in a sufficiently large buffer as first argument.
* - In nd6_rtrequest(), when caching an rtentry, don't forgetru2006-11-251-9/+29
| | | | | | | | | | | | | | to add a reference to it; otherwise, we could later access a freed memory. This is believed to fix panics some users were observing when running route6d(8), and is similar to the fix in sys/netinet/if_ether.c,v 1.139 by glebius@. PR: kern/93910, kern/105437 Testing by: Wojciech Puchar (still ongoing) - Add rtentry locking to nd6_output() similar to rt_check(). MFC after: 4 days
* Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.hrwatson2006-10-221-1/+2
| | | | | | | | | | | | | begun with a repo-copy of mac.h to mac_framework.h. sys/mac.h now contains the userspace and user<->kernel API and definitions, with all in-kernel interfaces moved to mac_framework.h, which is now included across most of the kernel instead. This change is the first step in a larger cleanup and sweep of MAC Framework interfaces in the kernel, and will not be MFC'd. Obtained from: TrustedBSD Project Sponsored by: SPARTA
* Hopefully the last tweak in trying to make it possible to add ipv6 directjhay2006-10-021-4/+1
| | | | | | | host routes without side effects. Submitted by: JINMEI Tatuya MFC after: 4 days
* A better fix is to check if it is a host route.jhay2006-09-301-1/+1
| | | | | Submitted by: ume MFC after: 5 days
* My previous commit broke "route add -inet6 <network_addr> -interface gif0".jhay2006-09-301-1/+2
| | | | | | Fix that by excluding point-to-point interfaces. MFC after: 5 days
* Make it possible to add an IPv6 host route to a host directly connected.jhay2006-09-161-0/+2
| | | | | | | | | Use something like this: route add -inet6 <dest_addr> <my_addr_on_that_interface> -interface -llinfo This is usefull for wireless adhoc mesh networks. MFC after: 5 days
* With exception of the if_name() macro, all definitions in net_osdep.hbrooks2006-08-041-2/+0
| | | | | | | | were unused or already in if_var.h so add if_name() to if_var.h and remove net_osdep.h along with all references to it. Longer term we may want to kill off if_name() entierly since all modern BSDs have if_xname variables rendering it unnecessicary.
* Fix spurious warnings from neighbor discovery when working with IPv6 overgnn2006-06-081-0/+13
| | | | | | | | point to point tunnels (gif). PR: 93220 Submitted by: Jinmei Tatuya MFC after: 1 week
* fixed a memory leak when net.inet6.icmp6.nd6_maxqueuelen is greater than 1suz2006-03-241-4/+26
| | | | | Obtained from: KAME MFC after: 3 days
* avoided the use of purged address structure when an address becameume2006-02-121-2/+1
| | | | | | | | | | | invalid in nd6_timer(). PR: kern/93170 Reported by: kris Submitted by: JINMEI Tatuya <jinmei__at__isl.rdc.toshiba.co.jp> Confirmed by: kris Obtained from: KAME MFC after: 2 days
* fixed a compilation failure on amd64/sparc64/ia64suz2005-10-221-2/+4
| | | | | Submitted by: max MFC after: 2 month
* sync with KAME regarding NDPsuz2005-10-211-209/+337
| | | | | | | | | | | | - introduced fine-grain-timer to manage ND-caches and IPv6 Multicast-Listeners - supports Router-Preference <draft-ietf-ipv6-router-selection-07.txt> - better prefix lifetime management - more spec-comformant DAD advertisement - updated RFC/internet-draft revisions Obtained from: KAME Reviewed by: ume, gnn MFC after: 2 month
* perform NUD on an IPv6-aware point-to-point interfacesuz2005-10-211-0/+2
| | | | | Obtained from: KAME MFC after: 1 week
* sync with KAME (nuked unused code, use NULL to denote a NULL pointer)suz2005-10-191-15/+0
| | | | | Obtained from: KAME Reviewed by: ume, gnn
* supported an ndp command suboption to disable IPv6 in the given interfacesuz2005-10-191-0/+6
| | | | | | Obtained from: KAME Reviewd by: ume, gnn MFC after: 2 week
* added an ioctl option in kernel so that ndp/rtadvd can change some ↵suz2005-10-191-0/+28
| | | | | | | | NDP-related kernel variables based on their configurations (RFC2461 p.43 6.2.1 mandates this for IPv6 routers) Obtained from: KAME Reviewd by: ume, gnn MFC after: 2 weeks
OpenPOWER on IntegriCloud