]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
12 years agoospf6d: implement 'match interface' for route-maps
Vyacheslav Trushkin [Wed, 16 Nov 2011 10:22:03 +0000 (14:22 +0400)]
ospf6d: implement 'match interface' for route-maps

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.

12 years agodoc: rectify "match ip next-hop" in ripd (BZ#537)
Roderick Schertler [Wed, 16 Nov 2011 11:03:14 +0000 (15:03 +0400)]
doc: rectify "match ip next-hop" in ripd (BZ#537)

12 years agobgpd: fix AS4_PATH attr flag check (BZ#676)
Denis Ovsienko [Thu, 27 Oct 2011 16:04:08 +0000 (20:04 +0400)]
bgpd: fix AS4_PATH attr flag check (BZ#676)

AS_PATH is a well-known, transitive path attribute and cannot be flagged
as "Partial". This is what commit
77a20b8af32c926176f8492a086d9e4ec670496b implemented, but it did not
account, that bgp_attr_aspath() is also used to process AS4_PATH, which
is an optional, transitive path attribute and as such may be flagged as
"Partial". This change justfies the test condition.

12 years agobgpd: fix 2 more cases of length error reporting
Denis Ovsienko [Wed, 26 Oct 2011 15:34:30 +0000 (19:34 +0400)]
bgpd: fix 2 more cases of length error reporting

* bgp_attr.c (bgp_attr_originator_id, bgp_attr_cluster_list): use
  bgp_notify_send_with_data()

12 years agolib: use prefix bit length macros
Denis Ovsienko [Mon, 24 Oct 2011 14:45:05 +0000 (18:45 +0400)]
lib: use prefix bit length macros

12 years agoospfd: use IS_LSA_SELF() where appropriate
Denis Ovsienko [Mon, 24 Oct 2011 14:17:09 +0000 (18:17 +0400)]
ospfd: use IS_LSA_SELF() where appropriate

12 years agobgpd: rewrite attr flag error logging
Denis Ovsienko [Sun, 23 Oct 2011 18:32:44 +0000 (22:32 +0400)]
bgpd: rewrite attr flag error logging

* bgp_attr.c
  * attr_flag_str: new message list
  * bgp_attr_flags_diagnose(): new function, implements previously added
    error logging in a generic way
  * bgp_attr_origin(): use bgp_attr_flags_diagnose()
  * bgp_attr_nexthop(): ditto
  * bgp_attr_med(): ditto
  * bgp_attr_local_pref(): ditto
  * bgp_attr_atomic(): ditto
  * bgp_attr_originator_id(): ditto
  * bgp_attr_cluster_list(): ditto
  * bgp_mp_reach_parse(): ditto
  * bgp_mp_unreach_parse(): ditto

12 years agoospfd: spelling/format fix
Denis Ovsienko [Sat, 22 Oct 2011 18:18:55 +0000 (22:18 +0400)]
ospfd: spelling/format fix

12 years agobgpd: check AGGREGATOR attr flags (BZ#678)
Denis Ovsienko [Sat, 22 Oct 2011 18:11:31 +0000 (22:11 +0400)]
bgpd: check AGGREGATOR attr flags (BZ#678)

* bgp_attr.c
  * bgp_attr_aggregator(): check Optional/Transitive flag bits

12 years agolib: optimize apply_mask_ipv6()
Denis Ovsienko [Tue, 18 Oct 2011 18:02:52 +0000 (22:02 +0400)]
lib: optimize apply_mask_ipv6()

12 years agolib: optimize apply_mask_ipv4()
Denis Ovsienko [Tue, 18 Oct 2011 14:33:53 +0000 (18:33 +0400)]
lib: optimize apply_mask_ipv4()

12 years agobgpd: fix error message in bgp_attr_aspath()
Denis Ovsienko [Tue, 18 Oct 2011 11:27:21 +0000 (15:27 +0400)]
bgpd: fix error message in bgp_attr_aspath()

12 years agolib: make masklen2ip6() safer and faster
Denis Ovsienko [Mon, 17 Oct 2011 17:11:10 +0000 (21:11 +0400)]
lib: make masklen2ip6() safer and faster

12 years agovty_serv_sock_family unused
Stephen Hemminger [Thu, 10 Dec 2009 17:19:09 +0000 (17:19 +0000)]
vty_serv_sock_family unused

If the vty_serv_sock_addrinfo is being used, then vty_serv_sock_family
is unsed. Fix by adjusting ifdef/else/endif

12 years agoospf6d: decode message type with LOOKUP()
Denis Ovsienko [Fri, 14 Oct 2011 17:59:58 +0000 (21:59 +0400)]
ospf6d: decode message type with LOOKUP()

* 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

12 years agolib: address -Wunused-but-set-variable
Denis Ovsienko [Fri, 14 Oct 2011 16:59:43 +0000 (20:59 +0400)]
lib: address -Wunused-but-set-variable

* if.c
  * if_dump(): 'node', 'c'
* distribute.c
  * distribute_list_all(): 'dist'
  * distribute_list(): 'dist'
  * districute_list_prefix_all(): 'dist'
* if_rmap.c
  * if_rmap(): 'if_rmap'
* vty.c
  * vty_accept(): 'vty'

12 years agolib: spelling
Denis Ovsienko [Fri, 14 Oct 2011 16:56:19 +0000 (20:56 +0400)]
lib: spelling

12 years agolib: add sockopt helper for setting IPV6_V6ONLY and use it
David Lamparter [Sun, 4 Oct 2009 14:21:49 +0000 (16:21 +0200)]
lib: add sockopt helper for setting IPV6_V6ONLY and use it

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.

12 years agolib: put route_types.txt to real use
David Lamparter [Tue, 15 Sep 2009 23:52:42 +0000 (01:52 +0200)]
lib: put route_types.txt to real use

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

12 years agozebra: fix redistribution of new protocols
David Lamparter [Wed, 26 Aug 2009 22:27:40 +0000 (00:27 +0200)]
zebra: fix redistribution of new protocols

redistribute is currently limited to "known" protocols. there is no
reason for this limitation, so, remove it.

12 years agorib: default distance value for new protocols (v2)
David Lamparter [Wed, 26 Aug 2009 22:28:28 +0000 (00:28 +0200)]
rib: default distance value for new protocols (v2)

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)

12 years agobuild: fixup autoconf for cross-compiling (to OpenWRT)
David Lamparter [Wed, 16 Sep 2009 00:11:00 +0000 (02:11 +0200)]
build: fixup autoconf for cross-compiling (to OpenWRT)

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")

12 years agozebra: set the interface link-layer socket address
Tom Goff [Wed, 25 Nov 2009 20:36:06 +0000 (20:36 +0000)]
zebra: set the interface link-layer socket address

* 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().

12 years agobgpd: remove unused function bgp_bind_address
David Lamparter [Tue, 2 Feb 2010 19:20:35 +0000 (20:20 +0100)]
bgpd: remove unused function bgp_bind_address

bgp_bind_address is replaced with sockunion_bind.

12 years agobgpd: fix update-source for IPv6 (BZ#548)
David Lamparter [Tue, 2 Feb 2010 19:18:23 +0000 (20:18 +0100)]
bgpd: fix update-source for IPv6 (BZ#548)

if update-source was given as interface name, bgpd was unconditionally
trying to bind to an IPv4 address from that interface.

change function to find the best-matching (number of address bits)
same-family address on the interface.

12 years agolib: prefix2sockunion, prefix_common_bits helper functions
David Lamparter [Tue, 2 Feb 2010 19:16:35 +0000 (20:16 +0100)]
lib: prefix2sockunion, prefix_common_bits helper functions

prefix2sockunion converts a struct prefix* to a union sockunion *;
prefix_common_bits counts the number of common bits in the prefix's
address part.

12 years agobgpd: fix "nexthop-local unchanged" (BZ#350)
Dylan Hall [Thu, 27 Oct 2011 11:28:17 +0000 (15:28 +0400)]
bgpd: fix "nexthop-local unchanged" (BZ#350)

12 years agobgpd: justify capabilities for TOS setting
Chris Luke [Tue, 18 Oct 2011 13:26:51 +0000 (17:26 +0400)]
bgpd: justify capabilities for TOS setting

To set the TOS bits on TCP connections, platforms that restrict
capabilities need the priv level to be raised before the sockopt
is set, and this requires the ZCAP_NET_ADMIN priv.

* bgp_main.c: update _caps_p to include ZCAP_NET_ADMIN
* bgp_network.c
  * bgp_connect(): request ZPRIVS_RAISE/ZPRIVS_LOWER
  * bgp_listener(): request ZPRIVS_RAISE earlier

12 years agoospfd: improve fix to CVE-2011-3326 (BZ#586)
Thomas Ries [Thu, 27 Oct 2011 13:43:38 +0000 (17:43 +0400)]
ospfd: improve fix to CVE-2011-3326 (BZ#586)

Make ospf_flood() propagate error returned by ospf_lsa_install() further
to properly discard the malformed LSA, not just prevent the immediate
crash.

12 years agobgpd: revised fix to --dryrun (BZ#622)
Sergey Y. Afonin [Thu, 27 Oct 2011 13:01:11 +0000 (17:01 +0400)]
bgpd: revised fix to --dryrun (BZ#622)

12 years agobgpd: fix more regressions in attr flag checks
Denis Ovsienko [Tue, 18 Oct 2011 10:20:04 +0000 (14:20 +0400)]
bgpd: fix more regressions in attr flag checks

Commit 05a4936b713b9882171d0f7fb20b8439df23939e fixed some of the
attributes involved, but not all. This commit should do it.

* bgp_attr.c
  * bgp_attr_originator_id()
  * bgp_attr_cluster_list()
  * bgp_mp_reach_parse()
  * bgp_mp_unreach_parse()

12 years agolib: fix endianness of masklen2ip()
Denis Ovsienko [Tue, 11 Oct 2011 11:17:45 +0000 (15:17 +0400)]
lib: fix endianness of masklen2ip()

12 years agolib: make masklen2ip() safer and faster
Denis Ovsienko [Sat, 8 Oct 2011 14:15:21 +0000 (18:15 +0400)]
lib: make masklen2ip() safer and faster

12 years agoospf6d: make some old sizing checks assertions
Denis Ovsienko [Sat, 8 Oct 2011 13:22:45 +0000 (17:22 +0400)]
ospf6d: make some old sizing checks assertions

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()

12 years agozebra: trivial warning fix
Paul Jakma [Mon, 11 Apr 2011 15:33:20 +0000 (16:33 +0100)]
zebra: trivial warning fix

* zebra_routemap.c: (route_set_src) get rid of the dummy family variable.

12 years agodoc: Add dependency for quagga.pdf make target
Paul Jakma [Wed, 30 Mar 2011 13:30:20 +0000 (14:30 +0100)]
doc: Add dependency for quagga.pdf make target

* doc/Makefile.am: pdf target needs to depend on all the input files.

12 years agobgpd: improve "monotonic" uptime correction
John Kemp [Fri, 18 Mar 2011 14:52:18 +0000 (17:52 +0300)]
bgpd: improve "monotonic" uptime correction

Older versions of Quagga/Zebra would output a value in MRT table
dump files for "uptime" aka "ORIGINATED" that was a WALL clock
value.  Given that uptime is now internally a bgp_clock MONOTONIC
value, the output in the MRT files is showing up as monotonic.

Note: time of MRT dump is still recorded correctly as a
time() based value, so we haven't lost that value.

Proposal is to correct the uptime output on the vty and in the
MRT files to again display something more akin to WALL time.

* bgp_dump.c: (bgp_dump_routes_func) add conditional correction
* bgp_route.c: (route_vty_out_detail) make correction conditional, move
  variable declaration to beginning of the function

12 years agoripngd: copy debug statements fix from ripd
Stephen Hemminger [Sat, 12 Mar 2011 22:14:08 +0000 (01:14 +0300)]
ripngd: copy debug statements fix from ripd

Doesn't ripng needs same fix as ripd.

12 years agodoc: "[no] router zebra" does not belong to ospfd
Denis Ovsienko [Fri, 7 Oct 2011 16:43:59 +0000 (20:43 +0400)]
doc: "[no] router zebra" does not belong to ospfd

12 years agoospfd: justify ospf_default_originate_timer()
Denis Ovsienko [Mon, 3 Oct 2011 10:08:01 +0000 (14:08 +0400)]
ospfd: justify ospf_default_originate_timer()

The function is implemented in ospf_lsa.c, move its "extern" declaration
to ospf_lsa.h for consistency.

12 years agobgpd: add flag checks for MP_(UN)REACH_NLRI
Denis Ovsienko [Mon, 10 Oct 2011 17:08:33 +0000 (21:08 +0400)]
bgpd: add flag checks for MP_(UN)REACH_NLRI

* bgp_attr.[ch]
  * bgp_mp_reach_parse(): add extra arguments and a uniform flag
    check block
  * bgp_mp_unreach_parse(): idem
  * bgp_attr_parse(): provide extra arguments
* bgp_mp_attr_test.c
  * parse_test(): justify respective calls

12 years agobgpd: improve attr length error handling (BZ#679)
Denis Ovsienko [Sat, 8 Oct 2011 09:54:48 +0000 (13:54 +0400)]
bgpd: improve attr length error handling (BZ#679)

* bgp_attr.c
  * bgp_attr_parse(): provide extra argument to bgp_attr_aggregator()
  * bgp_attr_local_pref(): use bgp_notify_send_with_data()
  * bgp_attr_atomic(): idem
  * bgp_attr_aggregator(): idem

12 years agobgpd: fix spelling of CLUSTER_LIST
Denis Ovsienko [Mon, 10 Oct 2011 12:52:20 +0000 (16:52 +0400)]
bgpd: fix spelling of CLUSTER_LIST

12 years agobgpd: check CLUSTER_LIST attribute flags
Denis Ovsienko [Fri, 30 Sep 2011 11:12:17 +0000 (15:12 +0400)]
bgpd: check CLUSTER_LIST attribute flags

* bgp_attr.c
  * bgp_attr_cluster_list(): accept extra argument, add checks for
    "optional", "transitive" and "partial" bits, log each error
    condition independently
  * bgp_attr_parse(): provide extra arguments

12 years agobgpd: check ORIGINATOR_ID attribute flags
Denis Ovsienko [Fri, 30 Sep 2011 11:08:54 +0000 (15:08 +0400)]
bgpd: check ORIGINATOR_ID attribute flags

* bgp_attr.c
  * bgp_attr_originator_id(): accept extra argument, add checks for
    "optional", "transitive" and "partial" bits, log each error
    condition independently
  * bgp_attr_parse(): provide extra arguments

12 years agobgpd: fix regression in improved attr flag checks
Denis Ovsienko [Wed, 12 Oct 2011 09:54:21 +0000 (13:54 +0400)]
bgpd: fix regression in improved attr flag checks

Commit 2febf323411c1aed9d7694898f852ce2ef36a7e5 assumed every flag
bit except optional/transitive/partial unset, which at times could
not be true for "extended length" bit.

* bgp_attr.c
  * bgp_attr_origin(): exclude BGP_ATTR_FLAG_EXTLEN from comparison
  * bgp_attr_nexthop(): idem
  * bgp_attr_med(): idem
  * bgp_attr_local_pref(): idem
  * bgp_attr_atomic(): idem

12 years agobgpd: improve attr flags checks
Denis Ovsienko [Tue, 27 Sep 2011 11:47:25 +0000 (15:47 +0400)]
bgpd: improve attr flags checks

Do not check each of the Optional/Transitive/Partial attribute
flag bits, when their only valid combination is known in advance,
but still perform bit-deep error message logging. This change
assumes unused (low-order) 4 bits of the flag octet cleared.

* bgp_attr.c
  * bgp_attr_origin(): rewrite check
  * bgp_attr_nexthop(): idem
  * bgp_attr_med(): idem
  * bgp_attr_local_pref(): idem
  * bgp_attr_atomic(): idem

12 years agobgpd: add missing "partial" flag checks (BZ#676)
Denis Ovsienko [Sat, 24 Sep 2011 09:20:43 +0000 (13:20 +0400)]
bgpd: add missing "partial" flag checks (BZ#676)

ORIGIN handling function used to have "partial" bit check and recent
commits added it for NEXT_HOP, MULTI_EXIT_DISC and ATOMIC_AGGREGATE
cases. This commit adds "partial" check for AS_PATH and LOCAL_PREF
cases, which should leave attributes 1 through 6 inclusive completely
covered with attribute flags checks.

* bgp_attr.c
  * bgp_attr_origin(): use bit-by-bit checks for better diagnostics
  * bgp_attr_aspath(): add flag check
  * bgp_attr_local_pref(): idem

12 years agobgpd: ignore 4 bits of attribute flags byte
Denis Ovsienko [Tue, 27 Sep 2011 11:35:39 +0000 (15:35 +0400)]
bgpd: ignore 4 bits of attribute flags byte

12 years agovtysh: [build] silence preprocessor errors in some cases
Dmitrij Tejblum [Tue, 27 Sep 2011 15:27:17 +0000 (19:27 +0400)]
vtysh: [build] silence preprocessor errors in some cases

* extract.pl.in: use configured CPPFLAGS in cpp invocation.

12 years agolib: compile even without IPV6_TCLASS
Denis Ovsienko [Wed, 12 Oct 2011 11:07:34 +0000 (15:07 +0400)]
lib: compile even without IPV6_TCLASS

12 years agoIPv6 transport class suppport
Stephen Hemminger [Wed, 28 Sep 2011 10:23:35 +0000 (14:23 +0400)]
IPv6 transport class suppport

IPv6 supports the same concept of differentiated service for routing
protocols as IPv4, but like too many things, the standards committee
decided that having two names for the same thing wasn't good enough and
introduced a third more generic term transport class.

The socket option to set transport class works the same as IPv4, but the
arguments are different.

* lib/sockopt.[ch]
  * setsockopt_ipv6_tclass(): new function
* bgpd/bgp_network.c
  * bgp_connect(): set socket option
  * bgp_listener(): set socket option
* ospf6d/ospf6_network.c
  * ospf6_set_transport_class(): new function
  * ospf6_serv_sock(): set socket option
* ripngd/ripngd.c
  * ripng_make_socket(): set socket option

12 years agoversion RE-0.99.17.5
Denis Ovsienko [Thu, 29 Sep 2011 12:46:49 +0000 (16:46 +0400)]
version RE-0.99.17.5

12 years agoospfd: fix regression in recent commit
YAMAMOTO Shigeru [Wed, 28 Sep 2011 17:00:14 +0000 (21:00 +0400)]
ospfd: fix regression in recent commit

commit '717750433839762d23a5f8d88fe0b4d57c8d490a' causes SEGV error,
when 'oi = ospf_if_lookup_recv_if (ospf, iph->ip_src, ifp);' returns
NULL.

* ospf_packet.c
  * ospf_read(): change a place of calling 'ospf_verify_header()'

13 years agoversion RE-0.99.17.4
Denis Ovsienko [Mon, 26 Sep 2011 14:37:06 +0000 (18:37 +0400)]
version RE-0.99.17.4

13 years agoospf6d: CVE-2011-3323 (fortify packet reception)
Denis Ovsienko [Mon, 26 Sep 2011 09:18:51 +0000 (13:18 +0400)]
ospf6d: CVE-2011-3323 (fortify packet reception)

This vulnerability (CERT-FI #514840) was reported by CROSS project.

ospf6d processes IPv6 prefix structures in incoming packets without
verifying that the declared prefix length is valid. This leads to a
crash
caused by out of bounds memory access.

* ospf6_abr.h: new macros for size/alignment validation
* ospf6_asbr.h: idem
* ospf6_intra.h: idem
* ospf6_lsa.h: idem
* ospf6_message.h: idem
* ospf6_proto.h: idem
* ospf6_message.c
  * ospf6_packet_minlen: helper array for ospf6_packet_examin()
  * ospf6_lsa_minlen: helper array for ospf6_lsa_examin()
  * ospf6_hello_recv(): do not call ospf6_header_examin(), let upper
    layer verify the input data
  * ospf6_dbdesc_recv(): idem
  * ospf6_lsreq_recv(): idem
  * ospf6_lsupdate_recv(): idem
  * ospf6_lsack_recv(): idem
  * ospf6_prefixes_examin(): new function, implements A.4.1
  * ospf6_lsa_examin(): new function, implements A.4
  * ospf6_lsaseq_examin(): new function, an interface to above
  * ospf6_packet_examin(): new function, implements A.3
  * ospf6_rxpacket_examin(): new function, replaces
    ospf6_header_examin()
  * ospf6_header_examin(): sayonara
  * ospf6_receive(): perform passive interface check earliest possible,
    employ ospf6_rxpacket_examin()

13 years agoospf6d: CVE-2011-3324 (DD LSA assertion)
Denis Ovsienko [Mon, 26 Sep 2011 09:18:36 +0000 (13:18 +0400)]
ospf6d: CVE-2011-3324 (DD LSA assertion)

This vulnerability (CERT-FI #514839) was reported by CROSS project.

When Database Description LSA header list contains trailing zero octets,
ospf6d tries to process this data as an LSA header. This triggers an
assertion in the code and ospf6d shuts down.

* ospf6_lsa.c
  * ospf6_lsa_is_changed(): handle header-only argument(s)
    appropriately, do not treat LSA length underrun as a fatal error.

13 years agoospfd: CVE-2011-3325 part 2 (OSPF pkt type segv)
Denis Ovsienko [Mon, 26 Sep 2011 09:18:02 +0000 (13:18 +0400)]
ospfd: CVE-2011-3325 part 2 (OSPF pkt type segv)

This vulnerability (CERT-FI #514838) was reported by CROSS project.

The error is reproducible only when ospfd debugging is enabled:
  * debug ospf packet all
  * debug ospf zebra
When incoming packet header type field is set to 0x0a, ospfd will crash.

* ospf_packet.c
  * ospf_verify_header(): add type field check
  * ospf_read(): perform input checks early

13 years agoospfd: CVE-2011-3325 part 1 (OSPF header underrun)
Denis Ovsienko [Mon, 26 Sep 2011 09:17:52 +0000 (13:17 +0400)]
ospfd: CVE-2011-3325 part 1 (OSPF header underrun)

This vulnerability (CERT-FI #514838) was reported by CROSS project.

When only 14 first bytes of a Hello packet is delivered, ospfd crashes.

* ospf_packet.c
  * ospf_read(): add size check

13 years agoospfd: CVE-2011-3326 (uknown LSA type segfault)
CROSS [Mon, 26 Sep 2011 09:17:21 +0000 (13:17 +0400)]
ospfd: CVE-2011-3326 (uknown LSA type segfault)

This vulnerability (CERT-FI #514837) was reported by CROSS project.
They have also suggested a fix to the problem, which was found
acceptable.

Quagga ospfd does not seem to handle unknown LSA types in a Link State
Update message correctly. If LSA type is something else than one
supported
by Quagga, the default handling of unknown types leads to an error.

* ospf_flood.c
  * ospf_flood(): check return value of ospf_lsa_install()

13 years agobgpd: CVE-2011-3327 (ext. comm. buffer overflow)
CROSS [Mon, 26 Sep 2011 09:17:05 +0000 (13:17 +0400)]
bgpd: CVE-2011-3327 (ext. comm. buffer overflow)

This vulnerability (CERT-FI #513254) was reported by CROSS project.
They have also suggested a fix to the problem, which was found
acceptable.

The problem occurs when bgpd receives an UPDATE message containing
255 unknown AS_PATH attributes in Path Attribute Extended Communities.
This causes a buffer overlow in bgpd.

* bgp_ecommunity.c
  * ecommunity_ecom2str(): perform size check earlier

13 years agobgpd: improve NEXT_HOP attribute checks (BZ#680)
Denis Ovsienko [Thu, 22 Sep 2011 08:48:14 +0000 (12:48 +0400)]
bgpd: improve NEXT_HOP attribute checks (BZ#680)

* lib/prefix.h
  * IPV4_CLASS_DE(): new helper macro
* bgp_attr.c
  * bgp_attr_nexthop(): add check for "partial" bit, refresh flag error
    reporting, explain meaning of RFC4271 section 6.3 and implement it

13 years agobgpd: don't be confused by "unspecific" subcode in the NOTIFY message.
Dmitrij Tejblum [Wed, 21 Sep 2011 19:13:22 +0000 (23:13 +0400)]
bgpd: don't be confused by "unspecific" subcode in the NOTIFY message.

* bgp_debug.c (bgp_notify_open_msg, bgp_notify_update_msg,
  bgp_notify_cease_msg, bgp_notify_capability_msg): add messages for
  "unspecific" subcode.

13 years agolib: provide more information in case of failed LOOKUP.
Dmitrij Tejblum [Wed, 21 Sep 2011 13:41:41 +0000 (17:41 +0400)]
lib: provide more information in case of failed LOOKUP.

* log.[ch]
  * mes_lookup: add a parameter with the name of the message list, print
    the name in case of failure.
  * LOOKUP macro: pass the name of the message list.

13 years agobgpd: check ATOMIC_AGGREGATE attr flags (BZ#678)
Denis Ovsienko [Tue, 20 Sep 2011 10:43:50 +0000 (14:43 +0400)]
bgpd: check ATOMIC_AGGREGATE attr flags (BZ#678)

* bgp_attr.c
  * bgp_attr_atomic(): accept extra argument, add checks for
    "optional", "transitive" and "partial" bits, log each error
    condition independently
  * bgp_attr_parse(): provide extra argument

13 years agobgpd: check MULTI_EXIT_DISC attr flags (BZ#677)
Denis Ovsienko [Tue, 20 Sep 2011 06:54:25 +0000 (10:54 +0400)]
bgpd: check MULTI_EXIT_DISC attr flags (BZ#677)

* bgp_attr.c
  * bgp_attr_med(): add checks for "optional", "transitive" and
    "partial" bits, log each error condition independently

13 years agobgpd: check LOCAL_PREF attribute flags (BZ#674)
Denis Ovsienko [Mon, 19 Sep 2011 12:30:47 +0000 (16:30 +0400)]
bgpd: check LOCAL_PREF attribute flags (BZ#674)

* bgp_attr.c
  * bgp_attr_local_pref(): accept extra argument, add checks for
    "optional" and "transitive" bits, log each error condition
    independently
  * bgp_attr_parse(): provide extra argument

13 years agoconfigure: test for glibc backtrace even without glibc.
Dmitrij Tejblum [Thu, 15 Sep 2011 16:00:33 +0000 (20:00 +0400)]
configure: test for glibc backtrace even without glibc.

Other platform may have compatible facilities.

13 years agoospfd: remove unused macro
Denis Ovsienko [Thu, 15 Sep 2011 11:40:47 +0000 (15:40 +0400)]
ospfd: remove unused macro

13 years agodoc: fix typo
Roman Hoog Antink [Thu, 15 Sep 2011 07:47:00 +0000 (11:47 +0400)]
doc: fix typo

13 years agoisisd: raise hello rate for DIS (BZ#539)
Fritz Reichmann [Wed, 14 Sep 2011 16:46:57 +0000 (20:46 +0400)]
isisd: raise hello rate for DIS (BZ#539)

* isis_pdu.c: Divide hello interval by three, depending if we are DIS or
  not.

13 years agoisisd: fix crash on "no router isis" (BZ#536)
Fritz Reichmann [Wed, 14 Sep 2011 15:31:51 +0000 (19:31 +0400)]
isisd: fix crash on "no router isis" (BZ#536)

The crash is due to threads accessing data that gets destroyed
during the removal of the configuration.

* isis_circuit.c: Destroy adjacencies to stop adjacency expiry thread.
  Stop PSNP threads.
* isisd.c: Change state of circuit back to INIT and reassign the
  circuit structure to isis->init_circ_list rather than destroying
  the circuit data structure. Stop SPF threads. Stop LSP generation
  threads.
* isisd.h: Add pointers to LSP threads into area structure in order to
  stop them in isisd.c
* isis_lsp.c: Store pointer to LSP thread in area structure.
* isis_pdu.c: Stop PDU generation for a circuit with a removed area.
* isis_pfpacket.c: Stop processing received PDUs for a circuit with a
  removed area.

13 years agoospf6d: Fix memory allocation issues in SPF
Tom Goff [Wed, 10 Nov 2010 21:02:38 +0000 (13:02 -0800)]
ospf6d: Fix memory allocation issues in SPF

* ospf6_area.c: Call ospf6_spf_table_finish() before deleting the spf
    table.  This ensures that the associated ospf6_vertex structures
    are also freed.
* ospf6_spf.c: Only allocate a priority queue when a spf calculation
    is actually performed.

13 years agoospf6d: Extend the "[no] debug ospf6 route" vty commands
Tom Goff [Wed, 10 Nov 2010 21:02:11 +0000 (13:02 -0800)]
ospf6d: Extend the "[no] debug ospf6 route" vty commands

* ospf6_route.c ([no_]debug_ospf6_route) Include memory as a debug
  option.  This allows ospf6 route memory debugging to be enabled or
  disabled interactively or from a config file.

13 years agoisisd: include hash.h, not hash.c
Peter Szilagyi [Tue, 13 Sep 2011 13:37:06 +0000 (17:37 +0400)]
isisd: include hash.h, not hash.c

13 years agoconfigure: dismiss libutil.h
Stephen Hemminger [Tue, 13 Sep 2011 13:15:51 +0000 (17:15 +0400)]
configure: dismiss libutil.h

Recent versions of libc on Linux (Debian Testing) create lots of
compile warnings about direct usage of libutil.h

13 years agodoc: add missing word
Alexandre Chappuis [Tue, 13 Sep 2011 12:33:45 +0000 (16:33 +0400)]
doc: add missing word

* ospfd.texi: Adjust meaning of the rfc1583compatibility option in
  order to match the RFC specification and the actual source code.

13 years agoospf6d: add lost lines to area config block
Jon Andersson [Tue, 13 Sep 2011 11:47:14 +0000 (15:47 +0400)]
ospf6d: add lost lines to area config block

* ospf6_area.c
  * ospf6_area_config_write(): write filter-list, import-list and
    export-list lines

13 years agobgpd: fix parsing of graceful restart cap. (#663)
Peter Pentchev [Mon, 12 Sep 2011 12:30:31 +0000 (16:30 +0400)]
bgpd: fix parsing of graceful restart cap. (#663)

"While setting up a testbed, I ran across a little problem in the
parsing of the "graceful restart" BGP capability that resulted in
Quagga not actually activating it for the peer in question - when
the peer sent a single AFI/SAFI block."

* bgp_open.c
  * bgp_capability_restart(): actually process the last AFI/SAFI block

13 years agoospf6d: fix crash on filter-list handling (BZ#530)
Christian Hammers [Mon, 12 Sep 2011 10:23:05 +0000 (14:23 +0400)]
ospf6d: fix crash on filter-list handling (BZ#530)

This essentially merges the fix available from Debian build of Quagga.

* ospf6_area.c
  * area_filter_list(): use correct argv indices
  * no_area_filter_list(): idem

13 years agobgpd: add useful notification logs (BZ#616)
heasley [Mon, 12 Sep 2011 09:27:52 +0000 (13:27 +0400)]
bgpd: add useful notification logs (BZ#616)

* bgp_packet.c
  * bgp_notify_send_with_data(): add calls to zlog_info()

13 years agodoc: BGP route-flap dampening
Alexandre Chappuis [Sun, 11 Sep 2011 12:54:11 +0000 (16:54 +0400)]
doc: BGP route-flap dampening

13 years agozebra: fix loss of metric for Linux routes
Dmitry Popov [Sun, 11 Sep 2011 09:48:25 +0000 (13:48 +0400)]
zebra: fix loss of metric for Linux routes

* rt_netlink.c
  * netlink_route_change(): fetch metric information like
    netlink_routing_table() does and pass it further

13 years agoospfd: spelling
Denis Ovsienko [Sat, 10 Sep 2011 19:29:19 +0000 (23:29 +0400)]
ospfd: spelling

13 years agobgpd: spelling
Denis Ovsienko [Sat, 10 Sep 2011 17:50:53 +0000 (21:50 +0400)]
bgpd: spelling

13 years agobgpd: spelling
Denis Ovsienko [Sat, 10 Sep 2011 12:53:30 +0000 (16:53 +0400)]
bgpd: spelling

13 years agoospfd: use existing macro for consistency
Denis Ovsienko [Sat, 10 Sep 2011 12:40:23 +0000 (16:40 +0400)]
ospfd: use existing macro for consistency

13 years agoversion RE-0.99.17.3
Denis Ovsienko [Wed, 7 Sep 2011 13:44:10 +0000 (17:44 +0400)]
version RE-0.99.17.3

13 years agoospfd: revert recent PIE change to fix amd64 build
Denis Ovsienko [Wed, 7 Sep 2011 13:40:38 +0000 (17:40 +0400)]
ospfd: revert recent PIE change to fix amd64 build

This reverts commit 68575f4babf4d6fc302c366898a1047f13629214.

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