summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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
2011-12-13lib: add sockopt helper for setting IPV6_V6ONLY and use itDavid Lamparter
getaddrinfo returns a list of socket parameters for listening. it will contain both IPv4 and IPv6 listening sockets. unless we use IPV6_V6ONLY on the IPv6 ones, only the socket listed first will work. if the IPv4 one came first, the IPv6 one would get an "Address in use" error. this functionality was already present for bgpd and its listening sockets. as it is needed for vtys as well, make it a common helper. Conflicts: lib/sockunion.c
2011-12-13lib: put route_types.txt to real useDavid Lamparter
this replaces most occurences of routing protocol lists by preprocessor defines from route_types.h. the latter is autogenerated from route_types.txt by a perl script (previously awk). adding a routing protocol now is mostly a matter of changing route_types.txt and log.c. Conflicts: lib/route_types.awk
2011-12-13zebra: fix redistribution of new protocolsDavid Lamparter
redistribute is currently limited to "known" protocols. there is no reason for this limitation, so, remove it.
2011-12-13rib: default distance value for new protocols (v2)David Lamparter
adding protocols and forgetting to update zebra_rib.c currently causes a beyond end of array access for the default distance value. fix by making 150 the default distance for unknown routing protocols. 150 is higher than all other IGPs but lower than iBGP (200)
2011-12-13build: fixup autoconf for cross-compiling (to OpenWRT)David Lamparter
MALLOC/REALLOC aren't used properly (no rpl_malloc), remove them while at it, infer some sane ipforwarding method from the OS value. (v2 on that, "==" is not a proper operator for standard "test")
2011-12-13zebra: set the interface link-layer socket addressTom Goff
* kernel_socket.c: (ifm_read) The reorganization from commit 6fe70d1b35c189cb1e488b2c26551ba7baac6148 removed setting the interface link-layer socket address structure on routing socket platforms. This restores saving the link-layer information because it might be used elsewhere: rtm_write() when no gateway is given, if_dump_vty() and rtadv_send_packet().
2011-12-13zebra: spellingDenis Ovsienko
2011-12-13build: delete .cvsignore filesDenis Ovsienko
2011-12-13ospfd: spellingDenis Ovsienko
2011-12-13lib: clearing zclient.c for some cases of buildingVyacheslav Trushkin
lib/zclient.c: using of HAVE_TCP_ZEBRA in zclient_socket_* definitions extended by else clause.
2011-12-13quagga: option "-z" ("--socket <path>") addedVyacheslav Trushkin
All daemons modified to support custom path to zserv socket. lib: generalize a zclient connection zclient_socket_connect added. zclient_socket and zclient_socket_un were hidden under static expression. "zclient_serv_path_set" modified.
2011-12-13isisd: indent longopts arrayVyacheslav Trushkin
2011-12-13bgpd: implement 'match probability' in route-mapsVyacheslav Trushkin
New clause 'match probability <percentage value>' was added in route-maps (bgpd/bgp_routemap.c modified).
2011-12-13ospf6d: justify multicast group managementVyacheslav Trushkin
* ospf6_network.[ch] * ospf6_sso(): new function supersedes ospf6_join_allspfrouters(), ospf6_leave_allspfrouters(), ospf6_join_alldrouters() and ospf6_leave_alldrouters() * ospf6_interface.c * ospf6_interface_state_change(): update respectively * interface_up(): ditto * interface_down(): ditto
2011-12-13ripngd: limit max of "timers basic" to 65535 as documentedUlrich Weber
and use VTY_GET_INTEGER_RANGE instead of calling strtoul
2011-12-13bgp: use VTY_GET_INTEGER_RANGE() in bgp_clear()Ulrich Weber
Second patch replaces "VTY_GET_LONG ("AS", as_ul, arg);" by "VTY_GET_INTEGER_RANGE ("AS", as, arg, 1, BGP_AS4_MAX);" as done in all other code, which parses AS numbers.
2011-12-13ospf6d: implement 'match interface' for route-mapsVyacheslav Trushkin
ospf6_routemap_rule_match_interface* was imported from ospfd daemon with minor changes. new CLI options defined. `ospf6_routemap_rule_match_interface' was changed to support IPv6 (ospfv3) route's external information.
2011-12-13zebra: spellingDenis Ovsienko
2011-12-13build: delete .cvsignore filesDenis Ovsienko
2011-12-13ospfd: spellingDenis Ovsienko
2011-12-13lib: clearing zclient.c for some cases of buildingVyacheslav Trushkin
lib/zclient.c: using of HAVE_TCP_ZEBRA in zclient_socket_* definitions extended by else clause.
2011-12-13quagga: option "-z" ("--socket <path>") addedVyacheslav Trushkin
All daemons modified to support custom path to zserv socket. lib: generalize a zclient connection zclient_socket_connect added. zclient_socket and zclient_socket_un were hidden under static expression. "zclient_serv_path_set" modified.
2011-12-13isisd: indent longopts arrayVyacheslav Trushkin
2011-12-13bgpd: implement 'match probability' in route-mapsVyacheslav Trushkin
New clause 'match probability <percentage value>' was added in route-maps (bgpd/bgp_routemap.c modified).
2011-12-13ospf6d: justify multicast group managementVyacheslav Trushkin
* ospf6_network.[ch] * ospf6_sso(): new function supersedes ospf6_join_allspfrouters(), ospf6_leave_allspfrouters(), ospf6_join_alldrouters() and ospf6_leave_alldrouters() * ospf6_interface.c * ospf6_interface_state_change(): update respectively * interface_up(): ditto * interface_down(): ditto
2011-12-13ripngd: limit max of "timers basic" to 65535 as documentedUlrich Weber
and use VTY_GET_INTEGER_RANGE instead of calling strtoul
2011-12-13bgp: use VTY_GET_INTEGER_RANGE() in bgp_clear()Ulrich Weber
Second patch replaces "VTY_GET_LONG ("AS", as_ul, arg);" by "VTY_GET_INTEGER_RANGE ("AS", as, arg, 1, BGP_AS4_MAX);" as done in all other code, which parses AS numbers.
2011-12-13ospf6d: implement 'match interface' for route-mapsVyacheslav Trushkin
ospf6_routemap_rule_match_interface* was imported from ospfd daemon with minor changes. new CLI options defined. `ospf6_routemap_rule_match_interface' was changed to support IPv6 (ospfv3) route's external information.
2011-12-07lib: fix SMUX compiler warningsStephen Hemminger
Make progname a string, and cast when calling asn1. Remove variable set but never used.
2011-12-07lib: fix compile warnings from set-never-usedStephen Hemminger
The if_dump code had empty loop, that caused set-never-used warning.