summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/rde.c
AgeCommit message (Collapse)Author
2004-02-02spacesTheo de Raadt
2004-02-02Fix bug in the decision process. The decision process is unable to directlyClaudio Jeker
detect changes of the active prefix. This bug is only triggered when a nexthop changes state. While doing that clarify prefix_move a bit. OK henning@
2004-02-02Seal a memory leak and fix a format string, conf->as is unsigned.Claudio Jeker
OK henning@
2004-01-28catch SIGINT here as well so we can properly shut down if ^C'ed in debug modeHenning Brauer
2004-01-27move strict kroute from in_addr_t for nexthop and prefix to struct in_addrHenning Brauer
ok claudio
2004-01-27use a struct bgpd_addr instead of sockaddr_in for peer_config->local_addr andHenning Brauer
->remote_addr for easier multiprotocol support ok claudio@
2004-01-22provide a log_debug and use it in rde.c.Henning Brauer
with this, logit() can be a private function. we don't need to include syslog.h in bgpd.h any more; log.c and parse.y who need it include it directly now.
2004-01-22use log_peer_warnx() now that we can, claudio agreesHenning Brauer
2004-01-22use log_warnx and log_info. reclassify a few messages in the process and fixHenning Brauer
a few messages. ok claudio@
2004-01-17Make it possible to announce own networks. In the RDE these prefixes areClaudio Jeker
attached to a pseudo peer and inserted like all other prefixes into the RIB. OK henning@
2004-01-13Implement a max-prefix and a announce none | self | all neighbor statement.Claudio Jeker
The first limits the number of sent prefixes per peer the latter controls which prefix we do annouce to the neighbor. Another looks good from henning@
2004-01-13Better update error handling. Ensure that the session goes down andClaudio Jeker
ignore all queued updates after an error. Looks good henning@
2004-01-13Dump and send RIB to the neighbor if his session is comming up.Claudio Jeker
Now bgpctl neighbor <IP> up does work as expected. Looks good from henning@
2004-01-11KNFHenning Brauer
2004-01-11This comment is not true. We decided to use a separate struct kroute6Claudio Jeker
for IPv6.
2004-01-11remove obsolete commentHenning Brauer
2004-01-11Bad sizeof slipped in while resolving a conflict. OK henning@Claudio Jeker
2004-01-11Move all struct in_addr to either struct bgpd_addr or in_addr_t whicheverClaudio Jeker
is more appropriate. The rde uses now in most cases struct bgpd_addr. OK henning@
2004-01-11in the nexthop imsgs use struct bgpd_addr for the data part instead ofHenning Brauer
in_addr_t ok claudio@
2004-01-11Add to the IMSG_SESSION_UP message the local and remote address of theClaudio Jeker
peer session. This is needed to set the correct nexthop address in outgoing bgp UPDATES. OK henning@
2004-01-11KNFHenning Brauer
2004-01-10Implement as path prepends. At least one prepend is needed for ebgpClaudio Jeker
neighbors. Fix a bug in the update generation. If no path attributes are available e.g. a packet with only withdraws we need to set (and write) the bgp path attribute field to zero. With this change we are able to send valid updates to our neighbors with one exception: the nexthop field which needs to be changed for ebgp neighbors. OK henning@
2004-01-10RDE update generation. First we queue all updates and withdraws on a perClaudio Jeker
peer basis. A queue runner will dequeue and package those messages to valid bgp UPDATE messages and send them to the SE. Not yet done is per peer type attribute handling (like aspath prepends and nexthop modifications) and the queue runner could be a tad smarter. All in all this gives us a good starting point for the missing parts. OK henning@
2004-01-07Modified version of hennings last patch. OK henning@Claudio Jeker
2004-01-07don't ever send kroute change (that includes add) requests to the parentHenning Brauer
where the nexthop is not in state NEXTHOP_REACH. previously routes in state NEXTHOP_LOOKUP, i. e. not yet verified, were send to the parent process causing unnecessary and of course failing route add attempts, cluttering logs, etc. nexthops in state NEXTHOP_UNREACH were handled correctly.
2004-01-07Make sure that kroute updates for the FIB are only sent if there is aClaudio Jeker
change. Until now rde_send_kroute tried to send a IMSG_KROUTE_DELETE if old and new prefix where ineligible. OK henning@
2004-01-062004Henning Brauer
2004-01-05Big overhaul of the mrt code.Claudio Jeker
Dumping of incomming bgp messages is now possible and dumping the (not yet) filtered updates works too. Per neighbor dumps are still missing. OK henning@
2004-01-04split the dispatch_imsg function into twom one per pipe.Henning Brauer
with the amount of different msgs the RDE is handling the checks wether a msg was received on the "wrong" pipe make things less clear. also remove some outdated comments
2004-01-04in the SE, keep the remote router-id in network byte order, just likeHenning Brauer
every other IP address in the RDE, transform in into host byte order upon receival
2004-01-03move some session specific stuff to session.h and make the few filesHenning Brauer
that need it include that
2004-01-03decouple the peer list from bgpd_config.Henning Brauer
so many parts of bgpd are not at all interested in the session specific peer structs... allows for some further cleaning
2004-01-03change imsg_read semantics so that the number of bytes read is returned.Henning Brauer
that means that the callers can (and must) coope with closed connections themselves, what is exactly the desired behaviour.
2004-01-01now that imsg_get uses bigger buffers, one read call can put more than oneHenning Brauer
imsg into the buffer. since imsg_get by definition only returns one imsg we missed the next imsg(s) until the next poll event on the socket in question, building up a queue on that socket. didn't show up as a problem yet... factor out imsg_read, which reads into the buffer. imsg_get now entirely operates on the buffers and does not read(2) itself. make all callers cope by calling imsg_read on poll events and calling imsg_get in a loop until all imsgs are processed.
2003-12-27implement "no fib-update" much coolerHenning Brauer
2003-12-27do not print NULL nexthop (e.g. from a withdrawn route)Jakob Schlyter
2003-12-26print nexthop when logging. ok henning@Jakob Schlyter
2003-12-26"when you try to be very smart, something breaks horribly"Henning Brauer
zap aspath->state, which was a copy of aspath->nexthop->state, for a tiny little bit faster access. tho, it happened what had to happen, they ran out of sync. it's just not worth it. also add a missinf LIST_INIT.
2003-12-26when asking the kernel to add a route, send him the true nexthop and notHenning Brauer
the exit nexthop as the latter will only work if the two happen to be equal
2003-12-26add option 'log updates' to log updates. ok henning@Jakob Schlyter
2003-12-26let imsg_get and imsg_compose not fatal() but return errors upstream.Henning Brauer
make the callers cope.
2003-12-26when this project started and i added the fatal() function, I made it takeHenning Brauer
the error number as parameter instead of accessing errno, because in one place the error number was not in errno but fetched from a socket. now, of course it makes much more sense to just set errno to the error number just fecthed in this one place instead of having hundreds of fatal() calls all transfer the errno round and round and round... fix this, and also provide a fatalx, which does not care for errno and doesn't invoke strerror. oh, btw, in the place where we fetch the err # from the socket, we don't call fatal anymore anyway...
2003-12-25Turn the nexthop verification on. At least in the RDE.Claudio Jeker
ok henning@
2003-12-25RDE part of the nexthop verification puzzle.Claudio Jeker
The RDE just tracks the nexthop IPs and reacts on nexthop messages from the parent. ok henning@
2003-12-25kill IMSG_KROUTE_ADD as well. just send KROUTE_CHANGE requests.Henning Brauer
2003-12-24syscalls return -1 on err so test for == -1 instead of the < 0 found in veryHenning Brauer
few places, requested by theo
2003-12-24now that the main process can cleanup without RDE's help, we do not need theHenning Brauer
somewhat fragile IMSG_SHUTDOWN_* stuff any more. speeds shutdown up enourmously. ok claudio@
2003-12-24now that we keep track of the routes we added to the kernel we can removeHenning Brauer
them easily on shutdown without the RDE's help
2003-12-24add option to not touch the kernel routing tableHenning Brauer
2003-12-24handle write() returning 0 correctly, adjust the msgbuf API appropriately,Henning Brauer
and make all callers cope.