summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bgpd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant codedenis2020-06-051-2/+1
| | | | | | | Reported by Prof. Dr. Steffen Wendzel <wendzel @ hs-worms . de>, thanks! OK martijn@ sthen@
* list example files in FILES with a short description: generally, "Examplejmc2020-05-161-4/+4
| | | | | | | 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
* There is no reason to limit the string length of log_reason() to REASON_LENclaudio2020-05-111-5/+5
| | | | | charactars. Also fix a long line. OK benno@ deraadt@
* In bgpctl argument parser, re-arrange 'reason' parsing ('nei action [reason]')deraadt2020-05-107-43/+47
| | | | | | to be more generic, then change 'reload' to take take a '[reason]' also, which will be logged by bgpd. ok kn claudio
* Do not use string litterals in the grammar ("{") it is not POSIX compliantclaudio2020-05-081-3/+3
| | | | | | | 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@
* The warning "bad AGGREGATOR, AS 0 not allowed ..." is not very helpful.claudio2020-05-021-3/+5
| | | | | | 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@
* ce examples of "Ar arg Ar arg" with "Ar arg arg" and stop the spread;jmc2020-04-231-11/+11
|
* replace examples of "Ic arg Ic arg" with "Ic arg arg" and stop the spread;jmc2020-04-231-7/+7
|
* Try to document 'no local-address'claudio2020-04-231-2/+5
|
* Store local-address by address family. This allows to configure bothclaudio2020-04-236-29/+81
| | | | | | | | 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@
* The assumption that in roa tables a prefix / source-as combo only appearsclaudio2020-03-161-6/+15
| | | | | | | | | | 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@
* Tag "neighbor" and "group" keywords at their definitionskn2020-02-161-2/+4
| | | | | | | | | 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
* Rename copy_filterset() to filterset_copy() and move it to rde_filter.cclaudio2020-02-144-30/+34
| | | | | | where functions like filterset_move() live. Also initialize the dest TAILQ in filterset_copy() as it is done in filterset_move(). OK benno@ phessler@
* Move the code to figure out the alternate IP address (IPv6 addr for IPv4claudio2020-02-126-112/+104
| | | | | | | | | 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@
* mention /etc/examples/bgpd.conf; tweak and OK jmc@, OK benno@schwarze2020-02-091-3/+5
|
* usr.sbin/bgpd: replace TAILQ concatenation loop with TAILQ_CONCATbket2020-01-281-6/+2
| | | | OK florian@, benno@
* In nexthop_update() only add a nexthop to the nexthop_runners queue ifclaudio2020-01-251-4/+10
| | | | | | | | | | 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@
* kill double .Pp;jmc2020-01-251-3/+2
|
* Implement 'max-prefix NUM out' to limit the number of announced prefixes.claudio2020-01-2410-20/+88
| | | | | | | | 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@
* delete wasteful ;;deraadt2020-01-221-2/+2
| | | | ok tedu
* Add last_rcvd_errcode and last_rcvd_suberr to the peer_stats so thatclaudio2020-01-212-2/+8
| | | | | not only sent errors can be reported but also received ones. OK denis@ deraadt@
* Add some additional cease error subcodes as defined by iana.claudio2020-01-211-4/+8
| | | | OK denis@ deraadt@
* Fix a commentclaudio2020-01-211-2/+2
|
* Reorder assignements a bit so that all hashed values are togetherclaudio2020-01-101-6/+6
| | | | and the refcnt, hash and flags are also grouped.
* 'export default-route' still requires an output filter rule to announceclaudio2020-01-101-6/+20
| | | | | | | | 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@
* Instead of calling SipHash24_Update() in path_hash for each element ofclaudio2020-01-092-9/+7
| | | | | | 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@
* Clean up header a bit, remove peer_recv_eor and peer_send_eor prototypesclaudio2020-01-091-8/+6
| | | | and order prototypes like the functions in rde_peer.c
* Move peer related code from rde.c to rde_peer.c.claudio2020-01-093-540/+574
| | | | | | | 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@
* Convert the lastchange of a prefix from time(NULL) to getmonotime() whichclaudio2020-01-094-18/+21
| | | | | | | | 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@
* Convert last_updown and last_read from time(3) to use getmonotime()claudio2020-01-093-8/+12
| | | | | | which returns clock_gettime(2) with CLOCK_MONOTONIC. While doing that introduce last_write for symetry. OK denis@
* eye burning whitespacederaadt2020-01-084-8/+8
|
* Instead of processing all imsg when reading them store peer specificclaudio2020-01-014-97/+214
| | | | | | | 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@
* The MRT draft turned into RFC6396, adjust comment.claudio2019-12-311-2/+2
|
* In mrt_dump_hdr_rde() use clock_gettime(CLOCK_REALTIME, ) like it is doneclaudio2019-12-311-4/+5
| | | | | | 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.
* reloadtime is not needed anymore.claudio2019-12-311-3/+1
|
* Instead of passing the peer id down to peer specific functions do the lookupclaudio2019-12-161-72/+68
| | | | | in the imsg handler and pass a struct rde_peer pointer to those functions. OK denis@
* In rde_dispatch_imsg_session() reorder the case blocks a bit so theyclaudio2019-12-131-8/+8
| | | | group better together.
* struct ctl_show_rib does not need aspath_len since this information isclaudio2019-11-272-16/+11
| | | | | known through the imsg lenght. OK benno@
* Consistently use _rcctl enable foo_ in examples, it's simpler and lesslandry2019-11-101-12/+9
| | | | | | | | | | | | | 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@
* Administrative Shutdown messages can be 255 byte long.benno2019-10-311-3/+3
| | | | ok claudio@
* Add PREFIX_FLAG_STALE to mark prefixes in the Adj-RIB-Out as stale duringclaudio2019-10-303-28/+84
| | | | | | | | | | 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@
* Replace the fatal non existing prefix call with a pt_add() call thatclaudio2019-10-291-2/+2
| | | | | | | | 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@
* Fix two cases where the nexthop_runners tail queue can get corrupted.claudio2019-10-291-3/+9
| | | | | | | | 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@
* Buff; also, specify router-id per rfc6286.procter2019-10-041-139/+128
| | | | | MPLS VPN cluesticks supplied by Dylan Hall ok claudio@ jmc@
* Instead of calling fatal() when pftable additions and deletions mixclaudio2019-10-041-3/+6
| | | | | | | | 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@
* In IMSG_PFKEY_RELOAD do not warn about unknown peers. When a peer isclaudio2019-10-021-7/+6
| | | | | | | 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@
* When removing a peer do the RB_REMOVE last and log the removal just beforeclaudio2019-10-021-3/+3
| | | | | that. OK benno@
* Add some TCP MD5SUM specific calls needed by protable. On Linux systemsclaudio2019-10-013-7/+34
| | | | | | | 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@
* Use the peer list from the right struct bgpd_config. Don't use the globalclaudio2019-10-011-4/+4
| | | | | conf here eventhough it is the same. OK benno@
* Remove leftover pfkey_remove() call in session.c this code was moved toclaudio2019-10-011-2/+1
| | | | | the parent and the SE no longer has the pfkey socket open. OK benno@