summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
AgeCommit message (Collapse)Author
2020-06-27Replace TAILQ concatenation loop with TAILQ_CONCATbket
OK claudio@
2020-06-05Remove redundant codedenis
Reported by Prof. Dr. Steffen Wendzel <wendzel @ hs-worms . de>, thanks! OK martijn@ sthen@
2020-05-16list example files in FILES with a short description: generally, "ExampleJason McIntyre
configuration file.", but occasionally something else fit better; at the same time, try to make the format for FILES more consistent; original diff from clematis
2020-05-11There is no reason to limit the string length of log_reason() to REASON_LENClaudio Jeker
charactars. Also fix a long line. OK benno@ deraadt@
2020-05-10In bgpctl argument parser, re-arrange 'reason' parsing ('nei action [reason]')Theo de Raadt
to be more generic, then change 'reload' to take take a '[reason]' also, which will be logged by bgpd. ok kn claudio
2020-05-08Do not use string litterals in the grammar ("{") it is not POSIX compliantClaudio Jeker
and also not needed. This just needs a char lookup ('{') like it is done in all the other rules with '{'. With this parse.y can be compiled with bison. OK otto@ benno@
2020-05-02The warning "bad AGGREGATOR, AS 0 not allowed ..." is not very helpful.Claudio Jeker
Make it a log_debug() instead to reduce the noise seen on most full feeds. The DFZ is currently not clean enough to properly drop AS 0 in that case. OK job@ deraadt@
2020-04-23 ce examples of "Ar arg Ar arg" with "Ar arg arg" and stop the spread;Jason McIntyre
2020-04-23replace examples of "Ic arg Ic arg" with "Ic arg arg" and stop the spread;Jason McIntyre
2020-04-23Try to document 'no local-address'Claudio Jeker
2020-04-23Store local-address by address family. This allows to configure bothClaudio Jeker
an IPv4 and IPv6 local-address on a group and the neighbors bind to the right local-address. Also implement 'no local-address' to reset a previously set local address back to zero. This should help with IBGP and multihop session config and hopefully reduce repetition in bgpd configs. OK sthen@ benno@
2020-03-16The assumption that in roa tables a prefix / source-as combo only appearsClaudio Jeker
once in the input file is not correct. I thought the RPKI validators would aggreagte these entries but that is not necessarily the case. There are cases where prefixes show up with the same source-as multiple times with different maxlen lenght. In those cases merge these multiple entries and keep the one entry with the longest maxlen length since that is the VRP which covers all others. Found by job@ OK benno@
2020-02-16Tag "neighbor" and "group" keywords at their definitionskn
mdoc(7) auto-tagging delivered false positives leading tag users to usages somewhere in manual; add ".Tg" markup for both keywords in the "NEIGHBORS AND GROUPS" section where the concepts are introduced. Feedback and OK schwarze
2020-02-14Rename copy_filterset() to filterset_copy() and move it to rde_filter.cClaudio Jeker
where functions like filterset_move() live. Also initialize the dest TAILQ in filterset_copy() as it is done in filterset_move(). OK benno@ phessler@
2020-02-12Move the code to figure out the alternate IP address (IPv6 addr for IPv4Claudio Jeker
sessions and vice versa) from the RDE to the SE. The SE is the right place for this since there getsockname(2) fetches the local address and so the alternate one can be fetched there as well. With this the route pledge is no longer needed in the RDE and the pledge is now just "stdio recvfd". OK benno@
2020-02-09mention /etc/examples/bgpd.conf; tweak and OK jmc@, OK benno@Ingo Schwarze
2020-01-28usr.sbin/bgpd: replace TAILQ concatenation loop with TAILQ_CONCATbket
OK florian@, benno@
2020-01-25In nexthop_update() only add a nexthop to the nexthop_runners queue ifClaudio Jeker
there is actual work to do (nh->next_prefix != NULL). If next_prefix is NULL there is a possibility that nexthop_unref() is called before the nexthop is removed from the nexthop_runners queue resulting in a use-after-free access in nexthop_runner(). For consistency add a debug message in nexthop_unlink() if the nexthop is removed from the nexthop_runners queue because the last prefix is gone. OK procter@
2020-01-25kill double .Pp;Jason McIntyre
2020-01-24Implement 'max-prefix NUM out' to limit the number of announced prefixes.Claudio Jeker
This is an easy safety switch to not leak full tables to upstreams and peers. If the limit is hit a Cease notification is sent and the session is closed. This implements most of https://tools.ietf.org/html/draft-sa-idr-maxprefix-00 OK job@
2020-01-22delete wasteful ;;Theo de Raadt
ok tedu
2020-01-21Add last_rcvd_errcode and last_rcvd_suberr to the peer_stats so thatClaudio Jeker
not only sent errors can be reported but also received ones. OK denis@ deraadt@
2020-01-21Add some additional cease error subcodes as defined by iana.Claudio Jeker
OK denis@ deraadt@
2020-01-21Fix a commentClaudio Jeker
2020-01-10Reorder assignements a bit so that all hashed values are togetherClaudio Jeker
and the refcnt, hash and flags are also grouped.
2020-01-10'export default-route' still requires an output filter rule to announceClaudio Jeker
the prefix. When reloading the config the export needs to be redone as part of softreconfig out else fixing the filters has no effect and a session reset is required. Note: changing the export setting still needs a session reset OK benno@
2020-01-09Instead of calling SipHash24_Update() in path_hash for each element ofClaudio Jeker
struct rde_aspath define aspath_hashstart and aspath_hashend and update all values in one call. Inspired by struct process and its ps_startcopy. OK deraadt@
2020-01-09Clean up header a bit, remove peer_recv_eor and peer_send_eor prototypesClaudio Jeker
and order prototypes like the functions in rde_peer.c
2020-01-09Move peer related code from rde.c to rde_peer.c.Claudio Jeker
Change peer_foreach() to just walk the peer list instead of iterating over the peer hash table. Also change peer_down() arguments so that it can be used as a peer_foreach() callback (which is then used in rde_shutdown()). OK benno@
2020-01-09Convert the lastchange of a prefix from time(NULL) to getmonotime() whichClaudio Jeker
uses CLOCK_MONOTONIC. Convert the control messages to return the relative age of the prefix instead of the absolute age. Adjust the mrt dump code to stil dump the route age in seconds since epoch as defined in the RFC. With this all times in bgpd are now based on CLOCK_MONOTONIC. OK denis@
2020-01-09Convert last_updown and last_read from time(3) to use getmonotime()Claudio Jeker
which returns clock_gettime(2) with CLOCK_MONOTONIC. While doing that introduce last_write for symetry. OK denis@
2020-01-08eye burning whitespaceTheo de Raadt
2020-01-01Instead of processing all imsg when reading them store peer specificClaudio Jeker
messages on a per peer queue. This queue is later processed one at a time resulting in a fairer processing of work and avoiding big table dumps to delay processing of other updates. OK denis@ benno@
2019-12-31The MRT draft turned into RFC6396, adjust comment.Claudio Jeker
2019-12-31In mrt_dump_hdr_rde() use clock_gettime(CLOCK_REALTIME, ) like it is doneClaudio Jeker
in mrt_dump_hdr_se(). Table dumps don't need time.tv_nsec like used in the _ET formats like for message and state changes but it keeps to code similar.
2019-12-31reloadtime is not needed anymore.Claudio Jeker
2019-12-16Instead of passing the peer id down to peer specific functions do the lookupClaudio Jeker
in the imsg handler and pass a struct rde_peer pointer to those functions. OK denis@
2019-12-13In rde_dispatch_imsg_session() reorder the case blocks a bit so theyClaudio Jeker
group better together.
2019-11-27struct ctl_show_rib does not need aspath_len since this information isClaudio Jeker
known through the imsg lenght. OK benno@
2019-11-10Consistently use _rcctl enable foo_ in examples, it's simpler and lessLandry Breuil
error prone than manually editing rc.conf.local, and also works to enable ipsec and accounting. tweak from schwarze@ to use the \(dq\(dq syntax for quotes in '.Dl foo_flags="" lines' instead of \&"\&". while at it, fix a reference to a bogus /dev/dhclient.conf file that recently snuck in. ok jmc@ deraadt@ schwarze@
2019-10-31Administrative Shutdown messages can be 255 byte long.Sebastian Benoit
ok claudio@
2019-10-30Add PREFIX_FLAG_STALE to mark prefixes in the Adj-RIB-Out as stale duringClaudio Jeker
graceful reload. At the same time extend peer_dump() to force all updates getting sent by adding every entry in the Adj-RIB-Out to the update tree unless they are PREFIX_FLAG_DEAD or PREFIX_FLAG_STALE. The latter will be removed during that stage since peer_dump() just did a full update of the Adj-RIB-Out. Also fix prefix_withdraw to check the correct prefix flags before removing a prefix from the update or withdraw tree. OK benno@
2019-10-29Replace the fatal non existing prefix call with a pt_add() call thatClaudio Jeker
actually inserts the missing prefix in the prefix tree. While for regular updates to the Adj-RIB-Out this case is indeed not reachable it is reachable when using 'export default-route'. Problem reported and fix tested by Esa Kuusisto. OK benno@
2019-10-29Fix two cases where the nexthop_runners tail queue can get corrupted.Claudio Jeker
First by requeuing an element that is already on the list and second by freeing a nexthop that is still on the list resulting in a use after free. This should fix bgpd crashes seen by various people. Problem report including backtrace from benno@ OK benno@
2019-10-04Buff; also, specify router-id per rfc6286.Richard Procter
MPLS VPN cluesticks supplied by Dylan Hall ok claudio@ jmc@
2019-10-04Instead of calling fatal() when pftable additions and deletions mixClaudio Jeker
commit the pending work and therefore start a new worklist. The delayed commits can cause such situations to happen and there is no reason to panic because of this. Problem found by jmc@ OK benno@
2019-10-02In IMSG_PFKEY_RELOAD do not warn about unknown peers. When a peer isClaudio Jeker
removed the session engine will issue a IMSG_PFKEY_RELOAD call after the parent has removed the peer which is no problem and so no need to fill the log with this. OK benno@
2019-10-02When removing a peer do the RB_REMOVE last and log the removal just beforeClaudio Jeker
that. OK benno@
2019-10-01Add some TCP MD5SUM specific calls needed by protable. On Linux systemsClaudio Jeker
there is no pfkey interface and instead the loading is done via setsockopts. To make this work correctly there are some additional functions needed when peers get reconfigured or when new listeners show up. OK benno@
2019-10-01Use the peer list from the right struct bgpd_config. Don't use the globalClaudio Jeker
conf here eventhough it is the same. OK benno@