summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-01-02lib: fix some strtoul() use casesUlrich Weber
...otherwise 4294967295 is not a valid value on 32bit systems
2012-01-02ospf6d: Route locking (memory) cleanupTom Goff
* ospf6_route.c: (ospf6_route_best_next) Allows unlock route, even when there's no next route. This is consistent with how ospf6_route_next() behaves. * ospf6_intra.c: (ospf6_intra_prefix_lsa_remove) Make sure the last route considered is always unlocked. This is needed when the for loop terminates because ospf6_route_is_prefix() returns zero. Signed-off-by: Vyacheslav Trushkin <me@dogonthesun.net>
2012-01-02ospf6d: Have ospf6d cleanup when it terminates normallyTom Goff
A clean exit makes it easier to use memory debuggers. * ospf6_asbr.c: (ospf6_asbr_terminate) Add a function to do route map cleanup. * ospf6_lsa.c: (ospf6_lsa_terminate) Add a function to cleanup the lsa handler vector. * ospf6_main.c: (ospf6_exit) Add an function that causes ospf6d to gracefully exit. * ospf6_message.c: (ospf6_message_terminate) Add a function that frees the send and receive buffers. * ospf6_top.c: (ospf6_delete) Enable the ospf6_delete() function. Disable ospf6 before freeing everything. Signed-off-by: Vyacheslav Trushkin <me@dogonthesun.net> Conflicts: ospf6d/ospf6_lsa.h
2012-01-02lib: Add a function to delete all interfacesTom Goff
if.c: (if_terminate) This adds a cleanup function that can be called when a daemon exits, similar to vty_terminate().
2012-01-02doc: update BGP RFC referencesDenis Ovsienko
2012-01-02zebra: fix IPv6 RA wrt interface removal (BZ#480)Denis Ovsienko
2012-01-02zebra: fix ifindex test condition (BZ#487)Matthias Ferdinand
When the same ip address is used on several interfaces, and one of them gets deleted (or equivalent: set to down and then address removed), rib_delete_ipv[46] will also remove the connected route from other interfaces. rib_delete_ipv[46] is called twice when an interface is deleted: - for the "ifdown" event - for the address removal (note: this may be specific to the netlink interface of linux) The second call does not find the connected route to that same ifindex anymore, but deletes similar connected routes to any other ifindex instead. Reason: the ifindex check is on the same level as the check for ZEBRA_ROUTE_CONNECT/NEXTHOP_TYPE_IFINDEX. If everything matches except for the ifindex, the "else" part (intended for different route types) is executed, thus removing the route from the wrong interface. fix: move ifindex check inside the "then" part of the check for ZEBRA_ROUTE_CONNECT/NEXTHOP_TYPE_IFINDEX. Now connected routes to other ifindexes will not spill over to the "else" part for different route types anymore.
2012-01-02ospf6d: fix compiler warning messagesVyacheslav Trushkin
* fix disagreement with C99 in zlog_debug calls Format specifier in some zlog_debug calls for size_t values was changed in order to C99 ('%u' -> '%zu'). * fix -Wsign-compare warnings Type of return value of ospf6_packet_max() was changed.
2012-01-02lib: fix some strtoul() use casesUlrich Weber
...otherwise 4294967295 is not a valid value on 32bit systems
2012-01-02ospf6d: add verifying user's privilegesVyacheslav Trushkin
2012-01-02ospfd: fix bug in NSSA ABR status checkDenis Ovsienko
* ospf_abr.c * ospf_abr_nssa_am_elected(): feed "best" instead of "address of best" into IPV4_ADDR_CMP(), because "best" is a pointer; also, mean s_addr field of the structures to get better typed pointers
2012-01-02lib: address type-punned pointers in prefix_same()Denis Ovsienko
IPV4_ADDR_SAME() wasn't passed the right union member, this could cause a bug due to strict-aliasing. IPV6_ADDR_SAME() case got its fix before the error could be created by macro upgrade.
2012-01-02bgpd: justify checks for IPv4 class D/EDenis Ovsienko
* lib/prefix.h * IPV4_CLASS_DE(): make consistent with counterpart macros * bgp_packet.c * bgp_open_receive(): test using macro instead of ">=" * bgp_route.c * bgp_update_rsclient(): idem * bgp_update_main(): idem
2012-01-02ospfd: fix packet reception for FreeBSD 10.Dmitrij Tejblum
* ospf_packet.c (ospf_recv_packet): FreeBSD, starting from version 10, will not subtract the IP header size from ip_len. This is the patch from FreeBSD's ports/net/quagga/files/patch-ospfd__ospf_packet.c, by Boris Kovalenko.
2012-01-02zebra: ZEBRA_HELLO and mopping up routes (BZ#448)Vyacheslav Trushkin
ZEBRA_HELLO message is used by routing daemons to inform zebra what type of routes daemon will be announcing to zebra. Also zebra uses route_type_oaths array to track which daemon announces which protocol. Zebra mops up routes if daemon didn't for some reason.
2012-01-02lib: fix type-punning in ip_masklen()Denis Ovsienko
ip_masklen() was likely to return incorrect results after being compiled with -fstrict-aliasing (-O2, -O3, -Os)
2012-01-02lib: optimize ip_masklen()Denis Ovsienko
The new implementation makes use of a 64KB mapping table, which makes it possible to compute masklen faster and with constant execution time. The map also allows for additional version of the function, which can detect errors in input argument. The previous implementation had a variable cost of execution, which depended on masklen in a non-linear manner, and at its worst (/31) was 4 times slower, than the new implementation. The only case of old function just slightly outperforming the new one is /0, which is of little practical interest.
2012-01-02ospf6d: add verifying user's privilegesVyacheslav Trushkin
2012-01-02ospfd: fix bug in NSSA ABR status checkDenis Ovsienko
* ospf_abr.c * ospf_abr_nssa_am_elected(): feed "best" instead of "address of best" into IPV4_ADDR_CMP(), because "best" is a pointer; also, mean s_addr field of the structures to get better typed pointers
2012-01-02lib: address type-punned pointers in prefix_same()Denis Ovsienko
IPV4_ADDR_SAME() wasn't passed the right union member, this could cause a bug due to strict-aliasing. IPV6_ADDR_SAME() case got its fix before the error could be created by macro upgrade.
2012-01-02bgpd: justify checks for IPv4 class D/EDenis Ovsienko
* lib/prefix.h * IPV4_CLASS_DE(): make consistent with counterpart macros * bgp_packet.c * bgp_open_receive(): test using macro instead of ">=" * bgp_route.c * bgp_update_rsclient(): idem * bgp_update_main(): idem
2012-01-02ospfd: fix packet reception for FreeBSD 10.Dmitrij Tejblum
* ospf_packet.c (ospf_recv_packet): FreeBSD, starting from version 10, will not subtract the IP header size from ip_len. This is the patch from FreeBSD's ports/net/quagga/files/patch-ospfd__ospf_packet.c, by Boris Kovalenko.
2012-01-02zebra: ZEBRA_HELLO and mopping up routes (BZ#448)Vyacheslav Trushkin
ZEBRA_HELLO message is used by routing daemons to inform zebra what type of routes daemon will be announcing to zebra. Also zebra uses route_type_oaths array to track which daemon announces which protocol. Zebra mops up routes if daemon didn't for some reason.
2012-01-02lib: fix compile warnings from set-never-usedStephen Hemminger
The if_dump code had empty loop, that caused set-never-used warning.
2012-01-02Revert "lib: address -Wunused-but-set-variable"Denis Ovsienko
Stephen Hemminger's commits contain all the changes and several other warning fixes. This reverts commit 6947dbebdc91b6272f8107a6e0dd211457438606.
2012-01-02lib: fix SMUX compiler warningsStephen Hemminger
Make progname a string, and cast when calling asn1. Remove variable set but never used.
2012-01-02zebra: fix warnings in forward procStephen Hemminger
Check result of fgets(), and don't set variable that is never used.
2012-01-02bgpd: cleanup privs on terminationStephen Hemminger
When doing valgrind testing, the privledges from zprivs_init() need to be cleaned up on exit.
2012-01-02ospfd: remove unused codeStephen Hemminger
The code for nssa_range and other bits that were written but never used.
2012-01-02bgpd: store nexthop info for redistributed IPV6 routesStephen Hemminger
BGP was ignoring nexthop info for static and other redistributed routes for IPv6. Build extra attribute info to store the nexthop. See also: https://bugzilla.vyatta.com/show_bug.cgi?id=6073
2012-01-02ospfd: avoid redundant lookup in ospf_redistribute_withdrawStephen Hemminger
The old algorithim looked up every node twice as it withdrew the entry. It looks up entry once in redistribute_withdraw, then looks it up again info_delete. Use result of first lookup to do the free directly. This may explain the slow performance observed in https://bugzilla.vyatta.com/show_bug.cgi?id=4421
2012-01-02lib: fix memory leak on connect() failureStephen Hemminger
Change sockunion_log() to not use strdup(). This fixes a small memory leak that occurs on every failed connect(), and is simpler/cleaner.
2012-01-02lib: call filter delete hook before freeing access listStephen Hemminger
The delete_hook was being run after calling access list delete function. This would cause ospf to dereference a NULL, in ospf_filter_update because 'access->name' was already freed. See also: https://bugzilla.vyatta.com/show_bug.cgi?id=7654
2012-01-02lib: fix type-punning in ip_masklen()Denis Ovsienko
ip_masklen() was likely to return incorrect results after being compiled with -fstrict-aliasing (-O2, -O3, -Os)
2012-01-02lib: optimize ip_masklen()Denis Ovsienko
The new implementation makes use of a 64KB mapping table, which makes it possible to compute masklen faster and with constant execution time. The map also allows for additional version of the function, which can detect errors in input argument. The previous implementation had a variable cost of execution, which depended on masklen in a non-linear manner, and at its worst (/31) was 4 times slower, than the new implementation. The only case of old function just slightly outperforming the new one is /0, which is of little practical interest.
2012-01-01Revert "lib: optimize apply_mask_ipv6()"Denis Ovsienko
Experience with IPv4 counterpart of this function suggests, that this way of type-punning is likely to cause errors.
2012-01-01Revert "lib: optimize apply_mask_ipv6()"Denis Ovsienko
Experience with IPv4 counterpart of this function suggests, that this way of type-punning is likely to cause errors.
2011-12-21ospfd: more info in LSA checksum warning (BZ#685)Jaroslav Fojtik
2011-12-21ospfd: more info in LSA checksum warning (BZ#685)Jaroslav Fojtik
2011-12-18fix set never used warningsStephen Hemminger
(This patch was modified to leave calls to stream_getl() in place, they are necessary for the stream's internal pointer to advance to the correct position. -- Denis) Signed-off-by: Denis Ovsienko <infrastation@yandex.ru> Fix gcc warnings about varables that are set but never used. * bgpd/bgp_attr.c * cluster_unintern(): ret * transit_unintern(): ret * bgp_attr_default_intern(): attre * bgp_mp_reach_parse(): rd_high, rd_low * bgpd/bgp_route.c * bgp_announce_check_rsclient(): bgp * bgpd/bgp_zebra.c * zebra_read_ipv4(): ifindex * zebra_read_ipv6(): ifindex * bgpd/bgpd.c * bgp_config_write_peer(): filter * lib/distribute.c * distribute_list_all(): dist * distribute_list(): dist * distribute_list_prefix_all(): dist * distribute_list_prefix(): dist * lib/if_rmap.c * if_rmap(): if_rmap * lib/vty.c * vty_accept(): vty * lib/zclient.c * zclient_read(): ret * zebra/irdp_interface.c * if_group(): zi * zebra/rt_netlink.c * kernel_read(): ret, sock
2011-12-14ospf6d: always remove the result of a previous SPF calculationTom Goff
This is needed to avoid stale routes in some cases; the regression was introduced by commit 1d19234e79c77a7d55194b513f2a77c6a691bc2c. * ospf6_spf.c: (ospf6_spf_calculation) Call ospf6_spf_table_finish() before possibly returning if no router-LSA is found for the root of the SPF tree.
2011-12-13bgpd: fix regression in ORF procesing (BZ#688)Denis Ovsienko
This issue has been pointed out by Lou Berger and Tim Browski. * bgp_packet.c * bgp_route_refresh_receive(): restore if() condition, which was broken by commit fdbc8e77c88f751924299d0bc752371d5cc31116
2011-12-13lib: optimize apply_mask_ipv6()Denis Ovsienko
2011-12-13lib: optimize apply_mask_ipv4()Denis Ovsienko
2011-12-13lib: make masklen2ip6() safer and fasterDenis Ovsienko
2011-12-13lib: fix endianness of masklen2ip()Denis Ovsienko
2011-12-13lib: make masklen2ip() safer and fasterDenis Ovsienko
2011-12-13ospf6d: decode message type with LOOKUP()Denis Ovsienko
* ospf6_message.h * OSPF6_MESSAGE_TYPE_CANONICAL(): dismiss * OSPF6_MESSAGE_TYPE_NAME(): dismiss * ospf6_message.c * ospf6_message_type_str: rewrite as a message list, add max value * ospf6_packet_examin(): update to use LOOKUP() * ospf6_receive(): idem * ospf6_send(): idem
2011-12-13ospf6d: make some old sizing checks assertionsDenis Ovsienko
As long as ospf6_packet_examin() is now the single checkpoint for received packets, most of the old checks performed elsewhere can be converted into assert() constructs. Malformed input data at respective points can be attributed solely to a programming error, not a malformed packet. * ospf6_message.c * ospf6_hello_print() * ospf6_dbdesc_print() * ospf6_lsreq_print() * ospf6_lsupdate_print() * ospf6_lsack_print() * ospf6_hello_recv() * ospf6_dbdesc_recv_master() * ospf6_dbdesc_recv_slave() * ospf6_lsreq_recv() * ospf6_lsupdate_recv() * ospf6_lsupdate_recv() * ospf6_lsack_recv() * ospf6_receive()
2011-12-13lib: spellingDenis Ovsienko