summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
AgeCommit message (Collapse)Author
2022-06-28Try to document 'announce policy' and add RFC 9234 to the list in bgpd.8Claudio Jeker
How RFC 9234 support will work in the long run may still change but for now at least tell people how to use it.
2022-06-28The default state of enhanced refresh is no. So flip logic.Claudio Jeker
Fixes config regress. Found by anton@, discussed with tb@
2022-06-28Check for entries in the suberror names arrays that are NULL. Handle themClaudio Jeker
like other unknown ones. Also KNF the code a bit. Was OK tb@ some time ago
2022-06-28Unbreak tree: add log_policy() implementation missing from previous commit.Theo Buehler
2022-06-28spellingJonathan Gray
2022-06-27Add support for RFC 9234 - Route Leak Prevention and Detection Using RolesClaudio Jeker
With this it is possible to send a role in the OPEN message and if that was successful the RDE will add the new OTC attribute if necessary. OK tb@
2022-06-26Pignatoro -> PignataroJonathan Gray
2022-06-25Since 128bit addressing is not enough add some addition 32bit ofClaudio Jeker
scope_id to struct kroute6 to make link local addresses work. OK tb@
2022-06-24Use IN6_IS_ADDR_MC_NODELOCAL() instead of IN6_IS_ADDR_MC_INTFACELOCAL().Claudio Jeker
It seems that IN6_IS_ADDR_MC_NODELOCAL() is the official name of this nightmare and therefor more portable. OK tb@
2022-06-23Move struct kif from bgpd.h to kroute.cClaudio Jeker
The only user of struct kif was the session engine for the 'depend on' feature. Switch the imsg exchange to a new struct session_dependon and rename the IMSG as well. OK tb@
2022-06-23Fix commentsClaudio Jeker
2022-06-23Thanks IPv6 for being extra complex. Recover scope_id for link local addrs.Claudio Jeker
OK tb@
2022-06-23Replace struct kroute_node and kroute6_node with direct versions ofClaudio Jeker
struct kroute and kroute6. Rename knexthop_node to knexthop as well. Mostly mechanical but fix at least one log format string to have the correct order of arguments. OK tb@
2022-06-22Move struct kroute and kroute6 to kroute.c and out of bgpd.hClaudio Jeker
OK tb@
2022-06-22Use struct kroute_full in bgpd_filternexthop() so this code becomes a lotClaudio Jeker
simpler. OK tb@
2022-06-22Sync KAME hack in log_in6addr() with route/show.cTheo Buehler
ok claudio
2022-06-22Use struct kroute_full instead of a union of struct kroute & kroute6.Claudio Jeker
struct kroute_full is address family independent and so more portable. Also struct kroute and struct kroute6 will be kroute.c internal soon. OK tb@
2022-06-22Remove comment which is no longer true.Claudio Jeker
2022-06-19Implement a applymask() function that works on bgpd_addr structs.Claudio Jeker
Use this function in kroute so that kroute_find and kroute6_find can switch to use struct bgpd_addr as argument. OK tb@
2022-06-17Adapt the KAME hack in sa2addr() to be the same as in route/show.cClaudio Jeker
Also fix the function by moving the memcpy() after the embedded scope has been removed. OK tb@
2022-06-16Neither inet4allone nor inet6allone need global scope. Make them static.Claudio Jeker
Noticed by tb@
2022-06-16Remove prefixlen2mask() uasge outside of util.c. Instead use inet4applymask().Claudio Jeker
Using inet4applymask() makes the code similar to the IPv6 version. Also switch kroute{,6}_match() to use a struct bgpd_addr * as argument. OK tb@
2022-06-16If anything in name2id conversion fails then just return 0.Claudio Jeker
Do not set any errno. So if a non empty string is used in name2id conversion and the return value is 0 then that would be an error. Callers in most cases do not care and accept that a label may be lost because of conversion failure. Noticed by and OK tb@
2022-06-16Remove __func__ from warning messages where it does not add anythingClaudio Jeker
to the warning. The messages are clear enough and unique. OK tb@
2022-06-15Prevent busy poll loop on pfkey message error.Claudio Jeker
When pfkey_reply() detects an error in a message it needs to flush that message out of the buffer because pfkey_read() only did a peak read. OK tb@
2022-06-15Need to continue to the next message for route messages with errorsClaudio Jeker
or which are not marked RTF_DONE. Possible fix for bgpd exiting for no obvious reason. Found with help from florian@ OK florian@
2022-06-15Do not use defines from pfkeyv2.h in portable code.Claudio Jeker
Instead define our own algorithm enums for the IPsec code. OK tb@ sthen@
2022-06-15Rename F_BGPD_INSERTED to F_BGPD and use F_BGPD_INSERTED as a flag thatClaudio Jeker
indicates that the route was successfully added to the FIB. Filter out dynamic routes, like it is already done for ARP and ND routes) and kill F_DYNAMIC. Also remove the protect_lo() bits. Adding dummy kroute entries does no longer prevent bad routes to hit the FIB. Also loopback IPs are checked in a few other places to prevent bad routes to be installed into the FIB. OK tb@
2022-06-14Add my copyright, I think I added enough code to justify it.Claudio Jeker
2022-06-14Bump version to 7.4Claudio Jeker
2022-06-13Split dispatch_rtmsg_addr() into a function parsing a route messageClaudio Jeker
into a struct kroute_full and then two functions to add/change or delete that route from the kroute tree. Cleanup some additional things and use the same parse funtion in fetchtable. OK tb@
2022-06-09Properly error out if a variable does not exist. Need to pass backClaudio Jeker
ERROR to yylex() to make the parser fail nicely. OK tb@
2022-06-09Change argument of ktable_get from ifd->ifi_rdomain to kif->k.rdomain.Claudio Jeker
It is the same value but using the kif seems better.
2022-06-09Remove the rdomain / rtableid passed to some kroute functions.Claudio Jeker
kr_nexthop_add() and kr_nexthop_delete() only operate on the main table so just pass in the right rdomain id. kr_shutdown() and kr_dispatch_msg() don't really need the rdomain passed. The was done for kif_remove(), since that function needs to remove connected routes from the rdomain table. Connected routes can only exists in the interfaces rdomain so just use kif->k.rdomain. If such routes exist that table exists as well. If the table does not exists there are also no connected routes to track. OK tb@
2022-06-07Try to be more precise with rtlabelid tracking.Claudio Jeker
By moving the rtlabel_unref into kroute_remove the unref is more reliable. There are still places where handling is not quite right but it is a step in the right direction. OK tb@
2022-06-07uint8_t not u_int8_t. Damn finger memory.Claudio Jeker
2022-06-07Retire F_RTLABEL it was not used for anything.Claudio Jeker
Also cleanup some redundant if statements. OK tb@
2022-06-05Rework how fib_priority is handled.Claudio Jeker
Instead of passing it around all the time put the fib_priority into the kroute state. It is only needed in send_rtmsg() in the end. Additionally insert F_BGP_INSERTED routes with a special RTP_MINE priority. This makes changing the fib_priority at runtime simpler because there is no need to alter the kroute table anymore. OK tb@ deraadt@
2022-06-02Adjust lowest allowed routing priority to be bigger than RTP_LOCAL.Claudio Jeker
RTP_LOCAL is internally used by the kernel and is not available for userland. The minimal usable routing prio is 2. OK tb@
2022-06-02Use a common idiom to check if the user supplied routing priority isClaudio Jeker
in range. Also rephrase the error message. OK tb@
2022-06-02Cleanup ktable_exists() usage and its warning message.Claudio Jeker
Check the return value in all cases and use a common idiom for this check. OK tb@
2022-06-02Adjust some warning messages to be a bit more accurate. ktable_update()Claudio Jeker
actually loads a routing table and not really an rdomain.
2022-05-31fix spacing;Jason McIntyre
2022-05-31Implement a max communities filter matchClaudio Jeker
When max-communities X is set on a filterrule the filter will match when more than X communities are present in the path. In other words max-communities 0 means no communities are allowed and max-communities 3 limits it up to 3 communities. There is max-communities, max-ext-communities and max-large-communities for each of the 3 community attributes. These three max checks can be used together. OK tb@ job@
2022-05-25Fix non-transitive extended community handling.Claudio Jeker
First of all the detection logic was totally wrong. Then filter out non-transitive extended communities when received from an ebgp peer. Also cleanup the type handling of ext-communities. Mainly to not have to handle the transitive vs non-transitive versions the type is masked with EXT_COMMUNITY_VALUE before doing the switch case for the various types. With this my test using ext-communities works. OK tb@
2022-05-23whitespaces found when I went checking for something elseTheo de Raadt
2022-05-06Relax the limitation of what is an acceptable unicast IP.Claudio Jeker
Remove the IN_BADCLASS() check which filters out the experimental IPv4 address space. Now there are no more experiments in IPv4 and so there is less reason for these network daemons to deny such an IP. Everything still disallows multicast IPs (224/4) and loopback (127/8) a few also disallow 0/8 but this is not consistent. In any case using 240/4 in production is a really bad idea but it is not up to this software to prevent you from being a fool. OK deraadt@ tb@
2022-04-04Prepare for new release.Claudio Jeker
2022-03-31man pages: add missing commas between subordinate and main clausesChristian Weisgerber
jmc@ dislikes a comma before "then" in a conditional, so leave those untouched. ok jmc@
2022-03-30Simplify up_generate_updates()Theo Buehler
Instead of using new == NULL or new != NULL in combination with an again label to steer the control flow of this function, switch to using a while loop and break/continue/return. Simplified version of a diff by claudio. ok claudio