summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_rib.c
Commit message (Collapse)AuthorAgeFilesLines
* Don't delete too many routes.Joakim Tjernlund2009-05-061-1/+8
| | | | | | | | | | If there are two paralell PtP links to the same router: C * 192.168.101.112/32 is directly connected, p1-4-19-4-20 C>* 192.168.101.112/32 is directly connected, p1-4-17-4-18 and the cable is to one of the ppp links is pulled, Zebra deletes both routes instead of just the one that got yanked. This fixes it to only delete the route to the interface that got yanked.
* Handle kernel flush when address is deletedStephen Hemminger2009-04-291-0/+61
| | | | | | | When interface addresses are deleted, the kernel will flush all routes. Quagga needs to follow this correctly. Relates to DHCP bugs 4314, 4315, ...
* Use correct buffer size for inet_ntop()Stephen Hemminger2009-04-281-17/+17
| | | | | Don't need big buffer 1024 to hold IPV4 (INET_ADDRSTRLEN) or IPV6 (INET6_ADDRSTRLEN) message.
* Rename rib_system_route to interface_manage_modeStephen Hemminger2009-04-281-12/+17
| | | | More descriptive name which matches usage.
* Keep quagga away from kernel routesStephen Hemminger2009-04-131-17/+7
| | | | | | | Any route created via 'ip route' etc, is a kernel route, and Quagga needs to not be trying to add/remove it from FIB on link events. It is probably something like openvpn, dhcp, etc, which can take care of it's own route events.
* Fix compiler warningsStephen Hemminger2009-04-131-4/+4
| | | | Resolve gcc warnings about signed/unsigned and missing parens
* zebra: minor whitespace stuffStephen Hemminger2009-02-091-0/+1
|
* Add diagnostic messagesStephen Hemminger2008-12-231-2/+3
| | | | More diagnostic messages in case of updating existing route.
* Fix recursive route handlingStephen Hemminger2008-12-221-7/+30
| | | | If route type or other index changes flag it as changed.
* Remember protocol as well as scope in RIBStephen Hemminger2008-12-021-2/+4
| | | | | | | This addresses potential issues with link management when multiple routing protocols are in use. Also fix non-linux build issues
* fix ipv6 typo in recursive route update codeStephen Hemminger2008-09-181-1/+1
|
* remove incorrect debug messageStephen Hemminger2008-09-181-2/+0
|
* Use XCALLOCStephen Hemminger2008-08-181-20/+10
| | | | Replace calls to XMALLOC followed by memset with XCALLOC.
* Manage system routes with zebraStephen Hemminger2008-08-151-26/+42
| | | | | | This adds a new flag to the zebra daemon that causes it to add and remove system routes (ie connected and kernel routes). This causes user space (zebra) to do what the kernel was doing in hollwood.
* Cleanup meta-queue codeStephen Hemminger2008-08-111-64/+70
| | | | | | | | Do some cleanup work on recently added meta-queue code: * use table rather than switch * indent with quagga standard indentation * since meta_queue_new is only used at initialization allocation failure should be fatal.
* Realign rib code with upstreamStephen Hemminger2008-08-011-33/+31
| | | | May also fix one issue with ipv6 static routes.
* Make metaqueue functions staticStephen Hemminger2008-08-011-5/+5
| | | | This stuff is only used in RIB code
* Merge branch 'upstream' into islavistaStephen Hemminger2008-07-311-27/+133
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: ChangeLog NEWS bgpd/ChangeLog bgpd/bgp_attr.c bgpd/bgp_network.c bgpd/bgp_packet.c bgpd/bgp_vty.c bgpd/bgpd.c bgpd/bgpd.h lib/sockopt.c lib/sockopt.h lib/zebra.h mkinstalldirs zebra/rib.h zebra/rt_netlink.c
| * + initial edition of meta-queue for RIB updates processing (bug #431)pilot2008-06-021-27/+133
| |
| * + fix bug#326 by rib_lookup_and_pushup()pilot2008-02-261-0/+56
| |
| * [link-detect] Static interface routes should behave properly with link-detect.ajs2008-01-081-3/+3
| | | | | | | | | | | | | | | | 2008-01-08 Michael Larson <mike@vyatta.com> * zebra_rib.c: (nexthop_active_check) Replace if_is_up with if_is_operative to solve problems with static interface routes not behaving properly with link-detect.
| * + rib_process() speedup for multi-nexthop route nodespilot2007-10-041-2/+3
| |
| * + Minor bugfix: IPv6 prefixes were logged incorrectly in RIB debugging ↵pilot2007-10-031-10/+10
| | | | | | | | calls. Fixed.
| * Merged own patch for bug #390 (rewrite ↵pilot2007-08-141-12/+17
| | | | | | | | zebra/zebra_rib.c:nexthop_active_update())
| * Merged own patch for the bug #391 (debugging and comments mostly).pilot2007-08-131-5/+235
| |
| * [zebra] Add extra debug logging for RIB and RIB queueingpaul2007-08-061-19/+51
| | | | | | | | | | | | | | 2007-08-06 Denis Ovsienko * zebra_rib.c: (general) Add extra debug logging for RIB and RIB queue.
| * [zebra] rib loop check for RIB_ENTRY_REMOVED checks wrong varpaul2007-06-271-1/+1
| | | | | | | | | | | | | | | | | | 2007-06-25 Denis Ovsienko * zebra_rib.c: (rib_add_ipv4_multipath) Loop through RIB is using 'same' variable, but RIB_ENTRY_REMOVED check is testing the constant 'rib' variable, fix. Impact unknown at this point.
| * [zebra] Routemap support on received routes, with 'set src' command (linux)paul2007-05-021-10/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2007-05-01 David L Stevens <dlstevens@us.ibm.com> * (general) These changes collectively add route-map and prefix-list support to zebra and fix a bug in "show route-map" (with no argument). * doc/main.texi: added route-map, prefix-list, ip protocol and set src documentation * lib/command.h: added PROTOCOL_NODE type * lib/log.c: (proto_name2num) new function, protocol name to number translation. * lib/routemap.c: (vty_show_route_map) fixed "show route-map" without route-map name * lib/routemap.h: added RMAP_ZEBRA type * lib/zebra.h: added proto_name2num() prototype * vtysh/extract.pl.in: added VTYSH_ZEBRA flag for route-map and plist * vtysh/Makefile.am: added zebra_routemap.c * vtysh/vtysh.h: added VTYSH_ZEBRA flag to VTYSH_RMAP * zebra/connected.c: (connected_up_ipv4) added src preference argument to rib_add_ipv4() * zebra/kernel_socket.c: (rtm_read) ditto * zebra/main.c: added prefix list initialization * zebra/Makefile.am: added zebra_routemap.c source file * zebra/rib.h: added generic address union "g_addr" and use in existing places that had an explicit union. Added "src" to struct nexthop. Added preferred src arg to nexthop_ipv4_add and rib_add_ipv4. * zebra/rt_netlink.c: (netlink_routing_table) set preferred source on netlink messages. (netlink_route_change) ditto (netlink_route_multipath) ditto. * zebra/rtread_getmsg.c: (handle_route_entry) added (NULL) src to rib_add_ipv4() call. * zebra/rtread_proc.c: (proc_route_read) ditto * zebra/zebra_rib.c: (nexthop_ipv4_add) add src argument. (nexthop_ipv4_ifindex_add) ditto (rib_add_ipv4) ditto (nexthop_active_check) Add route-map processing. * zebra/zebra_routemap.c: new file for zebra route-map commands. * zebra/zebra_vty.c: (ip_protocol_cmd) Apply route-map to protocol (vty_show_ip_route_detail) added "src" printing (vty_show_ip_route) ditto (show_ip_protocol_cmd) new command, list routemaps. (config_write_protocol) write out routemap protocl config. (zebra_vty_init) Install the new routemap protocol commands. * zebra/zserv.c: (zread_ipv4_add) added (NULL) src arg (zebra_init) init zebra route-maps. * zebra/zserv.h: add zebra_route_map_init
| * [zebra] Changes of nexthops of static routes didnt take effectpaul2006-12-081-10/+12
| | | | | | | | | | | | | | | | 2006-12-08 Piotr Chytla <pch@packetconsulting.pl> * zebra_rib.c: (static_install_ipv{4,6}) Case where existing RIB is updated must explicitely rib_addqueue the route_node, to ensure the update actually takes effect.
| * [zebra] Bug #268, Fix race between add/delete of routes, sanitise rib queueingpaul2006-07-271-170/+251
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2006-07-27 Paul Jakma <paul.jakma@sun.com> * rib.h: (struct rib) Add a route_node rn_status flag field, this has to be copied every time head RIB of a route_node changes. Remove the rib lock field, not needed - see below. Add a status field for RIB-private flags. * zebra_rib.c: Add a global for the workqueue hold time, useful for testing. (general) Fix for bug #268. Problem originally detailed by Simon Bryden in [quagga-dev 4001]. Essentially, add/delete of a RIB must happen /before/ the queue. Best-path selection (ie rib_process) and reaping of freed RIBs can then be done after queueing. Only the route_node is queued - no important RIB state (i.e. whether a RIB is to be deleted) is queued. (struct zebra_queue_node_t) Disappears, no longer need to track multiple things on the queue, only the route_node. (rib_{lock,unlock}) removed, RIBs no longer need to be refcounted, no longer queued. (rib_queue_qnode_del) Removed, deleted RIBs no longer deleted via the queue. (rib_queue_add_qnode) deleted (rib_queue_add) Only the route_node is queued for best-path selection, we can check whether it is already queued or not and avoid queueing same node twice - struct rib * argument is not needed. (rib_link/unlink) (un)link RIB from route_node. (rib_{add,del}node) Front-end to updates of a RIB. (rib_process) Reap any deleted RIBs via rib_unlink. Unset the route_node 'QUEUED' flag. (General) Remove calls to rib_queue_add where add/del node was called - not needed, update calls where not. Ignore RIB_ENTRY_REMOVEd ribs in loops through route_nodes
| * [zebra] Add test rig code, for testing the zebra RIBpaul2006-07-271-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2006-07-27 Paul Jakma <paul.jakma@sun.com> * {ioctl,kernel}_null.c: Dummy/Null kernel method implementations, useful for testing zebra code that calls such methods. * {redistribute,misc}_null.c: Dummy/Null methods, as above. But for zclient, and for various misc functions. * test_main.c: Test harness for zebra, currently just to test the RIB. * Makefile.am: Build testzebra using above. * zebra_rib.c: Add a global for the workqueue hold time, useful for testing.
| * [zebra] Connected routes must always be added to main tablepaul2006-07-271-0/+1
| | | | | | | | | | | | | | | | | | | | 2006-07-27 Rumen Svobodnikov <rumen@telecoms.bg> * connected.c: (connected_up_ipv4) interface connected routes always go to table main (or otherwise they cannot be used by linux as nexthops) * zserv.c: (zread_ipv4_add) send route to the correct routing table * zebra_rib.c (static_install_ipv4) set routing table
| * [zebra] Fix CID #104, check addr for null, and #18, check nexthop type argspaul2006-07-021-0/+8
| | | | | | | | | | | | | | | | | | 2006-07-02 Paul Jakma <paul.jakma@sun.com> * rt_netlink.c: (netlink_interface_addr) Fix CID #104, can not proceed if addr is NULL. * zebra_rib.c: (static_add_ipv6) Fix CID #18, double check required arguments are supplied for the given nexthop type.
| * [zebra] Fix pauls zebra_rib/rib_process commit mistakes, again.paul2006-01-301-5/+7
| | | | | | | | | | | | | | | | | | 2006-01-30 Paul Jakma <paul.jakma@sun.com> * zebra_rib.c: (rib_process) Fourth time lucky on this jinxed commit, last commit had a hole that could allow connected route selection to escape beyond the connected route logic. This time I cross-checked with Gunnar first. ;)
| * [zebra] Fix incorrect changes made in RIB metric selection patchquagga_0_99_3_releasepaul2006-01-251-4/+26
| | | | | | | | | | | | | | | | 2006-01-25 Gunnar Stigen <gunnar.stigen@axxessit.no> * zebra_rib.c: (rib_process) Application of Gunnar's earlier metric selection RIB change included incorrect tidy-ups made by commiter. Fix. (NB: any errors here are again due to paul).
| * [compiler] miscellaneous trivial compiler warning fixespaul2006-01-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 2006-01-19 Paul Jakma <paul.jakma@sun.com> * (general) various miscellaneous compiler warning fixes. Remove redundant break statements from switch clauses which return. return from main, not exit, cause it annoys SOS. Remove stray semi-colons which cause empty-statement warnings. * zebra/main.c: (sighup) remove private declaration of external function.
| * 2006-01-18 Gunnar Stigen <gunnar.stigen@axxessit.no>paul2006-01-181-4/+17
| | | | | | | | * zebra_rib.c: Take interface metric into account.
| * 2005-11-14 Paul Jakma <paul.jakma@sun.com>paul2005-11-141-6/+6
| | | | | | | | | | | | | | | | | | * zebra_rib.c: (rib_process) convert to new workqueue specs and shut up gcc, which complains about cast from void via function parameters, for some dumb reason. Do the cast inside the function instead. (rib_queue_qnode_del) ditto. (rib_queue_init) no need for the casts anymore.
| * * zebra_rib.c: Reduce the height of some staircases. Fixhasso2005-09-211-83/+59
| | | | | | | | | | rib_delete_ipv6() to match routes in the RIB by their gateway as well as by destination.
| * 2005-09-21 Paul Jakma <paul.jakma@sun.com>paul2005-09-211-2/+6
| | | | | | | | | | | | | | | | | | * zebra_rib.c: (static_uninstall_ipv{4,6}) Fix regression wrt removal of static routes with multiple-hops introduced with the workqueue conversion. We should free the relevant nexthop and then get rib_process to run, otherwise we just get same static route back again (with no way to unconfigure it, because its already deleted from configuration).
| * * zebra_rib.c, rib.h: Add distance and metric arguments to thehasso2005-08-271-5/+4
| | | | | | | | | | | | | | | | | | | | rib_add_ipv6() function so that IPv6 routes in RIB can have correct metric. No IPv6 routing daemon uses distance yet though. * zserv.c, connected.c, kernel_socket.c, rt_netlink.c, rtread_proc.c,zserv.c: Pass metric and distance info to the rib_add_ipv6(). Forwardport from stable branch.
| * 2005-06-28 Paul Jakma <paul.jakma@sun.com>paul2005-06-281-42/+42
| | | | | | | | | | | | | | * (global) Extern and static'ification, with related fixups of declarations, ensuring files include their own headers, etc. if_ioctl.c: (interface_info_ioctl) fix obvious arg mis-order in list loop
| * 2005-04-28 Paul Jakma <paul.jakma@sun.com>paul2005-04-281-144/+253
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rib.h: (struct rib) Add lock field for refcounting. * zserv.h: (struct zebra_t) Add a ribq workqueue to the zebra 'master' struct. * zserv.c: (zread_ipv4_add) XMALLOC then memset should be XCALLOC. * zebra_rib.c: Clean up refcounting of route_node, make struct rib refcounted and convert rib_process to work-queue. In general, rib's should be rib_addnode'd and delnode'd to route_nodes, and these symmetrical functions will manage the locking of referenced route_node and freeing of struct rib - rather than having users manage each seperately - with much scope for bugs.. (newrib_free) removed and replaced with rib_lock (rib_lock) new function, check state of lock and increment. (rib_unlock) new function, check lock state and decrement. Free struct rib if refcount hits 0, freeing struct nexthop's, as newrib_free did. (rib_addnode) Add RIB to route_node, locking both. (rib_delnode) Delete RIB from route_node, unlocking each. (rib_process) Converted to a work-queue work function. Functional changes are minimal, just arguments, comments and whitespace. (rib_queue_add_qnode) Helper function to setup a ribq item. (rib_queue_add) Helper function, same arguments as old rib_process, to replace in callers of rib_process. (rib_queue_qnode_del) ribq deconstructor. (rib_queue_init) Create the ribq. (rib_init) call rib_queue_init. (remainder) Sanitise refcounting of route_node's. Convert to rib_queue_add, rib_addnode and rib_delnode. Change XMALLOC/memset to XCALLOC. Remove calls to nexthop_delete and nexthop_free.
| * 2005-03-14 Paul Jakma <paul.jakma@sun.com>paul2005-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | * (global) update all c files to match the lib/vector.h rename of (struct vector).active to max, and vector_max macro to vector_active. * lib/vector.h: Rename to (struct vector).max to slightly less confusing active, for the number of active slots, distinct from allocated or active-and-not-empty. Rename vector_max to vector_active for same reason.
| * 2004-12-07 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2004-12-071-9/+9
| | | | | | | | * *.c: Change level of debug messages to LOG_DEBUG.
| * Some compiler warnings fixes and fix for bugzilla #119.hasso2004-10-121-4/+5
| |
| * Fix warnings. Didn't even look at files not compiled in Linux though.hasso2004-10-071-2/+2
| |
| * Merge isisd into the Quagga's framework:jardin2003-12-231-0/+1
| | | | | | | | | | | | | | | | | | | | - add privs support - use misc quagga's definitions - make it compile"able" - fix segfault cases related to hostname() - add debug isis xxx command This patch has been approved by Paul Jakma.
| * 2003-11-02 Krzysztof Oledzki <oleq@ans.pl>paul2003-11-021-0/+2
| | | | | | | | | | | | * zebra/zebra_rib.c: Revert patch (dating from zebra.org) which caused zebra to read all routes in all tables, rather than just the main table. See [quagga-dev 280].
| * 2003-10-27 Gilad Arnold <gilad.arnold@terayon.com>paul2003-10-281-7/+13
| | | | | | | | | | | | | | | | | | * zebra/zebra_rib.c: (nexthop_active_update) Check for multipath limit when setting changed flag to avoid spurious changes. (static_install_ipv{4,6}) dont uninstall by default, might not be required - avoid spurious uninstalls. (static_uninstall_ipv{4,6}) only uninstall the route if its actually FIB route.