summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/control.c
AgeCommit message (Collapse)Author
2019-02-12Handle the abnormal case of not having any neighbors defined a bit betterClaudio Jeker
when it comes to handling bgpctl show requests. OK phessler@
2019-01-20Support group descriptions in control messages that accept a neighborClaudio Jeker
description. With this it is possible to show rib a group of peers, to show or signal a group of peers all at once. OK sthen@ benno@
2018-12-27Check if a control socket or address is already in use befor using it.remi
If it is used abort startup or let a reload fail. Sockets are now not unlinked anymore on regular shutdown. This helps a lot when one tries to do a config check without -n. Inputs and OK claudio@
2018-12-22bgpctl can cause bgpd to do a lot of work (e.g. dumping all of the RIB)Claudio Jeker
but then bgpctl can quickly exit and bgpd still has to do all the work. Instead introduce a terminate imsg to stop such long running commands if bgpctl closes the connection before the run is over. OK benno@, sthen@, deraadt@
2018-11-28Start reworking community handling. Merge standard communities and largeClaudio Jeker
communities into one filter_community struct and allow it that more then one community can be used in filter rules (currently up to 3). Also rework the code handling bgpctl show rib commands. The special IMSG types for the various filters are gone and the code is in general simpler. OK job@, phessler@
2017-08-11softreconfig in and out are on by default for ever and machines now haveClaudio Jeker
enough memory that it does not make sense to provide these knobs anymore. They just make the code more complex for no much gain. OK phessler@, benno@
2017-08-10handle extended communities in bgpctl.Sebastian Benoit
From Dennis Fondras, thanks! ok phessler@
2017-05-28Implement an XON/XOFF protocol between the RDE and the SE to throttleClaudio Jeker
per control session and peer the generation of imsg in the RDE. This reduces the memory pressure in the SE substantially and also a bit in the RDE. Makes the RDE more responsive for bgpctl commands. Tested by me with 100 peers * 2000 prefixes and by phessler@ on an AMS-IX border router with 200+ session. Convergance time got quite a bit better. OK phessler@
2017-02-13draft-ietf-idr-shutdown extends to support a message on either ofPeter Hessler
"Administrative Shutdown" or "Administrative Reset" patch submitted by Job Snijders, thanks!
2017-01-24sync log.c from relayd et al to bgpd.Sebastian Benoit
there is still a little difference regarding handling of the verbosity value that will be handled later. ok claudio@ florian@
2017-01-13Add support for draft-ietf-idr-shutdownPeter Hessler
BGP state = Idle, marked down with shutdown reason "goodbye, we are upgrading to openbsd 6.1", down for 00:00:17 developed by Peter van Dijk <peter.van.dijk@powerdns.com> and Job Snijders <job@ntt.net>, thank you! OK benno@
2017-01-08Replace hand-rolled for(;;) traversal of ctl_conns TAILQ withKenneth R Westerback
TAILQ_FOREACH(). No intentional functional change. ok reyk@
2016-10-14Add support for draft-ietf-idr-large-communityPeter Hessler
Joint work with Job Snijders, many thanks! OK benno@ deraadt@
2015-12-05cleanup some log messages with wrong function names etc.Sebastian Benoit
ok henning,claudio
2015-12-05EAGAIN handling for imsg_read. OK henning@ benno@Claudio Jeker
2015-10-25Rename imsg_compose_parent and imsg_compose_rde to imsg_ctl_parent andClaudio Jeker
imsg_ctl_rde since these function should only be used by the control code. Also switch ibuf_rde to ibuf_rde_ctl so that the control imsgs don't need to queue behind all the incoming bgp UPDATES. This speeds up 'bgpctl show' from taking minutes to a few seconds. The RDE was doing this since a very long time but it seems the SE was not adjusted. Yikes
2015-10-24"bgpctl sh rib in" and "bgpctl sh rib out" require a neighbor argumentSebastian Benoit
to work. send an error if none is given. ok claudio@
2015-10-17Do no accept fds on the control socket; including the restricted socket.Reyk Floeter
OK gilles@ eric@
2015-04-26mlarkin asks "bgpctl checks the length of the control socket path toSebastian Benoit
make sure it fits. When browsing around last night I saw that bgpd does not. Any reason it shouldn't? Please commit" Add a check in parse.y to check this when reading the configuration. ok phessler@ henning@
2015-02-09Kill session_socket_blockmode() and replace it with SOCK_CLOEXEC orClaudio Jeker
SOCK_NONBLOCK and accept4(). OK henning@ tested & OK benno@
2013-11-13from claudioSebastian Benoit
"Let msgbuf_write return -1 with errno EAGAIN. The users then must check if this was the case and readd the event or poll again. The current handling in the imsg code is wrong for sure." ok gilles, benno
2013-03-11handle ECONNABORTED errors from accept(). In many code blocks they can beTheo de Raadt
ignored silently and without aborting, much like EINTR and EWOULDBLOCK are. ok's from various maintainers of these directories...
2013-03-07Implements a few missing bits for better templates support:Claudio Jeker
- on config reload also adjust the cloned neighbors so that they get the config changes as well. - clean up sessions that are 1h idle but in state active (instead of down) - add bits to allow bgpctl to destroy cloned neighbors Tested by sthen@ some time ago, OK phessler@
2012-05-27Extend the network code to allow attributes to be passed in with prefixes.Claudio Jeker
In the end this will allow anyone to use MRT table dumps to load prefixes into a bgpd instance. For example you can download the RIPE dumps and load full-feeds onto your laptop until the poor thing dies. OK henning@ sthen@
2012-04-12accept() pacing for bgpd based on similar work done on other daemons.Claudio Jeker
OK henning@ sthen@
2010-10-29malloc -> calloc for ctl_connHenning Brauer
pt out by cppcheck/jasper, ok sthen claudio
2010-05-03Make it possible to load multiple routing tables at the same time and useClaudio Jeker
those for alternate RIBs. This allows to use "rde rib TESTIT rtable 1". NOTE: nexthop verification has changed for alternate tables. For now nexthop will only be verified against the main routing table (id 0). Because of this "nexthop qualify via bgp" may now compare the nexthops against bgpd routes from a different RIB. Tested by sthen@, OK to move on by henning@
2010-01-13Add support for BGP MPLS VPN aka RFC 4364. This is only the RDE part soClaudio Jeker
that it is possible to use OpenBGPD as a route-reflector for VPNv4. Some clean up of the BGP MP code so that multiple protocols are easier supported. kroute/kernel support not yet done but comming. OK henning@, reyk@
2009-12-08porcesses -> processesJonathan Gray
2009-12-03A bgpctl nei XY clear should not restart neighbors that are administrativlyClaudio Jeker
down. So after a bgpctl reload clearing a neighbor will bring that neighbor into the configured state (in this case down). OK henning@
2009-12-02log_warn() consistency.Michael Knudsen
`OK' claudio
2009-12-01Use an artificial address family id in struct bgpd_addr and almost everywhereClaudio Jeker
else. Adds conversion functions to map AFI/SAFI and the Unix AF_ values from and into AID used in bgpd. This is needed to support things like MPLS VPN and other upcomming changes that need to play a lot with AFI/SAFI pairs. Mostly mechanical change, henning@ has no particular issues with this. Must go in so that I can continue working.
2009-11-02Implement IMSG_CTL_LOG_VERBOSE similar to ospfd. Even though bgpd has almostClaudio Jeker
no log_debug() it makes more sense to make all routing daemons behave the same.
2009-09-02Implement all of RFC 4486 BGP Cease Notification Message Subcodes.Claudio Jeker
The other side should now see why a session was dropped. e.g: bgpd: ... received notification: Cease, administratively down OK henning
2009-05-05check that an IMSG_CTL_SHOW_RIB_PREFIX request has a validStuart Henderson
address family before passing it to the RDE. ok henning@ claudio@
2008-05-11allow IMSG_CONTROL_SHOW_TIMER on restricted socketsHenning Brauer
2008-05-08make sure we always send back something on IMSG_CTL_SHOW_NEIGHBORHenning Brauer
namely, the "no such neighbor" case was missing. problem spotted by martin,ok claudio
2008-01-31do not leak confd on malloc failure in control_accept()Henning Brauer
found by Igor Zinovik <zinovik@cs.karelia.ru>
2007-12-23send timers for bgpctlshow neighbor foo timer in seperate messages afterHenning Brauer
the peer data. makes bgpctl display code independent from timer implementation internals. only running timers are displayed now, stopped ones are skipped.
2007-12-20rework timers.Henning Brauer
stop changing tienmr values directly, always use new timer_(get/set/stop/running) functions. preparation for more to come :) ok claudio
2007-03-28add IMSG_CTL_SHOW_RIB_COMMUNITY, rib by given communityHenning Brauer
mostly from rivo nurges <rix@estpak.ee>, ok claudio
2007-03-19when our red/recv/recvmsg in imsg_read gives EINTR or EAGAIN, do notHenning Brauer
signal "connection closed" upstream. spotted by Valentin Kozamernik <tin@komna.com>
2006-08-23Extend show rib interface code so that it is possible to show the adj-rib-inClaudio Jeker
and adj-rib-out. Additionally it is now possible to limit the output to a specified peer. OK henning@
2006-05-27Pass a IMSG_CTL_RESULT messgae back to bgpctl on reloads to indicate ifClaudio Jeker
the reload was successful or not. OK henning@
2006-05-27Cleanup with lint. Make the poll fd indexes unsigned and because of thatClaudio Jeker
control_accept should also return a unsigned int. Remove old prototype.
2006-05-23allow bgpd to request a route refresh from a neighbor if that neighborHenning Brauer
announced route refresh capabilities
2006-01-24introduce "bgpctl show summary terse", shows summary in an easy to parseHenning Brauer
format, intended for monitoring puposes. claudio ok
2006-01-24zap now unused varHenning Brauer
2006-01-24introduce a second control socket, which is restricted to certain messages,Henning Brauer
nameley the show ones. needed for looking glass style applications, monitoring etc. claudio ok
2006-01-03Track some (memory) statistics in the RDE. Accessible via bgpctl.Claudio Jeker