summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_zebra.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* lib, zebra: add AFI parameter to the ZEBRA_REDISTRIBUTE_DEFAULT_* messagesRenato Westphal2019-01-141-1/+2
| | | | | | | | | | | | | | | | | | | | | Some daemons like ospfd and isisd have the ability to advertise a default route to their peers only if one exists in the RIB. This is what the "default-information originate" commands do when used without the "always" parameter. For that to work, these daemons use the ZEBRA_REDISTRIBUTE_DEFAULT_ADD message to request default route information to zebra. The problem is that this message didn't have an AFI parameter, so a default route from any address-family would satisfy the requests from both daemons (e.g. ::/0 would trigger ospfd to advertise a default route to its peers, and 0.0.0.0/0 would trigger isisd to advertise a default route to its IPv6 peers). Fix this by adding an AFI parameter to the ZEBRA_REDISTRIBUTE_DEFAULT_{ADD,DELETE} messages and making the corresponding code changes. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: Replace zclient_new with zclient_new_notifyDonald Sharp2018-11-121-1/+1
| | | | | | | It's been a year since we added the new optional parameters to instantiation. Let's switch over to the new name. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: style for EC replacementsQuentin Young2018-09-131-3/+3
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: LIB_[ERR|WARN] -> EC_LIBQuentin Young2018-09-131-1/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: rename zlog_fer -> flog_errQuentin Young2018-08-141-1/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ospf6d: Update OSPFv3 to use new zlog_ferrDonald Sharp2018-08-141-3/+5
| | | | | | Update OSPFv3 to use the new zlog_ferr messages Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospf6d: remove ospf6_interface_if_delQuentin Young2018-04-131-7/+0
| | | | | | Unused and contains obvious NPD Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ospf6d: assign zebra router-id to ospf6 instanceChirag Shah2018-03-011-2/+11
| | | | | | | | | | | | | | | | | | | | Store zebra router-id in global structure. Before router ospf6 instance created, zebra router-id callback called. During ospf6 main execution zebra init happens, but default instance does not execute until cli replay 'router ospf6'. Call ospf6_router_id_change during 'router ospf6' to assign zebra router id to ospf6 instance. Ticket:CM-19937 Testing Done: Assign Loopback /32 (6.6.6.6/32) address, restart frr with (router ospf6 in frr.conf). ospf6 default instance assigned 6.6.6.6 router-id. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* ospf6d: router-id change notify to restart ospf6dChirag Shah2018-02-151-4/+3
| | | | | | | | | | | Notify user to store config and restart ospf6d as part of router-id change cli if any of the area active. Store zebra router-id under ospf6, when static router-id removed restore zebra router-id, ask to restart ospf6d. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* *: Track vrfs per nexthop not per route entryDonald Sharp2018-02-091-3/+0
| | | | | | | Track the vfrs on a per nexthop basis instead of on a per route entry basis. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Send/receive the nexthop vrf_idDonald Sharp2018-01-121-0/+3
| | | | | | | Modify the code to send and receive to/from zebra the nexthops vrf_id. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Make zapi route install Notifications optionalDonald Sharp2017-11-271-1/+1
| | | | | | | | | | | Allow the higher level protocol to specify if it would like to receive notifications about it's routes that it has installed. I've purposely made it part of zclient_new_notify because we need to track the routes on a per daemon basis only. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib, ospf6d, ospfd, zebra: Add ZEBRA_STRDonald Sharp2017-10-251-1/+1
| | | | | | Allow us to use a ZEBRA_STR for commands Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Modify zclient_init to require privs dataDonald Sharp2017-10-241-1/+1
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: introduce new rb-tree to optimize interface lookup by ifindexRenato Westphal2017-10-101-1/+1
| | | | | | | | | | | | | | | | Performance tests showed that, when running on a system with a large number of interfaces, some daemons would spend a considerable amount of time in the if_lookup_by_index() function. Introduce a new rb-tree to solve this problem. With this change, we need to use the if_set_index() function whenever we want to change the ifindex of an interface. This is necessary to ensure that the 'ifaces_by_index' rb-tree is updated accordingly. The return value of all insert/remove operations in the interface rb-trees is checked to ensure that an error is logged if a corruption is detected. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: eliminate IFINDEX_DELETED in favor of IFINDEX_INTERNALRenato Westphal2017-10-101-1/+1
| | | | | | | | | IFINDEX_DELETED is not necessary anymore as we moved from a global list of interfaces to a list of interfaces per VRF. This reverts commit 84361d615. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: fix segfault when sending more than MULTIPATH_NUM nexthopsRenato Westphal2017-09-211-2/+2
| | | | | | | | | | | | | This is a fallout from PR #1022 (zapi consolidation). In the early days, the client daemons would allocate enough memory to send all nexthops to zebra. Then zebra would add all nexthops to the RIB and respect MULTIPATH_NUM only when installing the routes in the kernel. Now things are different and the client daemons can send at most MULTIPATH_NUM nexthops to zebra, and failure to respect that will result in a buffer overflow. The MULTIPATH_NUM limit in the new zebra API is a small price we pay to avoid allocating memory for each route sent to zebra. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Merge pull request #1044 from donaldsharp/combinationJafar Al-Gharaibeh2017-08-311-5/+1
|\ | | | | Coverity Cleanup of Stuff
| * *: fix assorted issues detected by Coverity ScanRenato Westphal2017-08-251-5/+1
| | | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | *: remove ZEBRA_FLAG_{BLACKHOLE,REJECT} from APIDavid Lamparter2017-08-281-2/+2
|/ | | | | | | | FLAG_BLACKHOLE is used for different things in different places. remove it from the zclient API, instead indicate blackholes as proper nexthops inside the message. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: use zapi_route to send/receive redistributed routes as wellRenato Westphal2017-08-241-68/+18
| | | | | | | | | | | | | | | | | | Some differences compared to the old API: * Now the redistributed routes are sent using address-family independent messages (ZEBRA_REDISTRIBUTE_ROUTE_ADD and ZEBRA_REDISTRIBUTE_ROUTE_DEL). This allows us to unify the ipv4/ipv6 zclient callbacks in the client daemons and thus remove a lot of duplicate code; * Now zebra sends all nexthops of the redistributed routes to the client daemons, not only the first one. This shouldn't have any noticeable performance implications and will allow us to remove an ugly exception we had for ldpd (which needs to know all nexthops of the redistributed routes). The other client daemons can simply ignore the nexthops if they want or consult just the first one (e.g. ospfd/ospf6d/ripd/ripngd). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* ospf6d: use the new API to send routes to zebraRenato Westphal2017-08-231-68/+25
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: remove leftovers from "router zebra"Renato Westphal2017-08-231-112/+1
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: reduce excessive indentation in a few placesRenato Westphal2017-08-231-67/+71
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Revert "*: reindent pt. 2"David Lamparter2017-07-221-2/+1
| | | | | | | | | This reverts commit c14777c6bfd0a446c85243d3a9835054a259c276. clang 5 is not widely available enough for people to indent with. This is particularly problematic when rebasing/adjusting branches. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: reindent pt. 2whitespace / reindent2017-07-171-1/+2
| | | | | | | | w/ clang 5 * reflow comments * struct members go 1 per line * binpack algo was adjusted
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-700/+654
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge remote-tracking branch 'frr/master' into newline-reduxDavid Lamparter2017-07-141-3/+3
|\ | | | | | | | | | | Lots of conflicts from CMD_WARNING_CONFIG_FAILED... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * vtysh: return non-zero for configuration failuresDaniel Walton2017-07-131-4/+4
| | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> This allows frr-reload.py (or anything else that scripts via vtysh) to know if the vtysh command worked or hit an error.
* | *: remove VTYNL, part 4 of 6David Lamparter2017-07-141-5/+4
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: remove VTYNL, part 2 of 6David Lamparter2017-07-141-11/+11
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | ospf6d: VNL -> VTYNLDavid Lamparter2017-07-141-13/+13
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: ditch vty_outln(), part 1 of 2David Lamparter2017-07-131-3/+3
|/ | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: use vty_outlnQuentin Young2017-06-291-3/+3
| | | | | | Saves 400 lines Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ospf6d: Make 'show zebra' 'show ipv6 ospf6 zebra'Donald Sharp2017-05-181-6/+5
| | | | | | | | | The 'show zebra' command really shouldn't be owned by ospf6. This command is a specialized command to show some basic information about ospf6 and zebra so limit it to ospf6. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-4/+3
| | | | | | | | | | | The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospf6d: Fix redistribution debug knowledgeDonald Sharp2017-05-031-1/+1
| | | | | | | When redistributing into ospfv3 specify that the route is add or delete correctly. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospf6d: Fix write beyond data structureDonald Sharp2017-03-011-7/+7
| | | | | | | | Converting a 'struct prefix6' to a 'struct prefix' and then doing a memcpy of the contents writes beyond the end of the data structure. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: read and ignore srcdest routes on ZAPIChristian Franke2017-01-301-1/+13
| | | | | | | | | | | | | | Since zebra might be sending srcdest routes down to the various daemons, they need to understand the presence of the field at the very least. Sadly, that's also the best we can do at this point since none of the protocols has support for handling srcdest routes. The only consistent thing to do is to ignore them throughout. If an administrator wants to have the srcdest route as non-srcdest in a protocol, setting a non-srcdest static route (possibly blackhole) is probably the best way to go. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: send ZAPI IPv6 source prefixDavid Lamparter2017-01-301-4/+4
| | | | | | | | | | | | This introduces ZAPI_MESSAGE_SRCPFX, and if set adds a source prefix field to ZAPI IPv6 route messages sent from daemons to zebra. The function calls all have a new prefix_ipv6 * argument specifying the source, or NULL. All daemons currently supply NULL. Zebra support for processing the field was added in the previous patch, however, zebra does not do anything useful with the value yet. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge branch 'cmaster-next' into vtysh-grammarQuentin Young2016-10-211-0/+150
|\ | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com> Conflicts: bgpd/bgp_encap.c bgpd/bgp_route.c lib/command.c lib/command.h ospf6d/ospf6d.c vtysh/vtysh.c
| * ospf6d: implement admin distanceMaitane Zotes2016-10-201-0/+150
| | | | | | | | | | | | | | | | Until today the admin distance cannot be configured for any IPv6 routing protocol. This patch implements it for ospf6. Signed-off-by: Maitane Zotes <maz@open.ch> Signed-off-by: Roman Hoog Antink <rha@open.ch>
* | Merge branch 'cmaster-next' into vtysh-grammarQuentin Young2016-10-181-10/+15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com> Conflicts: bgpd/bgp_route.c bgpd/bgp_routemap.c bgpd/bgp_vty.c isisd/isis_redist.c isisd/isis_routemap.c isisd/isis_vty.c isisd/isisd.c lib/command.c lib/distribute.c lib/if.c lib/keychain.c lib/routemap.c lib/routemap.h ospf6d/ospf6_asbr.c ospf6d/ospf6_interface.c ospf6d/ospf6_neighbor.c ospf6d/ospf6_top.c ospf6d/ospf6_zebra.c ospf6d/ospf6d.c ospfd/ospf_routemap.c ospfd/ospf_vty.c ripd/rip_routemap.c ripngd/ripng_routemap.c vtysh/extract.pl.in vtysh/vtysh.c zebra/interface.c zebra/irdp_interface.c zebra/rt_netlink.c zebra/rtadv.c zebra/test_main.c zebra/zebra_routemap.c zebra/zebra_vty.c
| * *: Consolidate all double VIEW_NODE and ENABLE_NODE'sDonald Sharp2016-10-081-1/+0
| | | | | | | | | | | | | | | | If a command is put into the VIEW_NODE, it is going into the ENABLE_NODE as well. This is especially true for show commands. As such if a command is in both consolidate it down to VIEW_NODE. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * ospf6d: add support for route tagsChristian Franke2016-10-081-3/+13
| | | | | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>
| * Make route flags a 32bit fieldChristian Franke2016-09-231-1/+1
| | | | | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>
| * lib: Check prefix length from zebra is sensiblePaul Jakma2016-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * zclient.c: prefix length on router-id and interface address add messages not sanity checked. fix. * */*_zebra.c: Prefix length on zebra route read was not checked, and clients use it to write to storage. An evil zebra could overflow client structures by sending overly long prefixlen. Prompted by discussions with: Donald Sharp <sharpd@cumulusnetworks.com>
| * Revert "Make route flags a 32bit field"Donald Sharp2016-09-231-1/+1
| | | | | | | | This reverts commit 85eda2c98520a9553bdc05c136618f9d04917e9b.
| * Make route flags a 32bit fieldChristian Franke2016-09-231-1/+1
| | | | | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>