summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/in6_src.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use rtisivalid(9) to check if the given (cached) route can be used.mpi2015-10-131-8/+6
| | | | | | | | | | | | | | | | | | Note that after calling rtalloc(9) we only check if a route has been returned or not and do not check for its validity. This cannot be improved without a massive refactoring. The kernel currently *do* use !RTF_UP route due to a mismatch between the value of ifp->if_link_state and the IFF_UP|IFF_RUNNING code. I'd explain the RTF_UP flag as follow: . If a cached route entry w/o RTF_UP is passed to ip{6,}_output(), . call rtalloc(9) to see if a better entry is present in the tree. This is enough to support MPATH and route cache invalidation. ok bluhm@
* Do not manually decrement rt's refcounter in nd6_lookup() and let thempi2015-09-181-2/+3
| | | | | | callers rtfree(9) it. Inputs and ok bluhm@
* if_put after if_get for in6_src and ip6_output which got a lot easier afterclaudio2015-09-111-2/+9
| | | | all the cleanup by mpi@ since we no longer overwrite ifps, etc. OK dlg@
* Rewrite in6_selectroute() to no longer return an ifp.mpi2015-09-111-65/+18
| | | | | | | The returned "struct rtentry" is either the cached one or the one passed in options. ok claudio@
* Move the multicast option parsing out of in6_selectroute().mpi2015-09-111-33/+21
| | | | ok claudio@
* Kill selectroute().mpi2015-09-111-31/+3
| | | | ok claudio@
* in6_embedscope() needs to lose some weight. Remove the last argument.claudio2015-09-111-9/+5
| | | | | | | | | In all but two calls NULL is passed and in the other 2 cases the ifp is only used to maybe feed it to in6_selecthlim() to select the hoplimit for the link. Since in6_embedscope() only works on link-local addresses it does not matter what hop limit we select since the destination is directly reachable. OK florian@ mpi@
* It is time to put inet6 on a diet. Use the flensing knife and cut outclaudio2015-09-101-11/+3
| | | | | the 3rd argument of in6_recoverscope() and make it return void. OK dlg@ mikeb@
* Revert (again!) the two uses of rtisvalid(9), they break NFS!mpi2015-09-031-6/+8
| | | | Found the hardway by naddy@
* Convert ip{,6}_output() (cached) route entry checks to rtisvalid(9).mpi2015-09-031-8/+6
| | | | | | | | | This introduces a behavior change as we now reject !RTF_UP routes to output packets. This stricter check exposed a bug in the setup of new routes and was the reason for the previous revert. This should be now fixed by r1.229 of sys/net/route.c . ok bluhm@
* Revert the two uses of rtisvalid(9) for the moment, it breaks dhclient(8)mpi2015-09-021-6/+8
| | | | | | | | configured networks on RAMDISK kernels. The problem is that the default route installed by dhclient(8) does not have the RTF_UP flag in this environement and rtisvalid(9) doesn't allow you to use a RTF_DOWN route.
* Convert ip{,6}_output() (cached) route entry checks to rtisvalid(9).mpi2015-09-011-8/+6
| | | | ok bluhm@
* More damned eye searing whitespace. No change to .o files.krw2015-06-081-3/+3
|
* Use an interface index instead of a pointer for multicast options.mpi2014-12-171-5/+4
| | | | | | | | | | | | Output interface (port) selection for multicast traffic is not done via route lookups. Instead the output ifp is registred when setsockopt(2) is called with the IP{V6,}_MULTICAST_IF option. But since there is no mechanism to invalidate such pointer stored in a pcb when an interface is destroyed/removed, it might lead your kernel to fault. Prevent a fault upon resume reported by frantisek holop, thanks! ok mikeb@, claudio@
* Explicitly include <net/if_var.h> instead of pulling it in <net/if.h>.mpi2014-12-051-1/+2
| | | | ok mikeb@, krw@, bluhm@, tedu@
* Rename rtalloc1() into rtalloc(9) and convert its flags to only enablempi2014-11-011-5/+6
| | | | | | functionnality instead of a mix of enable/disable. ok bluhm@, jca@
* Use rtfree() instead of RTFREE(), NULLify some free'd route pointers andmpi2014-10-141-8/+8
| | | | | | kill the macro. ok mikeb@, henning@
* Kill rtalloc() and update rtalloc1() and rtalloc_mpath() to no longermpi2014-09-271-5/+9
| | | | | | rely on "struct route" that should die. ok claudio@
* Fewer <netinet/in_systm.h> !mpi2014-07-221-2/+1
|
* Do not include <sys/malloc.h> where it is not needed.mpi2014-06-031-2/+1
|
* we'll do fine without casting NULL to struct foo * / void *henning2014-04-211-3/+3
| | | | ok gcc & md5 (alas, no binary change)
* Invert the signature logic of in{,6}_selectsrc, make them return thejca2014-04-181-51/+49
| | | | | | | | error code and pass the resulting source address back to the caller through a pointer, as suggested by chrisz. This gives us more readable code, and eases the deletion of useless checks in the callers' error path. Add a bunch of "0 -> NULL" conversions, while here. ok chrisz@ mpi@
* Retire kernel support for SO_DONTROUTE, this time without breakingmpi2014-04-071-20/+1
| | | | | | | | | | | localhost connections. The plan is to always use the routing table for addresses and routes resolutions, so there is no future for an option that wants to bypass it. This option has never been implemented for IPv6 anyway, so let's just remove the IPv4 bits that you weren't aware of. Tested a least by lteo@, guenther@ and chrisz@, ok mikeb@, benno@
* revert "Retire kernel support for SO_DONTROUTE" diff, which does bad thingssthen2014-03-281-1/+20
| | | | for localhost connections. discussed with deraadt@
* Retire kernel support for SO_DONTROUTE, since the plan is to alwaysmpi2014-03-271-20/+1
| | | | | | | | use the routing table there's no future for an option that wants to bypass it. This option has never been implemented for IPv6 anyway, so let's just remove the IPv4 bits that you weren't aware of. Tested by florian@, man pages inputs from jmc@, ok benno@
* ANSIfy a declaration, no object change.mpi2014-03-121-6/+3
|
* Propagate an rdomain number to the nd6_lookup independently frommikeb2014-01-071-2/+3
| | | | | the ifp pointer which can be NULL. This prevents a crash reported by David Hill <dhill at mindcry ! org>. OK bluhm
* Replace most of our formating functions to convert IPv4/6 addresses frommpi2013-11-111-4/+6
| | | | | | | | network to presentation format to inet_ntop(). The few remaining functions will be soon converted. ok mikeb@, deraadt@ and moral support from henning@
* Back when some NRL code was merged into KAME to create the *BSD IPV6deraadt2013-10-231-17/+9
| | | | | | | | stack (factoid: by a bunch of people in my living room), some compatibility #define's were created to shim incompatible inpcb access methods. There was an understanding they would eventually be removed. Since they are error prone, and 1999 is a long time ago, now they die. ok mikeb claudio mpi
* Sprinkle a lot more IPv6 routing domains support in the kernel.phessler2013-10-211-1/+3
| | | | | | | | | Mostly mechanical, setting and passing the rdomain and rtable correctly. Not yet enabled. Lots of help and hints from claudio and bluhm OK claudio@, bluhm@
* The header file netinet/in_var.h included netinet6/in6_var.h. Thisbluhm2013-10-171-2/+1
| | | | | | | created a bunch of useless dependencies. Remove this implicit inclusion and do an explicit #include <netinet6/in6_var.h> when it is needed. OK mpi@ henning@
* Remove a bunch of sockaddr_in6 pointer casts and replace othersbluhm2013-05-311-6/+5
| | | | | | with sin6tosa() or satosin6() inline functions. This allows the compiler to check the types more strictly. OK mpi@
* no need for a lot of code to include proc.htedu2013-03-281-2/+1
|
* Unfortunately the satosin, sintosa, ifatoia, satosin6, sin6tosa,bluhm2013-03-281-12/+11
| | | | | | | ifatoia6 macros do not check the source type. They just cast anything. Remove needless casts and do not use those macros if the source type does not match. Remove duplicate defines. No binary change. OK kettenis@ krw@
* Introduce if_get() to retrieve an interface descriptor pointer givenmpi2013-03-201-25/+20
| | | | | | | an interface index and replace all the redondant checks and accesses to a global array by a call to this function. With imputs from and ok bluhm@, mikeb@
* Replace the cast to struct in6_ifaddr pointer with the ifatoia6() macro.bluhm2013-03-041-4/+4
| | | | | No binary change. OK claudio@
* rdomain support for IPv6sperreault2011-11-241-17/+22
| | | | ok mikeb
* Several fixes for the IPV6_PKTINFO handling with sendmsg(2)mikeb2011-08-071-3/+78
| | | | | | | | | | | | | | Verify that the address in the in6_pktinfo structure included in the control message is unicast and configured on the local host. Additional checks prevent from using non-routable addresses and inactive interfaces. Embed the scope identifier into the link local addresses as required by the stack. Do not force users to provide valid interface index in the ipi6_ifindex but look it up in place if needed. ok bluhm, waived by deraadt for the release.
* Start cleaning up the mess called rtalloc*. Kill rtalloc2, make rtalloc1claudio2010-05-071-5/+5
| | | | | | | | accept flags for report and nocloning. Move the rtableid into struct route (with a minor twist for now) and make a few more codepathes rdomain aware. Appart from the pf.c and route.c bits the diff is mostly mechanical. More to come... OK michele, henning
* More destatic and ansification.jsing2010-02-081-36/+18
| | | | ok claudio@ naddy@
* When accessing cached routes make sure the route is actually still valid.claudio2008-11-231-3/+3
| | | | | | | | Before accessing a ro_rt make sure the route is either freshly allocated or RTF_UP is set. If not ro_rt should be freed and reallocated or at least no info from the ro_rt should be considered valid. This seems to solve the crashes seen by Felipe Alfaro Solana. some sort of OK dlg@
* de-__P. noted by Dries Schellekensitojun2006-12-111-3/+3
|
* switch IPv6 advanced API from RFC2292 to RFC3542 (2292 is superseded by 3542).itojun2006-12-091-1/+217
| | | | | | | | | | the kernel still handles RFC2292 set/getsockopts, so that compiled binary has no trouble running. userland sees RFC3542 symbols only on header file so new code has to use RFC3542 API. bump libc shlib minor for function additions. tested on i386/amd64 by jmc, i386 by brad. checked by deraadt.
* change semantics of ff01::/16 to interface local multicastitojun2006-11-171-14/+11
| | | | | | (to sync up with more recent IPv6 spec) ok from: deraadt mcbride
* Add support for equal-cost multipath IP.pascoe2006-06-181-2/+2
| | | | | | | | | | | | | | To minimise path disruptions, this implements recommendations made in RFC2992 - the hash-threshold mechanism to select paths based on source/destination IP address pairs, and inserts multipath routes in the middle of the route table. To enable multipath distribution, use: sysctl net.inet.ip.multipath=1 and/or: sysctl net.inet6.ip6.multipath=1 testing norby@ ok claudio@ henning@ hshoexer@
* adjust functions dealing with the routing table to take a table ID ashenning2006-06-161-2/+2
| | | | | | parameter so they can work on alternate tables. table 0 hardcoded for many callers yet, that will be adapted step by step. input + ok claudio norby hshoexer
* sin6_scope_id maps to interface indices for link local addresses only!brad2005-09-191-2/+2
| | | | | | | | | (unlikely to be used with other scopes for now, but we should be correct anyway) From drochner NetBSD ok deraadt@
* use if_indexlim (instead of if_index) and ifindex2ifnet[x] != NULLitojun2003-12-101-4/+7
| | | | | | to check if interface exists, as (1) if_index will have different meaning (2) ifindex2ifnet could become NULL when interface gets destroyed, when we introduce dynamically-created interfaces. markus ok
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* KNF - return is not a function. sync w/kameitojun2002-09-111-20/+20
|