summaryrefslogtreecommitdiffstats
path: root/zebra/rt_netlink.c
Commit message (Collapse)AuthorAgeFilesLines
...
| * * rt_netlink.c: One tiny missing comma caused pointless debug messageshasso2005-04-091-1/+1
| | | | | | | | about IPv6 nexthops.
| * * rt_netlink.c (netlink_parse_info): Fix warning. It's safe to casthasso2005-04-091-59/+140
| | | | | | | | | | | | | | | | | | status to unsigned here, because we already checked that it isn't negative or 0. * rt_netlink.c (netlink_interface_addr): Prefix length belongs to the address, not to the interface. * rt_netlink.c (netlink_route_multipath): Fix debug. No useless info is printed out now and IPv6 info is handeled.
| * 2005-04-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2005-04-021-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix problems when netlink interfaces are renamed (same ifindex used for a new interface). Start cleaning up some problems with the way interface names are handled. * interface.c: (if_new_intern_ifindex) Remove obsolete function. (if_delete_update) After distributing the interface deletion message, set ifp->ifindex to IFINDEX_INTERNAL. (if_dump_vty) Detect pseudo interface by checking if ifp->ifindex is IFINDEX_INTERNAL. (zebra_interface) Check return code from interface_cmd.func. Do not set internal ifindex values to if_new_intern_ifindex(), since we now use IFINDEX_INTERNAL for all pseudo interfaces. * kernel_socket.c: (ifm_read) Fix code and comments to reflect that all internal interfaces now have ifp->ifindex set to IFINDEX_INTERNAL. * rt_netlink.c: (set_ifindex) New function used to update ifp->ifindex. Detects interface rename events by checking if that ifindex is already being used. If it is, delete the old interface before assigning the ifindex to the new interface. (netlink_interface, netlink_link_change) Call set_ifindex to update the ifindex. * if.h: Remove define for IFINDEX_INTERNBASE and add define IFINDEX_INTERNAL 0, since all internal (i.e. non-kernel) pseudo- interfaces should have ifindex set to 0. (if_new) Remove function. (if_delete_retain) New function to delete an interface without removing from iflist and freeing the structure. (ifname2ifindex) New function. * if.c: (if_new) Remove function (absorb into if_create). (if_create) Replace function if_new with call to calloc. Set ifp->ifindex to IFINDEX_INTERNAL. Fix off-by-one error in assert to check length of interface name. Add error message if interface with this name already exists. (if_delete_retain) New function to delete an interface without removing from iflist and freeing the structure. (if_delete) Implement with help of if_delete_retain. (ifindex2ifname) Reimplement using if_lookup_by_index. (ifname2ifindex) New function to complement ifindex2ifname. (interface) The interface command should check the name length and fail with a warning message if it is too long. (no_interface) Fix spelling in warning message. (if_nametoindex) Reimplement using if_lookup_by_name. (if_indextoname, ifaddr_ipv4_lookup) Reimplement using if_lookup_by_index. * bgp_zebra.c: (bgp_interface_delete) After deleting, set ifp->ifindex to IFINDEX_INTERNAL. * isis_zebra.c: (isis_zebra_if_del) Call if_delete_retain instead of if_delete, since it is generally not safe to remove interface structures. After deleting, set ifp->ifindex to IFINDEX_INTERNAL. (zebra_interface_if_lookup) Tighten up code. * ospf6_zebra.c: (ospf6_zebra_if_del) Previously, this whole function was commented out. But this is not safe: we should at least update the ifindex when the interface is deleted. So the new version updates the interface status and sets ifp->ifindex to IFINDEX_INTERNAL. (ospf6_zebra_route_update) Use if_indextoname properly. * ospf_vty.c: (show_ip_ospf_interface_sub) Show ifindex and interface flags to help with debugging. * ospf_zebra.c: (ospf_interface_delete) After deleting, set ifp->ifindex to IFINDEX_INTERNAL. (zebra_interface_if_lookup) Make function static. Tighten up code. * rip_interface.c: (rip_interface_delete) After deleting, set ifp->ifindex to IFINDEX_INTERNAL. * ripng_interface.c: (ripng_interface_delete) After deleting, set ifp->ifindex to IFINDEX_INTERNAL.
| * * rt_netlink.c (netlink_talk_filter): Show always warning message,hasso2005-03-311-12/+5
| | | | | | | | | | | | | | | | | | | | it's not for debug. * rt_netlink.c (netlink_talk): Don't assume we use netlink_cmd although we do now actually. * rt_netlink.c (netlink_route, netlink_route_multipath): Always use netlink_cmd to send messages to the kernel. [backport candidate]
| * 2005-03-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2005-03-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rt_netlink.c: (netlink_link_change) If the status of an operative interface changes (e.g. MTU changes), the client daemons should be notified by calling zebra_interface_up_update. Previously, the information was being updated in zebra's interface structure, but the clients were not notified of changes to an operative interface. * ospf_zebra.c: (ospf_interface_state_up) If the MTU of an operative interface changes, print a debug message and call ospf_if_reset() to simulate down/up on the interface. * ospf_interface.h: Declare new function ospf_if_reset(). * ospf_interface.c: (ospf_if_reset) New function to call ospf_if_down and ospf_if_up for all ospf interfaces attached to an interface.
| * 2005-03-12 Paul Jakma <paul@dishone.st>paul2005-03-121-4/+0
| | | | | | | | | | * rt_netlink.c: (netlink_route_multipath) dont set equalise flag. No stock Linux kernel has ever supported it, and even if it had
| * * rt_netlink.c: Don't show messages "ignoring message type 0x001[89]"hasso2005-02-201-1/+2
| | | | | | | | if we are not debugging.
| * 2005-02-14 Paul Jakma <paul@dishone.st>paul2005-02-141-0/+4
| | | | | | | | * Not all Linux netlink systems have IFLA_WIRELESS
| * 2005-01-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2005-01-291-6/+15
| | | | | | | | | | | | | | * rt_netlink.c: (netlink_socket,netlink_request,netlink_parse_info, netlink_talk) Save errno before calling zserv_privs.change. [backport candidate]
| * 2005-01-24 Martin Pot <mpot at martybugs.net>paul2005-01-241-0/+18
| | | | | | | | * zebra/rt_netlink.c: ignore wireless newlink netlink messages.
| * 2004-12-07 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2004-12-071-19/+19
| | | | | | | | * *.c: Change level of debug messages to LOG_DEBUG.
| * 2004-11-19 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2004-11-201-13/+13
| | | | | | | | | | * global: Replace strerror with safe_strerror. And vtysh/vtysh.c needs to include "log.h" to pick up the declaration.
| * OK. Here it is - PtP patch from Andrew J. Schorr. No problems with ospfd,hasso2004-10-191-1/+3
| | | | | | | | ripd might need some more testing though.
| * Fix warnings. Didn't even look at files not compiled in Linux though.hasso2004-10-071-2/+2
| |
| * Compiler warnings fixes.hasso2004-09-261-1/+1
| |
| * Commit my hack (yes, I still call it hack) - command line switch for zebrahasso2004-08-311-0/+44
| | | | | | | | daemon to change netlink receive buffer size.
| * Remove pointless privilege lower call. Thanks to Cougar for noticing.hasso2004-08-061-5/+3
| |
| * 2004-05-09 Paul Jakma <paul@dishone.st>paul2004-05-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * ioctl.c: (if_get_mtu) set mtu6 to mtu * mtu_kvm.c: (if_kvm_get_mtu) set mtu6 to mtu * rt_netlink.c: (netlink_interface) set mtu6 to mtu (netlink_link_change) ditto 2004-05-09 Sowmini Varadhan <sowmini.varadhan@sun.com> * interface.c: (if_delete_update) only used with HAVE_NETLINK and RTM_IFANNOUNCE. (if_flag_dump_vty) Solaris IFF_IPV4 and IFF_IPV6 if flags (if_dump_vty) print mtu6 if not same as mtu
| * [quagga-dev 1002]. Also fix date of previous commit in Chanelog.hasso2004-04-061-1/+7
| |
| * Fix warning. Approved by Amir.hasso2004-03-041-1/+1
| |
| * 2003-11-17 Jay Fenlason <fenlason@redhat.com>paul2003-11-171-0/+7
| | | | | | | | | | | | * zebra/rt_netlink.c: netlink_parse_info() ignore messages which are not from kernel. Reported to RH by Herbert Xu. See http://rhn.redhat.com/errata/RHSA-2003-307.html and CAN-2003-0858.
| * 2003-09-29 Paul Jakma <paul@dishone.st>paul2003-09-291-30/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * zebra/connected.c: revert the 'generic PtP' patch as it causes far too many problems. People who use FreeSWAN should investigate native linux ipsec. * zebra/rt_netlink.c: ditto * lib/if.c: ditto * ripd/ripd.h: ditto * ripd/ripd.c: ditto * ripd/rip_interface.c: ditto * ospfd/ospfd.c: ditto * ospfd/ospf_snmp.c: ditto * bgpd/bgp_nexthop.c: ditto
| * 2003-07-15 Paul Jakma <paul@dishone.st>paul2003-07-151-538/+587
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/version.h: add ZEBRA_URL (unused for now) * lib/vty.c: CMD_ERR_NOTHING_TODO when reading conf file should not be fatal. slight reformating. * ospfd/ospf_zebra.c: ignore reject/blackhole routes if zebra sends these type of routes. probably should be a new type of route to allow daemons to more easily choose whether to redistribute them - rathen than just a flag (eg for reject/blackhole). reorder the is_prefix_default test for ZEBRA_IPV4_ROUTE_DELETE to avoid the inverted test - slightly more readable. * redhat/zebra.spec.in: Add ospfapi port to services file, if with_ospfapi. * zebra/rib.h: Change nexthop types to an enum. * zebra/rt_netlink.c: run it through indent -nut. Add nexthop_types_desc[] descriptive array for nexthop types. (netlink_route_multipath) debug statements indicate which branch they are in and print out nexthop type. * zebra/zebra_rib.c: slight reformatting. * zebra/zebra_vty.c: Pass ZEBRA_FLAG_BLACKHOLE flag to static_add_ipv4() if Null0 route is configured. print out Null0 if STATIC_IPV4_BLACKHOLE route, and ignore flags (shouldnt be possible to set flags from vty) for config and show route.
| * 2003-06-19 Vladimir Ivaschenko <hazard@francoudi.com>paul2003-06-191-0/+20
| | | | | | | | | | | | | | * zebra/rt_netlink.c: Debug statements added to netlink_route_multipath() * zebra/zebra_rib.c: If route has a gateway, delete only existing route with that specified gateway.
| * 2003-06-15 Paul Jakma <paul@dishone.st>paul2003-06-151-5/+5
| | | | | | | | | | | | | | | | * lib/vty.{c,h}: Remove vty layer depending on a 'master' global, pass the thread master in explicitly to vty_init. Sort out some header dependency problems with lib/command.h * zebra/: Move globals to struct zebrad. Update vty_init(). * (.*)/\1_main.c: update call to vty_init().
| * 2003-06-04 Paul Jakma <paul@dishone.st>paul2003-06-041-1/+40
| | | | | | | | * Merge of zebra privileges
| * Add back support for null0 interface blackhole routes.paul2003-05-251-16/+20
| |
| * Route (reject|blackhole) support from 6Wind patch.hasso2003-05-251-8/+18
| |
| * From: Israel Keys <ikeys@agile.tv>paul2003-04-191-19/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Subject: [zebra 18677] zebra initialisation bug and patch Hi All, I have found a bug in zebra that prevents its routing table and interface database from being initialised properly. The problem occurs when a request is made via the netlink socket but the kernel produces a EWOULDBLOCK/EAGAIN when the result is trying to be retrieved via a recvmsg(). Zebra does not do anything about this and continues to function (with an empty routing table and interface list) as if nothing has happened. With no such information the routing protocol dosn't work! Two functions are called during the initialisation of Zebra: interface_lookup_netlink() and netlink_route_read() - obtaining the interfaces and routing table from the kernel respectively. These are the only time these functions are called. These functions, interface_lookup_netlink() and netlink_route_read(), use netlink_parse_info() to recieve the data from the netlink socket. The problem is, netlink_parse_info() returns (without error) when its call to recvmsg() results in an errno EWOULDBLOCK/EAGAIN. This behaviour is expected by other funtions calling netlink_parse_info() - netlink_parse_info is simply recalled at a later stage. However, on initialisation it is never recalled. Since zebra is expected to nothing else during initialisation it was easiest to temporarily change the netlink socket to BLOCK and wait indefinently until the kernel responds with the required information. Attached is a patch with these changes. Comments and questions are welcome. Please inform me if this patch is added to the Zebra source. --israel
| * Sync to latest Zebra CVSpaul2003-02-071-0/+4
| |
| * Matthew Grant <grantma@anathoth.gen.nz>patch_z17290_ifupstaticfixpaul2003-01-221-4/+19
| | | | | | | | | | | | Subject: [zebra 17290] [PATCHES] - Fixes for problems in 0.93b Added ifupstaticfix
| * Add work around for RFC3021 patch and its problem with certain IPv6 interfacesrfc3021-ipv6-fixpaul2003-01-191-1/+6
| | | | | | | | | | | | | | | | | | addresses. It seems so far that netlink only ever returns IFA_ADDRESS for IPv6 interfaces and never IFA_LOCAL, regardless of whether it is PtP or not. Need to investigate precisely how IPv6 and netlink are supposed to behave wrt broadcast vs PtP links.
| * From havanna_moon@gmx.net Fri Jan 17 23:37:49 2003patch_z17217_show_thread_cpupaul2003-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Date: Sat, 11 Jan 2003 23:26:28 +0100 (CET) From: Yon Uriarte <havanna_moon@gmx.net> To: "the list(tm) Zebra" <zebra@zebra.org> Subject: [zebra 17217] [PATCH] show thread CPU Hi, a little patch from the 'stupid preprocessor tricks' collection to record thread statistics. Usage: "show thread cpu [r][w][t][e][x]" Output Fields: self explaining I hope. Type is one of RWTEX for: Read, Write (fd threads), Timer, Event, Execute. Overhead vs. vanilla zebra: almost nothing. Vanilla CVS zebra already collects thread run times. Caveats: Under linux getrusage has a granularity of 10ms, which is almost useless in this case. Run ./configure, edit config.h and comment out "#define HAVE_RUSAGE", this way it will use getimeofday which has a much better granularity. IMHO this is better, as cooperative threads are effectively running during all that wall time (dont care if CPU utilization was 3% or 99% during the time the thread was running (an effective rusage combined with getimeofday could give that info)). Maybe someone can give tips for other platforms on API granularity. TODO: change some of the calls to thread_add_$KIND to funcname_thread_add_$KIND with a meaningfull funcname, so users will get a better idea of what's going on. F.ex. (AFAIK): ospf_spf_calculate_timer -> "Routes Step 1, areas SPF" ospf_ase_calculate_timer -> "Routes Step 2, externals" Could this be added to the unofficial patch collection? Could someone with BGP keepalive problems run their bgpd with this patch and post the results? TIA, HTH, HAND, regards yon Example output: -------------------------------- ospfd# show thread cpu Runtime(ms) Invoked Avg uSecs Max uSecs Type Thread 14.829 31 478 585 T ospf_ase_calculate_timer 82.132 9838 8 291 EX ospf_nsm_event 0.029 1 29 29 E ospf_default_originate_timer 0.254 9 28 34 T ospf_db_desc_timer 0.026 7 3 11 T ospf_wait_timer 669.015 523 1279 490696 R vty_read 4.415 45 98 173 TE ospf_network_lsa_refresh_timer 15.026 31 484 588 T ospf_spf_calculate_timer 29.478 1593 18 122 E ospf_ls_upd_send_queue_event 0.173 1 173 173 T vty_timeout 4.173 242 17 58 E ospf_ls_ack_send_event 637.767 121223 5 55 T ospf_ls_ack_timer 39.373 244 161 2691 R zclient_read 12.169 98 124 726 EX ospf_ism_event 0.226 2 113 125 R vty_accept 537.776 14256 37 3813 W ospf_write 4.967 41 121 250 T ospf_router_lsa_timer 0.672 1 672 672 E zclient_connect 7.901 1658 4 26 T ospf_ls_req_timer 0.459 2 229 266 E ospf_external_lsa_originate_timer 3.203 60 53 305 T ospf_maxage_lsa_remover 108.341 9772 11 65 T ospf_ls_upd_timer 33.302 525 63 8628 W vty_flush 0.101 1 101 101 T ospf_router_lsa_update_timer 0.016 1 16 16 T ospf_router_id_update_timer 26.970 407 66 176 T ospf_lsa_maxage_walker 381.949 12244 31 69 T ospf_hello_timer 0.114 22 5 14 T ospf_inactivity_timer 34.290 1223 28 310 T ospf_lsa_refresh_walker 470.645 6592 71 665 R ospf_read 3119.791 180693 17 490696 RWTEX TOTAL ospfd# bgpd# sh t c TeX Runtime(ms) Invoked Avg uSecs Max uSecs Type Thread 21.504 476 45 71 T bgp_keepalive_timer 17.784 1157 15 131 T bgp_reuse_timer 29.080 193 150 249 T bgp_scan 23.606 995 23 420 E bgp_event 317.734 28572 11 69 T bgp_routeadv_timer 0.084 1 84 84 E zlookup_connect 0.526 1 526 526 E zclient_connect 1.348 13 103 147 T bgp_start_timer 19.443 142 136 420 T bgp_connect_timer 16.032 772 20 27 T bgp_import 447.141 32322 13 526 TEX TOTAL bgpd# bgpd# show thread cpu rw Runtime(ms) Invoked Avg uSecs Max uSecs Type Thread 155.043 7 22149 150659 R bgp_accept 129.638 180 720 53844 R vty_read 1.734 56 30 129 R zclient_read 0.255 2 127 148 R vty_accept 58.483 983 59 340 R bgp_read 171.495 29190 5 245 W bgp_write 13.884 181 76 2542 W vty_flush 530.532 30599 17 150659 RW TOTAL bgpd# --------------------------------
| * [zebra 14631] Generic PtP and RFC3021 interface addressing supportpatch_z14631_ptp_rfc3021paul2002-12-131-28/+40
| |
| * zebra link state detection supportpatch_z12269_linkstatepaul2002-12-131-3/+3
| |
| * Initial revisionpaul2002-12-131-0/+1482
|
* Handle network interface renamesStephen Hemminger2008-07-311-35/+34
| | | | | | The interface index (rather than the name) is the primary key, so if name changes just update the record rather than doing a delete/update.
* Handle races with add/delete of routesStephen Hemminger2008-07-161-27/+20
| | | | | Adding a route that already exists, or deleting a route that is already gone, should not be an error.
* Revert "Use if_flags_update"Stephen Hemminger2008-06-201-1/+15
| | | | | This reverts commit 17cf20dabb137205497d81f7c55efa45a4e50748. Stuff for next release snuck into hollywood branch
* Use if_flags_updateStephen Hemminger2008-06-201-15/+1
|
* netlink interface minor stuffStephen Hemminger2008-05-281-16/+16
| | | | Add more prototypes and make some functions static
* only set non-blocking on netlink socketStephen Hemminger2008-05-191-133/+50
| | | | | | There is no need to increase buffer size or set non-blocking on the netlink command socket. This reduces the number of system calls per transaction.
* remove unneeded privledge changesStephen Hemminger2008-05-191-12/+3
| | | | | | Netlink recvmsg always succeeds, there are no permission checks in the kernel on receive, only on send and bind. This reduces the number of system calls and any potential security vulnerabilty in recvmsg().
* Merge branch 'glendale' into hollywoodrbalocca2008-05-151-8/+8
|\
| * Merge branch 'glendale' of suva.vyatta.com:/git/vyatta-quagga into glendaleStephen Hemminger2008-05-121-1/+7
| |\
| * | set/check nl port id on messagesStephen Hemminger2008-05-021-8/+8
| | | | | | | | | | | | | | | The talk netlink socket should set it's own pid value, so they can be ignored in listener.
* | | Ignore netlink interface events that don't change stateStephen Hemminger2008-05-131-20/+24
| | | | | | | | | | | | | | | Netlink can notify us about changes that don't affect operative state of the interface. So ignore these type of events.
* | | Merge branch 'hollywood' of suva.vyatta.com:/git/vyatta-quagga into hollywoodStephen Hemminger2008-05-071-15/+25
|\ \ \ | | |/ | |/|
| * | quiet noisy errors from zebraStephen Hemminger2008-05-021-1/+7
| |/ | | | | | | It is a harmless event when BGP tries to delete already deleted routes.
| * filter out all route change responses on listen socketStephen Hemminger2008-05-021-14/+18
| | | | | | | | | | | | | | | | | | | | When zebra changes routes it uses the netlink cmd socket, but these also show up on the netlink listen socket. Use more kernel level socket filtering so that any changes that happend because of command socket are ignored. Uses the netlink port id (pid) to identify the changes from the command socket.