summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/session.c
AgeCommit message (Collapse)Author
2005-05-24KNFClaudio Jeker
2005-05-23no need for endpwent()Henning Brauer
(you lost, theo)
2005-05-03setres[ug]id; ok claudio@Damien Miller
2005-03-30bgpd used to open listeners in advance in the parent and the SE pickedHenning Brauer
those it needed, closing all the others. this has some nasty races. so let the parent keep the list of listeners so it knows when it has to open a new one claudio ok, also tested by jason ackley
2005-03-28ewps, this was not supposed to creep inHenning Brauer
2005-03-28free rules_l if the initial config file parse failsHenning Brauer
2005-03-11shutdown() directly before close() is useless, theoHenning Brauer
2004-12-23in getpeerbydesc(), complain if we find more than one match and return NULLHenning Brauer
2004-12-23introduce getpeerbydesc(), find a peer by its descriptionHenning Brauer
2004-12-23lower latency by processing no more than 25 messages at once for each peerHenning Brauer
2004-12-07oups, little FSM error: when we're in CONNECT and get an CON_OPEN eventHenning Brauer
initialize and start the holdtimer, just like when we're in state ACTIVE.
2004-11-23Switch from a single filter_set to a linked list of sets. With this changeClaudio Jeker
it is possible to specify multiple communities. This is also the first step to better bgpd filters. OK henning@
2004-11-18embed two struct capabilities, one for the capas announced by the peer andHenning Brauer
one for the capas we announced him, into the session_up imsg to the RDE after brainstorming with claudio
2004-11-18add an instance of struct capabilities to peer_conf, and inheritHenning Brauer
peer->capa.ann from this
2004-11-18inside struct peer, replace the occurance of the older struct peer_capaHenning Brauer
by two instances of the new struct capabilities, one for announcements and one for the received capabilities
2004-11-18remove the global 'announce' flag from struct peer_capa, clearHenning Brauer
individual capability flags where needed
2004-11-18let peer->capa.mp_[v4|v6] contain the SAFI, don't just use it as boolHenning Brauer
2004-11-18introduce session_capa_mp() which adds the multiprotocol announcementsHenning Brauer
to OPEN messages. eases session_open() quite a bit and kills duplicate code claudio ok
2004-11-18add code to announce support for IPv6 Unicast.Henning Brauer
disabled for now, claudio ok
2004-11-18supress logging of subsequent connect() failures as long as:Henning Brauer
-the session alternates between Active and Connect. Other states reset logging -the error is the same as the last connect() error seen jajajaja claudio
2004-11-11Unbreak link local IPv6 sessions by setting the correct scope_id inClaudio Jeker
addr2sa. OK henning@
2004-11-10"not reached" does not help LINT use NOTREACHED instead and use it only inClaudio Jeker
places where needed. OK henning@
2004-11-02save the previous state in struct peer, claudio okHenning Brauer
2004-10-19allow neighbor definitions to depend on interface state.Henning Brauer
with this, if a neighbor is configured as dependent on carp0 for example, the neighbor will remain in state IDLE as long as carp0 is not master. once carp0 becomes master the session(s) depending on it immediately go to CONNECT (or ACTIVE, if they're configured passive), reducing failover time. claudio ok, with some input from ryan as well
2004-10-07use a static, const and prefilled u_int8_t[16] to check wether the markerHenning Brauer
at the beginning of each BGP message is all 1s instead of looping and comparing one by one
2004-10-05reject an all zero bgpid, following a similar suggestion fromHenning Brauer
pascal.gloor@spale.com
2004-09-22don't bother shrinking the pfd and index2peer arraysHenning Brauer
ok claudio
2004-09-16when a cloned peer goes back to IDLE state, don't remove him immediatelyHenning Brauer
but keep him around for some more time (an hour here). fixes an issue Arvid was reporting: when a cloned neighbor rejects our OPEN message due to capability negotiation (or missing implementation of those), we set a marker and retry without. However, if we remove the peer immediately, it gets freshly cloned on the next trial, with default settings, thus including capability negotiation, and thus failes again. this will also help with route flap dampening. ok claudio
2004-09-16imsg API cleanup:Henning Brauer
-kill imsg_compose_pid, imsg_compose_fdpass and imsg_create_pid -extend the original imsg_compose/_create API to take pid & fd too -make imsg_compose do imsg_create + imsg_add + imsg_close instead of duplicating the code -adjust all callers to the new API ok claudio
2004-09-16malloc the imsg buffers instead of having them staticly, suggested byHenning Brauer
micskye some time ago
2004-09-09correctly track peer count. fixes a memory corruption.Henning Brauer
exactly the same bug as in ntpd, but caused completely different... strange issues seen by arvid goetting who helped a lot in debugging, bug found after an ntpd issue showed up and I saw the relation. hunting with & ok claudio, otto, millert, ok deraadt
2004-08-11mrt dumps for cloned sessions did not work because the wrong address was used.Claudio Jeker
OK henning@
2004-08-11Cleanup on exit. OK henning@Claudio Jeker
2004-08-10Gahhh, why is this still around? It was never necessary to inform the parentClaudio Jeker
after fd passing. I thought I removed that some time ago... anyway now it is gone.
2004-08-06Forward IMSG_CTL_SHOW_NEIGHBOR messages to the rde so that we can reportClaudio Jeker
the current and max prefix count back to bgpctl. OK henning@
2004-08-04session_main() and rde_main() return... right, a pid. and a pid is a pid_tHenning Brauer
and not an int.
2004-07-13fix some typosJared Yanovich
ok henning otto
2004-07-042 more file descriptors for each RDE and SE inherited from the parentHenning Brauer
we should close
2004-07-03Switch mrt dumping to fd passing. This gives some speed up when extensiveClaudio Jeker
dumping is done. Acctually mrt dumps were broken because of the fd passing. The nice side effect is a much cleaner code, especially in the parent process. OK henning@
2004-06-22Precedence fix; ok henning@Alexander Guy
2004-06-22missing bzero in a function for this strange other address familyHenning Brauer
2004-06-22Templates with unknown AS where always configured as ebgp peers even ifClaudio Jeker
they were ibgp ones. OK henning@
2004-06-22so we call realloc() on our pollfd array and the peer_l one when they shrunkHenning Brauer
to save memory... yet, that realloc call can fail with ENOMEM ;) don't shrink when (needed + reserve < allocated), but (needed + 2 * reserve < allocated) the longer term goal is of course to not fail at all when a shrink-realloc fails... but that's for later
2004-06-20at least somewhat consistently name the TAILQ_ENTRYs... this confused meHenning Brauer
more than once
2004-06-20implement file descriptor passing in the imsg/msgbuf framework, and useHenning Brauer
it to let the main process to prepare new listening sockets (socket() and bind()) on behalf of the session engine, which of course cannot bind() to ports < 1024 any more once it dropped privileges. with some help from theo, claudio ok
2004-06-09move to a dynamically allocated struct pollfd array.Henning Brauer
we used a ststic one with OPEN_MAX entries, which is a rather arbitary limit as OPEN_MAX is _not_ the max # of open fds we can have, but just a default for that setting. in the same move we have to allocate the peer_l array, basically there for pfd-index to peer pointers to prevent peer list scans all time, dynamiccaly to. we overallocate a little and use that reserve until we have to realloc again later to prevent reallocs for every single control connection or a single flapping peer. help & ok claudio
2004-06-06rework bgpd's handling of listening sockets. instead of one for eachHenning Brauer
supported address familiy, keep a tailq of an arbitary number of them. the new struct listen_addr contains the sockaddr and the fd. this fixes quite some nasty behaviour which was a consequence of the previous model. looks right deraadt@, and discussed with claudio
2004-05-28detect absence of PF_KEY interface and/or the TCP_MD5SIG setsockoptsHenning Brauer
at runtime and disable said subsystems if so. helps the guys porting bgpd to $otherBSD, and is actually the right thing to do. claudio ok
2004-05-28don't want SO_REUSEPORT...Henning Brauer
2004-05-21Add support for dynamic announcements. Usefule to annouce temporaryClaudio Jeker
blackhole routes or to make network announcements dependent on a external state (e.g. for carp setups) OK henning@