summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
AgeCommit message (Collapse)Author
2010-05-04Add some documentation about the last change (nexthop verification andClaudio Jeker
extended rde rib syntax). OK sthen
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-04-28Allow neighbor-as in AS filter statements like:Claudio Jeker
match from any source-as neighbor-as set localpref 1000 OK henning@
2010-04-27imsg.h does not need sys/tree.h.Nicholas Marriott
ok eric
2010-04-26Add some { } for better readability and to make the code look like theClaudio Jeker
other blocks in this function.
2010-04-26Fix some memory leaks on config reload failure and move one particularClaudio Jeker
cleanup loop to parse.y where it belongs. OK henning@
2010-04-22Including bgpd.h in mrt.h is dumb.Claudio Jeker
2010-04-22Depending on capa.neg.as4byte (bgp session is using 4-byte AS numberClaudio Jeker
extension) we need to switch between _AS4 and non _AS4 types. The non _AS4 mrt types are totaly confused by 4-byte AS_PATH attributes since they expect 2-byte ones (and vice versa). Problem found and fix tested by Xiaoliang Zhao (xzhao at cernet edu cn).
2010-04-22Correct the BGP4MP subtypes according to draft-ietf-grow-mrt-11.Claudio Jeker
The _AS4 types where reversed and the local types are missing even though I'm not sure if bgpd will ever support them.
2010-04-20prefix_unlink() must remove the rib entry. Currently this was only doneClaudio Jeker
in prefix_destroy() but there is another caller of prefix_unlink() which missed the rib_remove() resulting in tree corruption and possible crashes. Doing the remove in prefix_unlink() is better since we do the same with the prefix and rib & prefix are linked. Fix some comments to match code and remove double call to pt_empty()/pt_remove(). Found while hacking on something else.
2010-04-16Memory allocated with calloc() is initialized to zero, no need to do thatClaudio Jeker
explicitly.
2010-04-13Instead of passing AF specific struct kroutes over imsgs use a structClaudio Jeker
kroute_full structure that is AF independent and has all information in it. Simplifies the communication between processes and reduces the number of imsg types. This is another step to add FIB support to BGP MPLS VPNs.
2010-04-07Remove XXX comment and just close received fd if calloc() fails.Nicholas Marriott
If this happens the imsg may no longer be usable as there may be queued messages, but this is a) already the case with the code now, and b) would be the case if recvmsg() fails anyway, so we can document that -1 from imsg_read() invalidates the struct imsgbuf. discussed with and ok eric
2010-04-07Call nexthop_delete() a bit later in nexthop_update(). The nh->state needsClaudio Jeker
to be changed before calling nexthop_delete() or the nexthop will not be correclty removed in the unlikly event when all aspathes move to a different nexthop while the lookup happens. sthen@ agrees with the logic.
2010-04-06Switch to a more address family independent nexthop imsg. Instead of passingClaudio Jeker
struct kroute or kroute6 pack the needed info into a struct bgpd_addr. No flames comming out of my and sthen@'s bgpd routers.
2010-03-31network static and network connected have been superseded by network inetClaudio Jeker
static and network inet connected a long time ago. It is time to remove the old compat code.
2010-03-30Hmpf, aid2af() leftover from the time I did the transition that should notClaudio Jeker
be there. network X set nexthop Y failed because of this.
2010-03-29I'm going to need community_ext_conv() outside of rde_attr.c soon, so moveClaudio Jeker
the prototype to rde.h
2010-03-29Since we always reload the config now there is no need to allocate theClaudio Jeker
filter list head. It is only used temporary in reconfigure(). OK henning
2010-03-29We always allocate rib ids dynamicaly so there is no need for allowingClaudio Jeker
fixed id allocation. Makes code simpler. OK henning
2010-03-29Implement a log_rd() function to print the route destinguisher in a niceClaudio Jeker
way. Use it for now in log_addr() to show VPN routes with a prepended RD. OK henning
2010-03-26pt_add() is not allowed to fail, caller expects this behaviour.Claudio Jeker
2010-03-26Be more careful when walking the tree looking for a non-empty element,Claudio Jeker
we may actually hit the end of the tree (at least in theory).
2010-03-05Allow to filter for ext-community attributes. Currently only perfect matchesClaudio Jeker
work but that's already better then nothing. OK sthen@
2010-03-03Compare against correct flag when printing "network inet6 static"Claudio Jeker
2010-03-03Replace enum rib_state with enum reconf_action since their doing the same.Claudio Jeker
NEW is now REINIT, ACTIVE is KEEP and DELETE and NONE stay the same.
2010-03-03Remove superfluous newlineClaudio Jeker
2010-02-26Fix some minor issues. 0 instead of NULL in one comparison. Set theClaudio Jeker
right flags when protecting the IPv6 loopback addr (instead of reassigning the IPv4 ones) and install the IPv4 loopback blocker as 127/8 and not as 127.0.0.1/8. First two found by Hiroki Sato hrs (at) allbsd org and I found the 127/8 issue all by myself.
2010-02-23Fix .Oo .Xo .Oc .Xc mis-nesting by just dropping the .Xo and .Xc which,Ingo Schwarze
in these cases, is useless anyway. Found by and fixing the build with mandoc; still fine with both old and new groff. ok jmc@
2010-02-23Remove some extra ().Claudio Jeker
2010-02-11Not knowing a AFI/SAFI pair in the MP capability is no reason to failClaudio Jeker
a session. Just print a warning and move on since both side need to announce a pair to use it. Found and OK sthen@
2010-02-11We need to load the config before kr_init() is called or fib-update isClaudio Jeker
ignored. Found and fix tested by Elisa Jasinska.
2010-02-11While looking through this code I figured out that set nexthop self andClaudio Jeker
no-modify are not supported for MP protocols like IPv6. Add support for those and while testing find another bug in the same region. Inverse the check for the return value of memcmp() -- we're interested in equality. Until now IPv6 was running with an implicit set nexthop self on all iBGP sessions. Oups. set nexthop stuff is OK when tested henning@ and sthen@
2010-02-09Don't hardcode the AID to AID_INET6 when sending MP EoR updates.Claudio Jeker
This will allow AID_VPN_IPv4 to do EoRs as well.
2010-02-08Unbreak IPv6 local address lookups. Some idiot aka me optimised a loop andClaudio Jeker
because of that either the IPv4 or IPv6 local address was not set. Because of this prefixes were sent out with all zero nexthops.
2010-02-08It is enough that peer->capa.mp[i] is non zero. It does not need to be 1.Claudio Jeker
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@
2010-01-11Do not crash when starting up with a bad config file. Check thatClaudio Jeker
conf.listen_addr is actually valid before deref.
2010-01-11lex <=, >=, !=, and >< into a single token for correctness and to reduce theTheo de Raadt
lookahead in the parser ok henning
2010-01-11Make sure we do not add trailing garbage while parsing a prefix that has aClaudio Jeker
prefixlen that is not a multiple of 8. Found while reading the RFC. OK henning@
2010-01-10Generate a EoR marker in the update list instead of sending it independentClaudio Jeker
of the actual update dump. This will get us the right barrier and the EoR is no longer sent way before the actual dump. Currently a nop since graceful restart is turned off (unless you have announce restart yes in the config). put it in henning@
2010-01-10Switch rib_dump() to use AID instead of AFs. OK henning@Claudio Jeker
2010-01-09Fix fatalx message.Claudio Jeker
2010-01-05Make sure that all important config variables are synced on a reload inClaudio Jeker
the SE. This got more important since we use the reload all the time now. Found out the hard way and fix tested by Laurent CARON
2009-12-31Instead of passing the config via arguments to the childs on bootup issueClaudio Jeker
a config reload as first step in bootup. This allows childs to start with an empty config and a lot of special cleanup code can bite the dust. Testing by myself and sthen@ with a few configs (more testing welcome). Seems like a good idea henning@ & sthen@
2009-12-18Merge rde_filter_community() with community_match() and kill a uselessClaudio Jeker
indirection.
2009-12-17Fix formatstring in printf.Claudio Jeker
2009-12-16Implement "set ext-community [delete] subtype key:value" to set and deleteClaudio Jeker
extended communities as specified in RFC 4360. No matching implemented yet and stuff like * and neighbor-as are neither supported but will be soon. Looks good henning & sthen, manpage fixed by jmc
2009-12-14addr2sa() will return NULL for AID_UNSPEC and pfkey_send() may end up withClaudio Jeker
one of the src/dst addrs as AID_UNSPEC. So we need to check for NULL before copying. Fixes a crash seen with tcp-md5 enabled peers.
2009-12-09parsecommunity() always works on a struct filter_community. So pass aClaudio Jeker
pointer to the struct instead of two int pointers.