]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
13 years agoversion RE-0.99.17.2
Denis Ovsienko [Wed, 7 Sep 2011 11:40:06 +0000 (15:40 +0400)]
version RE-0.99.17.2

13 years agobuild: build ospfd as Position-Independed Executable (if appropriate)
Dmitrij Tejblum [Sat, 3 Sep 2011 10:35:24 +0000 (14:35 +0400)]
build: build ospfd as Position-Independed Executable (if appropriate)

Since 46bc0e432e75, all the binaries are built as Position-Independed
Executables (if available and enabled). ospfd was missed for some
unknown reason.

13 years agoospfd: address more trivial compiler warnings
Denis Ovsienko [Sun, 28 Aug 2011 18:38:45 +0000 (22:38 +0400)]
ospfd: address more trivial compiler warnings

* ospf_ase.c
  * ospf_ase_complete_direct_routes(): dismiss unused variable
  * ospf_ase_calculate_route(): put assignments into parentheses

13 years agozebra: add missing includes
Denis Ovsienko [Sun, 28 Aug 2011 18:29:52 +0000 (22:29 +0400)]
zebra: add missing includes

13 years agoospf6d: address more trivial compiler warnings
Denis Ovsienko [Sat, 27 Aug 2011 18:19:34 +0000 (22:19 +0400)]
ospf6d: address more trivial compiler warnings

* ospf6_main.c: include required headers
* ospf6_asbr.h: idem
* ospf6_spf.c
  * ospf6_spf_install(): remove unused variables

13 years agoospfd: sizing macros cleanup
Denis Ovsienko [Tue, 23 Aug 2011 07:36:27 +0000 (11:36 +0400)]
ospfd: sizing macros cleanup

* ospf_spf.c
  * ROUTER_LSA_TOS_SIZE: prepend OSPF_ and move to ospf_lsa.h
  * ROUTER_LSA_MIN_SIZE: replace with existing OSPF_ROUTER_LSA_LINK_SIZE

13 years agolib: use "protocol-independed API" from RFC3678, if that is available
Dmitrij Tejblum [Mon, 22 Aug 2011 07:39:35 +0000 (11:39 +0400)]
lib: use "protocol-independed API" from RFC3678, if that is available

(This commit is based on the patch from BZ#420, and should fix that bug.)

* configure.ac: detect availability of that API
* sockopt.c (setsockopt_ipv4_multicast): use it for join/leave IPv4
  multicast groups

13 years agolib: futher simplification of setsockopt_ipv4_multicast()
Dmitrij Tejblum [Fri, 19 Aug 2011 19:00:30 +0000 (23:00 +0400)]
lib: futher simplification of setsockopt_ipv4_multicast()

* sockopt.c (setsockopt_ipv4_multicast): check for wrong optname with
  assert(), rather than return an error.

13 years agoospf6d: add missing include
Denis Ovsienko [Sat, 20 Aug 2011 19:12:00 +0000 (23:12 +0400)]
ospf6d: add missing include

Two extern declarations in ospf6_abr.h are based on struct ospf6_route,
which may not be available at the time ospf6_abr.h is included. This may
lead to warnings after including ospf6_abr.h just for the structures
defined in it.

13 years agoospf6d: ospf6_lsa_cmd_init() does not exist
Denis Ovsienko [Sat, 20 Aug 2011 18:45:58 +0000 (22:45 +0400)]
ospf6d: ospf6_lsa_cmd_init() does not exist

13 years agoospf6d: move named constants to ospf6d.h
Denis Ovsienko [Sat, 20 Aug 2011 16:58:15 +0000 (20:58 +0400)]
ospf6d: move named constants to ospf6d.h

13 years agolib: fix omission in the previous commit to lib/sockopt.c
Dmitrij Tejblum [Fri, 19 Aug 2011 18:25:23 +0000 (22:25 +0400)]
lib: fix omission in the previous commit to lib/sockopt.c

* sockopt.c (setsockopt_ipv4_multicast_if): fix missed line in
  the previous commit.

13 years agoospf6d: justify some ABR debug code
Denis Ovsienko [Fri, 19 Aug 2011 18:24:27 +0000 (22:24 +0400)]
ospf6d: justify some ABR debug code

* ospf6_abr.c
  * ospf6_abr_examin_summary(): only fill "buf" when it is used

13 years agolib: simplify interface of setsockopt_multicast_ipv4().
Dmitrij Tejblum [Thu, 18 Aug 2011 16:22:17 +0000 (20:22 +0400)]
lib: simplify interface of setsockopt_multicast_ipv4().

* sockopt.[ch] (setsockopt_ipv4_multicast): ifindex is now mandatory (all
  non-ancient OSes can use it anyway), and if_addr parameter (the address
  of the interface) is now gone. (setsockopt_ipv4_multicast_if):
  IP_MULTICAST_IF processing moved to this new function

* ospf_network.c (ospf_if_add_allspfrouters, ospf_if_drop_allspfrouters,
  ospf_if_add_alldrouters, ospf_if_drop_alldrouters, ospf_if_ipmulticast),
  rip_interface.c (ipv4_multicast_join, ipv4_multicast_leave,
  rip_interface_new): adapt to the new interface

13 years agoospf6d: spelling
Denis Ovsienko [Fri, 19 Aug 2011 12:27:16 +0000 (16:27 +0400)]
ospf6d: spelling

13 years agobgpd: improve "show ip bgp scan detail"
Denis Ovsienko [Tue, 9 Aug 2011 10:42:58 +0000 (14:42 +0400)]
bgpd: improve "show ip bgp scan detail"

* bgp_nexthop.c (show_ip_bgp_scan_tables): access proper structure field
  in AF_INET6 case, handle ifindex NH type properly

13 years agobgpd: dismiss some zlookup checks
Denis Ovsienko [Mon, 8 Aug 2011 15:36:44 +0000 (19:36 +0400)]
bgpd: dismiss some zlookup checks

bgp_nexthop_onlink(): zlookup is not used here at all
bgp_nexthop_lookup_ipv6(): rely on the detection performed by "query"
  function (this also changes the fallback value to 0), reorder if-block
bgp_nexthop_lookup(): idem

13 years agobgpd: add "show ip bgp scan detail" command
Denis Ovsienko [Fri, 5 Aug 2011 17:47:08 +0000 (21:47 +0400)]
bgpd: add "show ip bgp scan detail" command

* bgp_nexthop.c: (show_ip_bgp_scan) transform into
  show_ip_bgp_scan_tables(), which uses inet_ntop() and can dump
  nexthops on request; (show_ip_bgp_scan_detail_cmd) new function

13 years agobgpd: touch nexthop handling code
Denis Ovsienko [Fri, 5 Aug 2011 14:52:52 +0000 (18:52 +0400)]
bgpd: touch nexthop handling code

bgp_nexthop_lookup_ipv6(): declare variables where they are actually
used, drop no-op initialization (the field is already 0)
bgp_nexthop_lookup(): ditto
bgp_nexthop_check_ebgp(): rename to bgp_nexthop_onlink()
bgp_nexthop_cache_changed(): rename to bgp_nexthop_cache_different()

13 years agobgpd: use XCALLOC to allocate bgpd damp array
Stephen Hemminger [Thu, 5 Aug 2010 17:26:30 +0000 (10:26 -0700)]
bgpd: use XCALLOC to allocate bgpd damp array

* bgpd: (bgp_damp_parameter_set) The BGP reuse_index is not initialized
  properly.  This would cause sporadic crash when disabling dampening.  Use
  XCALLOC correctly and the right size array is initialized and no memset is
  needed.

13 years agolib: fix more format warnings (#637)
Christian Hammers [Wed, 23 Mar 2011 10:07:55 +0000 (13:07 +0300)]
lib: fix more format warnings (#637)

The following patch was also neccessary to compile.

* command.c: (config_logmsg_cmd) use "%s" format spec
* if.c: (connected_log) ditto

13 years agoospfd: remove useless RFC1583 check
Alexandre Chappuis [Tue, 2 Aug 2011 13:37:39 +0000 (17:37 +0400)]
ospfd: remove useless RFC1583 check

* ospf_route.c: Function ospf_asbr_route_cmp is called uniquely from
  ospf_route_cmp() when the flag OSPF_RFC1583_COMPATIBLE is not set.
  Therefore, the check that the flag is set doesn't make sense at all
  and it can consequently be removed without doing any harm.

Signed-off-by: Alexandre Chappuis <alc@open.ch>
Signed-off-by: Roman Hoog Antink <rha@open.ch>
13 years agolib: remove unused variable
Denis Ovsienko [Mon, 1 Aug 2011 17:59:04 +0000 (21:59 +0400)]
lib: remove unused variable

* sockopt.c (getsockopt_ifindex): "ifindex" was never used

13 years agodelete CVS keywords
Denis Ovsienko [Mon, 1 Aug 2011 12:52:03 +0000 (16:52 +0400)]
delete CVS keywords

13 years agoospf6d: Remove obsolete code
Tom Goff [Wed, 10 Nov 2010 21:03:23 +0000 (13:03 -0800)]
ospf6d: Remove obsolete code

* ospf6_area.c: (ospf6_area_delete) Get rid of unused code that refers
    to a nonexistent function and structure member.

13 years agolib: zlog should clean up its memory
Tom Goff [Wed, 10 Nov 2010 21:01:17 +0000 (13:01 -0800)]
lib: zlog should clean up its memory

* log.c: (closezlog) Also free the dynamically allocated filename when
    a log is closed.

13 years agobgpd: Fix display of unsigned attributes
Wataru Tanitsu [Fri, 10 Sep 2010 16:47:56 +0000 (09:47 -0700)]
bgpd: Fix display of unsigned attributes

* bgp_route.c: (route_vty_out*) The local prefix, metric and weight values
  are all stored as uint32_t.  Change the format to %u so that large values
  are not displayed as negative integers.

13 years agoospfd: Lower level of some common messages from info to debug
Paul Jakma [Mon, 6 Dec 2010 12:21:52 +0000 (12:21 +0000)]
ospfd: Lower level of some common messages from info to debug

* ospf_{ism,network}.c: Certain oft-repeated but trivial messages should be
  debug log level, not info, to avoid spamming 'terminal monitor'

13 years agolib: prefix.c nano-optimisation
Paul Jakma [Sun, 24 Jan 2010 21:41:02 +0000 (21:41 +0000)]
lib: prefix.c nano-optimisation

* lib/prefix.c: (prefix_match) nano-optimisation, let it return early
  without copying pointers.

13 years agobgpd: Fix compile failure if IPv6 build was disabled.
Paul Jakma [Wed, 23 Mar 2011 10:30:30 +0000 (10:30 +0000)]
bgpd: Fix compile failure if IPv6 build was disabled.

* bgp_route.c: ({no_,}ipv6_bgp_network_ttl_cmd) depends on ipv6_bgp_network
  which is HAVE_IPV6, so these should be too.
  (bgp_route_init) and the installs should be similarly ifdefed

13 years agobgpd: rename SAFI 3 according to RFC4760
Denis Ovsienko [Sun, 17 Jul 2011 15:33:21 +0000 (19:33 +0400)]
bgpd: rename SAFI 3 according to RFC4760

- SAFI value 3 is reserved.  It was assigned by RFC 2858 for a use
  that was never fully implemented, so it is deprecated by this
  document.

* zebra.h: rename macro
* bgp_fsm.c: (bgp_graceful_restart_timer_expire,
  bgp_graceful_stale_timer_expire, bgp_stop, bgp_establish): update
* bgpd.c: (peer_nsf_stop): update
* bgp_open.c: (bgp_capability_vty_out): SAFI 3 isn't a recognized case
  any more

13 years agoconfigure: fix OpenPAM detection
Denis Ovsienko [Thu, 14 Jul 2011 20:24:15 +0000 (00:24 +0400)]
configure: fix OpenPAM detection

13 years agoconfigure: fix FreeBSD header detection (BZ#408)
Denis Ovsienko [Thu, 14 Jul 2011 12:30:08 +0000 (16:30 +0400)]
configure: fix FreeBSD header detection (BZ#408)

This change is based on Xavier Beaudouin's patch (which fixes detection
of 3 config.h macros on FreeBSD without any impact to Linux build of
Quagga) and FreeBSD port patch (which fixes 5 config.h macros, but
breaks the Linux build), it fixes 5 macros and works for both FreeBSD 8
and Linux.

13 years agobgpd: more SAFI fixes
Denis Ovsienko [Thu, 14 Jul 2011 08:36:19 +0000 (12:36 +0400)]
bgpd: more SAFI fixes

Two macros resolving to the same integer constant broke a case block and
a more thorough merge of BGP_SAFI_VPNV4 and BGP_SAFI_VPNV6 was
performed.

* bgpd.h: MPLS-labeled VPN SAFI is AFI-independent, switch to single
* macro
* bgp_capability_test.c: update test data
* bgp_mp_attr_test.c: idem
* bgp_route.c: (bgp_maximum_prefix_overflow, bgp_table_stats_vty) update
  macro and check conditions (where appropriate)
* bgp_packet.c: (bgp_route_refresh_send, bgp_capability_send,
  bgp_update_receive, bgp_route_refresh_receive): idem
* bgp_open.c: (bgp_capability_vty_out, bgp_afi_safi_valid_indices,
  bgp_open_capability_orf, bgp_open_capability): idem
* bgp_attr.c: (bgp_mp_reach_parse, bgp_packet_attribute,
  bgp_packet_withdraw): idem

13 years agobgpd: fix SAFI for for MPLS labeled VPN-IPv6
Denis Ovsienko [Wed, 13 Jul 2011 12:53:13 +0000 (16:53 +0400)]
bgpd: fix SAFI for for MPLS labeled VPN-IPv6

* bgpd.h: change value of BGP_SAFI_VPNV6 to 128 (RFC4659, BZ#659)
* bgp_route.c: (bgp_table_stats_vty) fix length argument to strncmp()

13 years agobgpd: consistent log msg format (BZ#565)
heasley [Tue, 12 Jul 2011 16:09:18 +0000 (20:09 +0400)]
bgpd: consistent log msg format (BZ#565)

13 years agoospf6d: check MTU with message header size in mind
Dmitrij Tejblum [Tue, 12 Jul 2011 13:53:33 +0000 (17:53 +0400)]
ospf6d: check MTU with message header size in mind

* ospf6_message.c: (ospf6_packet_max): new function, return maximum IPv6
  payload on an interface; (ospf6_hello_send, ospf6_dbdesc_send,
  ospf6_dbdesc_send_newone, ospf6_lsreq_send, ospf6_lsupdate_send_neighbor,
  ospf6_lsupdate_send_interface, ospf6_lsack_send_neighbor,
  ospf6_lsack_send_interface): compare message size with the maximum
  payload instead of the MTU.

13 years agoospf6d: copy "mtu-ignore" option from ospfd
Dmitrij Tejblum [Fri, 22 Apr 2011 15:27:54 +0000 (19:27 +0400)]
ospf6d: copy "mtu-ignore" option from ospfd

"mtu-ignore" is an option ospfd used to mimic from the vendor's
implementation, now ospf6d will also implement it.

* ospf6_interface.h: extend ospf6_interface structure by one flag
* ospf6_interface.c: (ipv6_ospf6_mtu_ignore, no_ipv6_ospf6_mtu_ignore):
  new declarations; (ospf6_interface_create): show initial value for
  consistency; (ospf6_interface_show): print flag status
* ospf6_message.c: (ospf6_dbdesc_recv): consider interface-specific flag
  when checking MTU

13 years agoversion RE-0.99.17.1
Denis Ovsienko [Tue, 12 Jul 2011 13:14:13 +0000 (17:14 +0400)]
version RE-0.99.17.1

13 years agobgpd: Remove AS Path limit/TTL functionality
Paul Jakma [Mon, 4 Jul 2011 20:41:59 +0000 (00:41 +0400)]
bgpd: Remove AS Path limit/TTL functionality

* draft-ietf-idr-as-pathlimit doesn't seem to have gone anywhere, and its
  author does not think it will make progress in IDR. Remove all support
  introduced for it, but leave stubs for the commands to avoid breaking
  any configurations.

  Basically reverts cecab5e9725792e60a5e4b473e238a14cd85815d.
(cherry picked from commit c8f3fe3063cb9ff193b13011cfbda3e605395340)

Conflicts:

bgpd/bgp_attr.c (caused by c8e7b895, resolved)

13 years agobgpd/security: CVE-2010-1674 Fix crash due to extended-community parser error
Paul Jakma [Sun, 5 Dec 2010 17:17:26 +0000 (17:17 +0000)]
bgpd/security: CVE-2010-1674 Fix crash due to extended-community parser error

* bgp_attr.c: (bgp_attr_ext_communities) Certain extended-community attrs
  can leave attr->flag indicating ext-community is present, even though no
  extended-community object has been attached to the attr structure.  Thus a
  null-pointer dereference can occur later.
  (bgp_attr_community) No bug fixed here, but tidy up flow so it has same
  form as previous.

  Problem and fix thanks to anonymous reporter.
(cherry picked from commit 0c46638122f10019a12ae9668aec91691cf2e017)

13 years agodoc: fix "ipv6 address" interface command syntax (#608)
Denis Ovsienko [Fri, 18 Mar 2011 17:20:53 +0000 (20:20 +0300)]
doc: fix "ipv6 address" interface command syntax (#608)
(cherry picked from commit e6844aa5d23cf56dd1f31afc96e8145ab188953f)

13 years agoripd: resolve debug statements issue (bug 442)
Andrew J. Schorr [Thu, 24 Feb 2011 10:52:14 +0000 (13:52 +0300)]
ripd: resolve debug statements issue (bug 442)

...A nasty bug, if you forgot to disable debugging, stored the config
and reboot your machine - if you really depend on ripd, then the machine
will not fully come back on the network, because ripd fails.
(cherry picked from commit 0fa0335316ce14a79ea4bbb0c40e1322c9941dd3)

13 years agobgpd: VTY string fixes for debug commands
David Ward [Mon, 17 Jan 2011 07:58:52 +0000 (10:58 +0300)]
bgpd: VTY string fixes for debug commands

* bgpd/bgp_debug.c: fix VTY strings for BGP debug commands to match
  correct syntax
(cherry picked from commit 6e22b9017e1ae2ce61c383b1b2b63973207704ac)

13 years agobgpd: fix handling of "Unsupported Capability"
Dmitrij Tejblum [Fri, 14 Jan 2011 15:27:05 +0000 (18:27 +0300)]
bgpd: fix handling of "Unsupported Capability"

* bgp_packet.c: (bgp_notify_receive) justify the difference between
BGP_NOTIFY_OPEN_UNSUP_PARAM and BGP_NOTIFY_OPEN_UNSUP_CAPBL cases, as
it is explained in RFC5492, page 3, paragraph 1.

"Unsupported Capability" error does not mean, that the peer doesn't
support capabilities advertisement -- quite the opposite (if the peer
would not support capabilities advertisement, the code would be
"Unsupported Optional Parameter"). Thus there is no reason to mark
the peer as one non-supporting capabilities advertisement.

Example: suppose the peer is in fact IPv6-only, but we didn't configure
anything address-family specific for it. Then, the peer would refuse
the session with "Unsupported Capability" code. If we internally set
the peer as non-supporting capabilities advertisement after that, we
will not be able to establish the session with it ever, even with a
fixed configuration -- IPv6-only BGP session cannot be established
without capabilities.

In practice an edge case would be seen as the same IPv6 peer working
with its "neighbor" block read from bgpd.conf, but not working, when
slowly input in "conf t" mode.
(cherry picked from commit c7aa8abd8788c3607ad0131f02e892cf92221e40)

13 years agoospf6d: fix crash in SPF calculation
Dmitrij Tejblum [Thu, 13 Jan 2011 15:25:40 +0000 (18:25 +0300)]
ospf6d: fix crash in SPF calculation

* ospf6_spf.c: Don't replace a node with another node with a lower
  number of hops, instead get them from the queue in the correct
  order. (Actually, the replacement crashed the ospf6d daemon
  rather than worked.)
(cherry picked from commit 403138e189c24f6867824c4eeb668d11564e1ca0)

13 years agobgpd: fix community-list error message spelling
Denis Ovsienko [Wed, 8 Dec 2010 15:51:37 +0000 (18:51 +0300)]
bgpd: fix community-list error message spelling

* bgp_vty.c: (community_list_perror, show_ip_community_list_arg,
  show_ip_extcommunity_list_arg) fix spelling
(cherry picked from commit b729294c8c5c6f2af8ddf6cfbea2374b6faabe9d)

14 years agoinfrastructure: Express preference for published git repos
Greg Troxel [Wed, 3 Nov 2010 11:37:23 +0000 (07:37 -0400)]
infrastructure: Express preference for published git repos

* HACKING: Express notion that a published git repository is
  preferred.  Fold request for commit message into patch section.
  Express desire for comments in code explaining correctness of
  post-commit state, and for commit message to explain correctness of
  the change.

14 years agoinfrastructure: Whitespace cleanup.
Greg Troxel [Wed, 3 Nov 2010 11:22:00 +0000 (07:22 -0400)]
infrastructure: Whitespace cleanup.

HACKING: Whitespace changes only.

14 years agoinfrastructure: Clarify commit message format.
Greg Troxel [Wed, 3 Nov 2010 11:20:38 +0000 (07:20 -0400)]
infrastructure: Clarify commit message format.

Note 54/72 line length rules, and that this is intended to play nice
with "git log --oneline".

14 years agoAdjust description of tomhenderson repo.
Greg Troxel [Wed, 3 Nov 2010 11:16:32 +0000 (07:16 -0400)]
Adjust description of tomhenderson repo.

Tom's repo is now a clone of the official repo and has an mttr branch
off of 0.99.17.

14 years agobgpd: fix printed value of last-update timestamp
Vladimir L Ivanov [Thu, 21 Oct 2010 10:59:54 +0000 (14:59 +0400)]
bgpd: fix printed value of last-update timestamp

* bgp_route.c: (route_vty_out_detail) calculate time value
    in a way, which works regardless of monotonic clock
    being used or not

14 years agozclient: fix router-id calculation for IPv6 (#595)
Dmitry Tejblum [Mon, 18 Oct 2010 15:05:39 +0000 (19:05 +0400)]
zclient: fix router-id calculation for IPv6 (#595)

If router-id is not specified in ospf6d.conf, ospf6d will get it from
the zebra daemon. But ospf6d originates Link LSAs before the router-id
is returned by zebra, thus this router's Link LSAs will be flooded
with AdvRouter set to 0.

* zclient.c: zclient_start(): send ZEBRA_INTERFACE_ADD message after
  ZEBRA_ROUTER_ID_ADD, not before

14 years agobgpd, lib: adopt afi_t and safi_t in several places
Michael Lambert [Thu, 22 Jul 2010 17:20:55 +0000 (13:20 -0400)]
bgpd, lib: adopt afi_t and safi_t in several places

* bgpd/bgp_attr.c, bgpd/bgp_open.h, bgpd/bgp_route.c, lib/prefix.c,
  lib/prefix.h: Various integer types were being used where, if we
  had strict type checking, afi_t and safi_t would be required.

Signed-off-by: G.Balaji <balajig81@gmail.com>
(cherry picked from commit c8af35ffa2dc79ff7d7ff00b1b61f1f50a100ab6)

14 years agoAdd MTR repository.
Greg Troxel [Fri, 24 Sep 2010 13:22:37 +0000 (09:22 -0400)]
Add MTR repository.

14 years agolib/vty.c: add missing format string when printing out motd message
Nico Golde [Sun, 1 Aug 2010 13:24:35 +0000 (15:24 +0200)]
lib/vty.c: add missing format string when printing out motd message

Signed-off-by: G.Balaji <balajig81@gmail.com>
14 years agoDocument rules for zalloc and friends.
Greg Troxel [Fri, 17 Sep 2010 16:19:13 +0000 (12:19 -0400)]
Document rules for zalloc and friends.

lib/memory.c:z{a,c,re}alloc, zfree, zdup: add requires/effects
comments.

14 years agoAdd pointer to Balaji G. git.
Greg Troxel [Fri, 17 Sep 2010 15:02:45 +0000 (11:02 -0400)]
Add pointer to Balaji G. git.

Balaji has been accumulating patches from the mailing list and
pre-screening them and spiffing up commit messages.

14 years agoSet from even if binfo->extra is NULL.
Greg Troxel [Fri, 17 Sep 2010 14:47:49 +0000 (10:47 -0400)]
Set from even if binfo->extra is NULL.

bgpd/bgp_packet.c:bgp_update_packet(): When extracting the peer, don't
  fail to extract it because "binfo->extra" is NULL.  While one should
  certainly avoid dereferencing binfo->extra, that's not a good reason
  not to use binfo->peer.

Fixes https://bugzilla.quagga.net/show_bug.cgi?id=497.
Patch by Eric Sobocinksi.

14 years agoZebra zserv: bogus conditional
Stephen Hemminger [Wed, 18 Aug 2010 22:56:46 +0000 (15:56 -0700)]
Zebra zserv: bogus conditional

This looks like a bug in original code from misunderstanding
of C rules of evaluation.

14 years agorelease: 0.99.17
Denis Ovsienko [Thu, 19 Aug 2010 09:36:43 +0000 (13:36 +0400)]
release: 0.99.17

* configure.ac: bump up version number

14 years agobgpd: fix handling of AS path data
Chris Hall [Mon, 9 Aug 2010 18:31:37 +0000 (22:31 +0400)]
bgpd: fix handling of AS path data

* bgpd/bgp_aspath.c
  * assegments_parse(): add handling of AS4_PATH input, update bounds
    checks, add check for AS segment type
  * aspath_parse(): add handling of AS4_PATH input, expect
    assegments_parse() to do length checking
  * aspath_empty(): update for the new function prototype
* bgpd/bgp_aspath.h: ditto
* tests/aspath_test.c: ditto
* bgpd/bgp_attr.c
  * bgp_attr_aspath(): add handling of AS4_PATH input, update flags
    checks, change returned type
  * bgp_attr_as4_path(): discard, superseded by bgp_attr_aspath()
  * bgp_attr_parse(): update respectively

14 years agobgpd: tighten bounds checking in RR ORF msg reader
Chris Hall [Fri, 14 May 2010 12:38:39 +0000 (16:38 +0400)]
bgpd: tighten bounds checking in RR ORF msg reader

* bgp_packet.c: (bgp_route_refresh_receive) add validation of
  "Length" (RFC5292) field value, check input stream bounds
  each time bytes are pulled from it

15 years agozebra: fix infinite loop when deleting an interface
Roman Hoog Antink [Wed, 5 May 2010 14:00:50 +0000 (16:00 +0200)]
zebra: fix infinite loop when deleting an interface

When deleting a VLAN interface after flushing its
addresses, zebra uses 100% CPU time and freezes.

 * interface.c: The while loop in line 407 that
   should clean up connected routes never hits one
   of the 2 lines "last = node;" and thus loops
   forever.

Signed-off-by: Roman Hoog Antink <rha@open.ch>
15 years agoUpdate for git and emphasize asking for good reports.
Greg Troxel [Wed, 5 May 2010 11:51:26 +0000 (07:51 -0400)]
Update for git and emphasize asking for good reports.

15 years agobuild: ignore mkinstalldirs and texinfo.tex
David Lamparter [Wed, 16 Sep 2009 00:20:00 +0000 (02:20 +0200)]
build: ignore mkinstalldirs and texinfo.tex

these are autogenerated by autoreconf, drop them from git.

15 years agoisisd: change ISIS_METHOD to use C preprocessor
David Lamparter [Tue, 2 Feb 2010 20:49:35 +0000 (21:49 +0100)]
isisd: change ISIS_METHOD to use C preprocessor

this fixes warnings from vtysh extract.pl by making sure the isis method
files always 'work'. (previously, extract.pl would grab unselected isis
method sources and then complain about missing headers)

15 years agoospf6d: Fix crash when '[no] ipv6 ospf6 advertise prefix-list' is in startup-config
David Ward [Tue, 5 Jan 2010 02:45:39 +0000 (02:45 +0000)]
ospf6d: Fix crash when '[no] ipv6 ospf6 advertise prefix-list' is in startup-config

* ospf6_interface.c: When '[no] ipv6 ospf6 advertise prefix-list'
  appears in the startup configuration for ospf6d, a crash occurs,
  because ospf6d attempts to schedule LSAs when the 'oi->area'
  structure has not yet been initialized.

  Now, when the command above is issued (either in the startup
  configuration or at runtime), ospf6d will only schedule LSAs if
  the 'oi->area' structure has been initalized. A similar test is
  already used when handling the commands 'ipv6 ospf6 priority'
  and 'ipv6 ospf6 cost'.

15 years agobuild/extra: Enhance README.NetBSD make/gmake decision.
Greg Troxel [Tue, 20 Apr 2010 16:44:21 +0000 (12:44 -0400)]
build/extra: Enhance README.NetBSD make/gmake decision.

15 years agoospfd: Only refresh external default route once.
Joakim Tjernlund [Wed, 14 Apr 2010 14:01:25 +0000 (16:01 +0200)]
ospfd: Only refresh external default route once.

* ospf_zebra.c: (ospf_distribute_list_update_timer) forces a
  refresh of default route each time it finds a default prefix.
  This is suboptimal, just record that it needs to be done and
  do it once.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
15 years agoospfd: Make sure ospf_distribute_list_update_timer() eventually runs.
Joakim Tjernlund [Wed, 14 Apr 2010 09:05:28 +0000 (11:05 +0200)]
ospfd: Make sure ospf_distribute_list_update_timer() eventually runs.

* ospf_zebra.c: (ospf_distribute_list_update_timer)
   If there are updates to the distribute list every 5 second or less,
   ospf_distribute_list_update_timer() will never run as the timer gets
   rearmed for each update. This fixes it by never rearming an active
   distribute list timer.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
15 years agoospfd: Make sure all external routes are updated.
Joakim Tjernlund [Wed, 14 Apr 2010 09:05:27 +0000 (11:05 +0200)]
ospfd: Make sure all external routes are updated.

Roman Hoog Antink <rha@open.ch> reports:

When adding a connected route (using vtysh, without restart) to the
redistribution access list of ospfd, while static routes already exist,
the update timer ospf_distribute_list_update_timer() is being run for
static routes only. That way, the connected route never appears in the
OSPF database, until quagga is completely restarted.

The update timer for connected routes is cancelled in
ospfd/ospfd_zebra.c:ospf_distribute_list_update():976, were a new timer
is scheduled for static routes, caused by the loop in ospf_filter_update().

 * ospf_zebra.c: (ospf_distribute_list_update_timer) make it
   refresh all external routes. This fixes the problem
   reported by Roman.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
15 years agogit: add pointers to out-of-tree work
Greg Troxel [Sun, 18 Apr 2010 16:50:21 +0000 (12:50 -0400)]
git: add pointers to out-of-tree work

* (HACKING.pending): List known places where work on quagga that is
  not (yet) integrated into the main tree can be found.

15 years agogit: add (generated) m4 files to .gitignore
Greg Troxel [Wed, 14 Apr 2010 19:24:52 +0000 (15:24 -0400)]
git: add (generated) m4 files to .gitignore

15 years agodoc: fixed spelling in bgpd.texi
Ivan Moskalyov [Thu, 11 Mar 2010 14:14:35 +0000 (17:14 +0300)]
doc: fixed spelling in bgpd.texi

15 years agobuild: Add QuaggaId to README.NetBSD
Greg Troxel [Wed, 10 Mar 2010 19:03:54 +0000 (14:03 -0500)]
build: Add QuaggaId to README.NetBSD

15 years agorelease: 0.99.16
Denis Ovsienko [Tue, 9 Mar 2010 10:53:20 +0000 (13:53 +0300)]
release: 0.99.16

* configure.ac: bump up version number

15 years agolib: undo the last PIE commit
Stephen Hemminger [Wed, 27 Jan 2010 09:38:16 +0000 (12:38 +0300)]
lib: undo the last PIE commit

Stephen:
A recent change breaks build Quagga on Debian Lenny with amd64 (but not
i386). Not sure whether this is cause by ld, gcc, or libtool; but
whatever it just won't work for a large number of users.

Mathias:
I would guess it's a problem of libtool because it adds "-fPIC -DPIC" to
the compiler flags but doesn't remove -fPIE. That wouldn't be a problem
if the compiler would ignore the -fPIE in favor to the latter -fPIC, but
obviously it does not. [...] Those objects were actually compiled with
-fPIC but also -fPIE which seems to confuse gcc.

15 years agolib: fix PIE build flags
Mathias Krause [Wed, 20 Jan 2010 14:39:13 +0000 (17:39 +0300)]
lib: fix PIE build flags

Because the final executables are built as position independent
executables (PIE) -- when configure has detected compiler supported for
PIE -- the objects in the library archive must be built in that way,
too. Otherwise the runtime linker has to do unneccesary relocation for
each start of the program. Even worse, the programs won't even be able
to start on a (hardened) kernel that doesn't allow those relocations to
happen by preventing making the .text segment writable (PaX's MPROTECT
feature comes to mind). The attached patch fixes this issue by adding
the appropriate flags to the Makefile.am.

15 years agobgp: use monotonic clock for time of day
Stephen Hemminger [Fri, 15 Jan 2010 13:22:10 +0000 (16:22 +0300)]
bgp: use monotonic clock for time of day

BGP uses time() to get system time of day; but that value
fluctuates with time adjustments from NTP. This can cause premature
flapping of peer sessions and other failures.

Use the system monotonic clock supported by Quagga thread library
to avoid issue.

See: http://bugzilla.vyatta.com/show_bug.cgi?id=4467

* bgpd/bgp_fsm.c
  * bgp_uptime_reset(): dismiss function
* bgpd/bgpd.c
  * bgp_clock(): new function
* bgpd/bgp_damp.c
  * bgp_reuse_timer(): employ bgp_clock() instead of time(NULL)
  * bgp_damp_withdraw(): idem
  * bgp_damp_update(): idem
  * bgp_damp_scan(): idem
  * bgp_damp_info_vty(): idem
  * bgp_damp_reuse_time_vty(): idem
* bgpd/bgp_fsm.c
  * bgp_routeadv_timer(): idem
  * bgp_stop(): idem
  * bgp_establish(): idem
* bgpd/bgp_packet.c
  * bgp_update_receive(): idem
* bgpd/bgp_route.c
  * bgp_update_rsclient(): idem
  * bgp_update_main(): idem
  * bgp_static_update_rsclient(): idem
  * bgp_static_update_main(): idem
  * bgp_static_update_vpnv4(): idem
  * bgp_aggregate_route(): idem
  * bgp_aggregate_add(): idem
  * bgp_redistribute_add(): idem
* bgpd/bgp_snmp.c
  * bgpPeerTable(): idem
  * bgpTrapEstablished(): idem
  * bgpTrapBackwardTransition(): idem
* bgpd/bgpd.c
  * peer_create(): idem
  * peer_uptime(): idem
  * bgp_master_init(): idem

15 years agoospfd: Fix debug messages that were masked by DISCARD_LSA
Paul Jakma [Thu, 14 Jan 2010 13:26:12 +0000 (16:26 +0300)]
ospfd: Fix debug messages that were masked by DISCARD_LSA

* ospf_packet.c: (ospf_ls_upd) DISCARD_LSA continues, and so should be
after debug messages, not before them.

15 years agoospfd: remove unneeded memset from a very hot function
Paul Jakma [Thu, 14 Jan 2010 13:19:40 +0000 (16:19 +0300)]
ospfd: remove unneeded memset from a very hot function

* ospf_lsdb.c: (lsdb_prefix_set) memset is unneeded, as all fields are
initialised explicitly, and this function can be in the top-3 of a
profile when there are a lot of LSAs.

15 years agolib: fix memory logging
David Ward [Wed, 13 Jan 2010 17:10:56 +0000 (20:10 +0300)]
lib: fix memory logging

* lib/memory.h
  * mtype_zcalloc(): correct function prototype
  * XFREE(): make both definitions consistent in setting
    the pointer to NULL after freeing the memory

These changes will only have an effect if MEMORY_LOG is defined
(it is not by default).

15 years agozebra: change router-id selection algo
Stephen Hemminger [Mon, 21 Dec 2009 15:50:43 +0000 (18:50 +0300)]
zebra: change router-id selection algo

The router-id table looks like is supposed to be sorted in current
quagga code, but the nodes are not added with the sorting
function.

The sorting function is host byte order dependent.
The values need to converted before comparison.

Fixing this causes Zebra to choose the largest IP address
as router-id, rather than the last address. This probably will
surprise some users. The other option would be to just remove the
comparison function and keep the existing LIFO behavior.

Lastly, simple subtraction works well for comparing.

* zebra/router-id.c
  * router_id_add_address(): employ listnode_add_sort()
  * router_id_cmp(): employ ntohl(), then compare integers

15 years agolib: make some structures constant
Stephen Hemminger [Mon, 21 Dec 2009 09:54:58 +0000 (12:54 +0300)]
lib: make some structures constant

* isisd/isis_pdu.c
  * maskbit: this pre-initialized array is not modified
* lib/prefix.c
  * maskbit: idem
* lib/command.c
  * facility_map: idem
  * itoa64: idem
  * default_motd: make local var static
  * facility_name(): update local var accordingly
  * facility_match(): idem

15 years agobgpd: code cleanup
Stephen Hemminger [Thu, 17 Dec 2009 10:14:28 +0000 (13:14 +0300)]
bgpd: code cleanup

* bgpd/bgp_aspath.c
  * ashash: only used in one file, make static
  * aspath_count_numas(): dead code, sayonara
* bgpd/bgpd.c
  * peer_nsf_stop(): only used in one file, make static
* bgpd/bgp_packet.h
  * bgp_capability_receive(): add missing prototype for a
    global function

15 years agoripd: fix compiler warnings
Stephen Hemminger [Thu, 10 Dec 2009 16:16:05 +0000 (19:16 +0300)]
ripd: fix compiler warnings

* ripd/rip_interface.c
  * rip_request_neighbor(): comment out, unused
  * rip_request_neighbor_all(): idem
  * rip_interface_up(): Cast flags otherwise compiler complains
    about %lld not matching uint64_t on 64 bit x86. Print in hex
    since flags are bit field.
  * rip_interface_add(): idem
  * rip_interface_delete(): idem
* ripd/rip_zebra.c
  * rip_redistribute_set(): comment out, unused
* ripd/ripd.h
  * rip_redistribute_check(): move prototype here so compiler
    can check function against prototype
* ripd/ripd.c
  * rip_update_default_metric(): comment out, unused

15 years agoospf6d: remove dead code
Stephen Hemminger [Thu, 10 Dec 2009 13:18:41 +0000 (16:18 +0300)]
ospf6d: remove dead code

* ospf6d/ospf6_interface.c
  * loopind(): sayonara
* ospf6d/ospf6_top.c
  * ospf6_delete(): comment out, it might be useful if real shutdown is
    added

15 years agoospf6d: fix warnings from recent prefix bit commit
Stephen Hemminger [Thu, 10 Dec 2009 13:13:09 +0000 (16:13 +0300)]
ospf6d: fix warnings from recent prefix bit commit

* lib/prefix.h
  * prefix6_bit(): add IPv6 wrapper for prefix_bit()
* ospf6d/ospf6_lsdb.c
  * ospf6_lsdb_type_router_head(): employ prefix6_bit()
  * ospf6_lsdb_type_head(): idem

15 years agoripngd: compiler warnings cleanup
Stephen Hemminger [Thu, 10 Dec 2009 12:52:33 +0000 (15:52 +0300)]
ripngd: compiler warnings cleanup

* ripngd/ripng_interface.c
  * ripng_check_max_mtu(): unused, sayonara
  * ripng_interface_down(): cast flag arguments to logging function
  * ripng_interface_add(): idem
  * ripng_interface_delete(): idem
* ripngd/ripngd.c
  * ripng_recv_packet(): avoid aliasing warning dereferencing pointer

15 years agozebra: deal with irdp compile warnings
Stephen Hemminger [Thu, 10 Dec 2009 11:22:44 +0000 (14:22 +0300)]
zebra: deal with irdp compile warnings

* zebra/irdp.h
  * irdp_send_thread(): move prototype to common header file
  * irdp_advert_off(): idem
  * process_solicit(): idem
  * irdp_read_raw(): idem
  * send_packet(): idem
* zebra/irdp_interface.c
  * inet_2a(): move function to where it is used
  * in_cksum(): lib/checksum.h already provides prototype
  * irdp_send_thread(): prototype moved away
  * inet_2a(): idem
  * irdp_advert_off(): idem
  * b1, b2, b3, b4: get rid of global buffers for inet_2a()
  * if_group(): add local buffer for inet_2a()
  * if_add_group(): idem
  * if_drop_group(): idem
  * irdp_config_write(): idem
  * Adv_new(): make static
* zebra/irdp_main.c
  * irdp_read_raw(): prototype moved away
  * send_packet(): idem
  * in_cksum(): lib/checksum.h already provides prototype
  * inet_2a(): function moved to irdp_interface.c
* zebra/irdp_packet.c
  * b1, b2, b3, b4: get rid of global buffers for inet_2a()
  * in_cksum(): lib/checksum.h already provides prototype
  * process_solicit(): prototype moved away
  * irdp_read_raw(): fix uninitialized variable

15 years agobgpd: compile warnings cleanup
Stephen Hemminger [Thu, 10 Dec 2009 08:57:05 +0000 (11:57 +0300)]
bgpd: compile warnings cleanup

* bgpd/bgp_fsm.c
  * bgp_clearing_completed(): only used in one file, can be static
* bgpd/bgp_packet.c
  * afi2str(): sayonara
  * safi2str(): sayonara
* bgpd/bgp_route.c
  * bgp_distance_reset(): sayonara
* bgpd/bgp_zebra.c
  * bgp_ifindex_by_nexthop(): sayonara

15 years agozebra: cleanup RIB meta queue code
Stephen Hemminger [Wed, 9 Dec 2009 14:54:49 +0000 (17:54 +0300)]
zebra: cleanup RIB meta queue code

* zebra/zebra_rib.c
  * rib_queue_add(): indent comments and simplify debug code
  * rib_queue_init(): remove unneeded assert() calls and
    extra return statements

15 years agolib: move check_bit into prefix common code
Stephen Hemminger [Wed, 9 Dec 2009 11:43:17 +0000 (14:43 +0300)]
lib: move check_bit into prefix common code

Make one version of check prefix bit, and put it inline
with proper prototype. This gets rid of some macro's and also some
assert() that can never happen on a non-broken compiler.

* bgpd/bgp_table.c
  * CHECK_BIT(): sayonara
  * check_bit(): sayonara
  * SET_LINK(): sayonara
  * set_link(): make use of prefix_bit() instead of check_bit()
  * bgp_node_match(): idem
  * bgp_node_lookup(): idem
  * bgp_node_get(): idem
* lib/prefix.h
  * prefix_bit(): new inline version of check_bit()
* lib/table.c
  * CHECK_BIT(): sayonara
  * check_bit(): sayonara
  * SET_LINK(): sayonara
  * set_link(): make use of prefix_bit() instead of check_bit()
  * route_node_match(): idem
  * route_node_lookup(): idem
  * route_node_get(): idem
* ospf6d/ospf6_lsdb.c
  * CHECK_BIT(): sayonara
  * ospf6_lsdb_lookup_next(): make use of prefix_bit() instead of
    CHECK_BIT()
  * ospf6_lsdb_type_router_head(): idem
  * ospf6_lsdb_type_head(): idem
* ospf6d/ospf6_route.c
  * CHECK_BIT(): sayonara
  * ospf6_route_match_head() make use of prefix_bit() instead of
  * CHECK_BIT()

15 years agolib: fix warning on little endian
Stephen Hemminger [Wed, 9 Dec 2009 11:13:27 +0000 (14:13 +0300)]
lib: fix warning on little endian

* md5.c
  * md5_calc(): If building on little endian then X
    will be 'const uint32_t' which causes compiler
    warning in code that never gets used. Just move
    the endif to make sure code is not checked.

15 years agozebra: fix more warnings in rtadv
Stephen Hemminger [Tue, 8 Dec 2009 10:26:14 +0000 (13:26 +0300)]
zebra: fix more warnings in rtadv

* zebra/rtadv.c
  * rtadv_free(): remove unused function
  * rtadv_recv_packet(): break up cast/dereference to avoid
    compiler type pun warning
  * rtadv_read(): initialize ifindex, because compiler can't
    figure out that it is okay

15 years agoMerge branch 'master' of ssh://code.quagga.net/var/lib/git/quagga
Denis Ovsienko [Tue, 8 Dec 2009 10:15:12 +0000 (13:15 +0300)]
Merge branch 'master' of ssh://code.quagga.net/var/lib/git/quagga

15 years agozebra: fix more compiler warnings
Stephen Hemminger [Tue, 8 Dec 2009 10:14:27 +0000 (13:14 +0300)]
zebra: fix more compiler warnings

* zebra/zebra_rib.c
  * nexthop_active_update(): make local int vars unsigned
  * nexthop_active_check(): return unsigned for consistency
  * rib_dump(): cast time in printf format
  * vrf_free(): remove unused function
  * vrf_lookup_by_name(): idem
  * rib_if_up(): idem
  * rib_if_down(): idem

15 years agozebra: remove unused function to fix warning
Stephen Hemminger [Tue, 8 Dec 2009 09:27:02 +0000 (12:27 +0300)]
zebra: remove unused function to fix warning

* zebra/interface.c
  * if_supported_family(): sayonara

15 years agolib: make match functions take const args
Stephen Hemminger [Tue, 8 Dec 2009 09:00:50 +0000 (12:00 +0300)]
lib: make match functions take const args

* table.c: general type safety and compiler help:
  * maskbit[]: become const
  * route_node_match(): take const args
  * route_node_match_ipv4(): idem
  * route_node_match_ipv6(): idem
  * check_bit(): idem, plus adjust local vars typing