summaryrefslogtreecommitdiff
path: root/sys/net/route.h
AgeCommit message (Collapse)Author
2021-03-17Hide kernel internals from userland by wrapping more bits in _KERNEL blocks.Claudio Jeker
Especially the includes of net/rtable.h and sys/queue.h are problematic. OK florian@
2021-03-10spellingJonathan Gray
ok gnezdo@ semarie@ mpi@
2020-10-29Add feature to force the selection of source IP addressdenis
Based/previous work on an idea from deraadt@ Input from claudio@, djm@, deraadt@, sthen@ OK deraadt@
2020-08-13Add a ROUTE_FLAGFILTER socket option for routing sockets, allowingJonathan Matthew
filtering out messages for routes with flags matching any bit in a mask. This allows routing daemons to opt out of receiving messages for L2 and broadcast route entries, which they currently discard. ok dlg@ sthen@ deraadt@
2020-03-10The return value of rt_ifa_purge() is ignored, so stopKenneth R Westerback
returning a (possibly uninitialized) value. CID 1483466. ok millert@
2019-11-23Move srtdnstosa() static inline function under #ifdef _KERNEL. This wayClaudio Jeker
3rd party software stuck with c90 will still compile. Quick fix since RTM_PROPOSAL will most porbably change later on. Reported by naddy and aja
2019-11-22Add rtm_proposal, a function to send out RTM_PROPOSAL messages from theClaudio Jeker
kernel. Will be used to have umb(4) inform unwind(8) about DNS changes. OK bluhm@ tested by florian@ and deraadt@
2019-11-09Forgot comment requested by deraadt in previous.Florian Obser
2019-11-09Add RTP_PROPOSAL_SOLICIT to allow unwind(8) to solicit DNS proposalsFlorian Obser
from slaacd and dhclient when it starts. Discussed with deraadt who notes that it's a bit odd to have this as a route priority. One idea is to have this as a dedicated route message and not a priority. But we want to move this forward and learn how it can be used so we are going with this for now. OK deraadt
2019-06-21Prevent recursions by not deleting entries inside rtable_walk(9).Martin Pieuchot
rtable_walk(9) now passes a routing entry back to the caller when a non zero value is returned and if it asked for it. This allows us to call rtdeletemsg()/rtrequest_delete() from the caller without creating a recursion because of rtflushclone(). Multicast code hasn't been adapted and is still possibly creating recursions. However multicast route entries aren't cloned so if a recursion exists it isn't because of rtflushclone(). Fix stack exhaustion triggered by the use of "-msave-args". Issue reported by Dániel Lévai on bugs@ confirmed by and ok bluhm@.
2019-04-28Fix reading route entries via kvm(3).Martin Pieuchot
From Naoki Fukaumi, ok yasuoka@, sthen@
2019-02-13change rt_ifa_add and rt_ifa_del so they take an rdomain argument.David Gwynne
this allows mpls interfaces (mpe, mpw) to pass the rdomain they wish the local label to be in, rather than have it implicitly forced to 0 by these functions. right now they'll pass 0, but it will soon be possible to have them rx packets in other rdomains. previously the functions used ifp->if_rdomain for the rdomain. everything other than mpls still passes ifp->if_rdomain. ok mpi@
2018-11-12Add new routing socket message RTM_80211INFO to provide details ofKenneth R Westerback
802.11 interface state changes (e.g. SSID) to interested parties. Original diff from phessler@. Many suggestions and tweaks from claudio@, stsp@, anton@. ok claudio@ stsp@ anton@ phessler@
2018-07-12Introduce RTM_CHGADDRATTR to inform userland on the route socket whenFlorian Obser
an attribute of an address is changed. For now it's used when IPv6 duplicate address detection finishes. With this slaacd(8) can find out if a configured address is not duplicated without the need to poll. OK phessler, benno, claudio
2018-07-01Retire support for unused RTM_LOCK messages, it's redundant w/ RTM_CHANGE.Martin Pieuchot
ok tb@, sthen@
2018-06-25Factorize MPLS setup/teardown into two functions.Martin Pieuchot
ok claudio@
2018-04-24Remove unused rtentry parameter.Florian Obser
Input bluhm OK benno, kn, claudio
2018-02-11Add a ROUTE_PRIOFILTER socket option for roueing sockets thatSebastian Benoit
allows filtering on the priority of the route. All routes up to the specified value will be passed. ok claudio, ok henning previous version, feedback and manpage from sthen.
2017-08-02Fix rtable regression tests.Martin Pieuchot
2017-07-30Enable mpath support in the Allotment Routing Table (ART) on the ramdisk.Florian Obser
OK mpi
2017-07-30Switch installer to Allotment Routing Table (ART).Florian Obser
Prompted by a bugreport by naddy that IPv6 autoconfiguration is broken in the installer. OK mpi, "go for it" deraadt
2017-07-28Add an error argument to rtm_send() instead of rerolling it insideMartin Pieuchot
rtdeletemsg(). ok bluhm@
2017-07-24rt_getifa() is only needed for routing commands submited by userland.Martin Pieuchot
So rename it to rtm_getifa(), move it where it belongs and stop calling it from rtrequest(9). Route entries created by the kernel must always specify the corresponding `ifa'. ok claudio@
2017-06-09Replace rtrequest(RTM_DELETE...) rtrequest_delete() and do not evenMartin Pieuchot
try to remove a route from the table if it is and invalid cache. This is a step towards decoupling code dealing with userland and kernel inserted routes. ok bluhm@
2017-05-21Fix copy/paste in comment.Jeremie Courreges-Anglas
2017-03-07Do not grab the NET_LOCK() for routing sockets operations.Martin Pieuchot
The only function that need the lock is rtm_output() as it messes with the routing table. So grab the lock there since it is safe to sleep in a process context. ok bluhm@
2017-03-06Prefix functions dealing with routing messages with 'rtm_' and keepMartin Pieuchot
them all in net/rtsock.c. This allows to easily spot which functions are doing a copyout(9) when dealing with the routing midlayer. ok phessler@, bluhm@, dhill@, krw@, claudio@
2017-03-03Convert the variable argument list of the pr_output functions toAlexander Bluhm
fixed parameters. OK mpi@ claudio@ dhill@
2017-03-02Implement a new routing message RTM_PROPOSAL that communicatesKenneth R Westerback
information that can be used to configure an interface and related network components. ok bluhm@, ok for various older versions mpi@ florian@ claudio@
2017-01-23Add comment above rtm_type #define's.Kenneth R Westerback
2017-01-23Add comment above rtm_flags #define's.Kenneth R Westerback
2017-01-23Typo in comment. It's 'rtm_addrs', not 'rtm_addr'Kenneth R Westerback
2017-01-22Zap some bad whitespace.Kenneth R Westerback
2017-01-20use per-cpu counters for rtstat.David Gwynne
ok mpi@
2017-01-19add hooks so we can query the current state of a BFD sessionPeter Hessler
bfd session details are visible with "route -n get 192.0.2.1 -bfd" OK mpi@ deraadt@ claudio@
2017-01-19use a space instead of a tab, for consistancyPeter Hessler
requested by and OK mpi@
2016-11-21Kill rtioctl() stub, returning EOPNOTSUPP since tree import.Martin Pieuchot
ok jsg@
2016-09-24a route message for BFD, so we can notify userland about the status.Peter Hessler
currently used on state-transitions. OK mpi@
2016-09-04Purge routes attached to an address when this address is removed.Martin Pieuchot
This is done to stop using stale ifa attached to routes, which is the easiest way to make rtisvalid(9) MP-safe. sthen@ and henning@ like it, ok claudio@
2016-09-04Make it possible to toggle RTF_BFD via RTM_CHANGE and fix some minor thingsClaudio Jeker
in bfd.c. Make bfd_rtfree() a void function. OK phessler@
2016-09-03Add in the (disabled) kernel glue for BFDPeter Hessler
OK claudio@, henning@
2016-08-31Remove unused RTF_MASK route flag.Alexander Bluhm
Requested by and OK mpi@
2016-08-31G/C rt_defmask4.Martin Pieuchot
2016-08-22Make the ``rt_gwroute'' pointer of RTF_GATEWAY entries immutable.Martin Pieuchot
This means that no protection is needed to guarantee that the next hop route wont be modified by CPU1 while CPU0 is dereferencing it in a L2 resolution functions. While here also fix an ``ifa'' leak resulting in RTF_GATEWAY being always invalid. dlg@ likes it, inputs and ok bluhm@
2016-07-13Introduce RTF_MULTICAST and flag corresponding IPv6 routes as suchMartin Pieuchot
instead of abusing RTF_CLONING. Fix a leak reporeted by Aaron Riekenberg on misc@, ok sthen@
2016-07-11Path MTU discovery was slightly broken. I took two ICMP packetsAlexander Bluhm
to create and change the dynamic route. This behavior was introduced in net/route.c rev 1.269 when the gateway route allocation was moved from rt_setgateway() to _rtalloc(). So rtrequest(RTM_ADD) could return a route without a valid gateway route. To fix this, call rt_setgwroute() from _rtalloc() and rt_setgateway(). OK mpi@
2016-07-11Revert the introduction of ``rt_addr''.Martin Pieuchot
Being able to add route entries without configured addresses is a nice feature but this is not my fight. So I'd rather no add another pointer to ``struct rtentry'' if I'm not removing another one.
2016-06-14Pass the configured ``ifa'' to rt_sendaddrmsg() instead of getting it viaMartin Pieuchot
``rt->rt_ifa'' later.
2016-06-14Store the source address associated with a route in its own chunk ofMartin Pieuchot
memory. This will allow to unlink 'sruct rtentry' and 'struct ifaddr' to be able to add route entries without needing an address. ok sthen@, visa@, florian@
2016-06-03set rt_expire times against time_uptime, not time_second.David Gwynne
time_second is unix time so it can be affected by clock changes. time_uptime is monotonic so it isnt affected by clock changes. that in turn means route expiries wont jump with clock changes if set against time_uptime. the expiry is translated into unix time for export to userland though. ok mpi@