]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
13 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)

13 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): provide
  required arguments to bgp_attr_malformed()

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

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

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

13 years agobgpd: use bgp_attr_malformed()
Denis Ovsienko [Tue, 18 Oct 2011 09:55:07 +0000 (13:55 +0400)]
bgpd: use bgp_attr_malformed()

Some of the recent attribute flags/length checks copied from QRE use
bgp_notify_send_with_data() directly, but master branch assumes
using bgp_attr_malformed().

* bgp_attr.c
  * bgp_attr_med()
  * bgp_attr_local_pref()
  * bgp_attr_atomic()
  * bgp_attr_originator_id()
  * bgp_attr_cluster_list()
  * bgp_mp_reach_parse()
  * bgp_mp_unreach_parse()

13 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

13 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

13 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

13 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

13 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.

13 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

13 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

13 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

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

Conflicts:

bgpd/bgp_attr.c

13 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

Conflicts:

bgpd/bgp_attr.c

13 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

13 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

Conflicts:

bgpd/bgp_attr.c

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

Conflicts:

bgpd/bgp_attr.c

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 agobgpd: more SAFI fixes
Denis Ovsienko [Thu, 14 Jul 2011 08:36:19 +0000 (12:36 +0400)]
bgpd: more SAFI fixes

(with resolved conflict in bgpd/bgp_packet.c)

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 agorelease: 0.99.20
Denis Ovsienko [Thu, 29 Sep 2011 12:55:23 +0000 (16:55 +0400)]
release: 0.99.20

13 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 agoospfd: remove unused macro
Denis Ovsienko [Thu, 15 Sep 2011 11:40:47 +0000 (15:40 +0400)]
ospfd: remove unused macro

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 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: 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 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 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 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 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 agoconfigure: fix OpenPAM detection
Denis Ovsienko [Thu, 14 Jul 2011 20:24:15 +0000 (00:24 +0400)]
configure: fix OpenPAM detection

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 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 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: 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 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 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 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 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 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 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: 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 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 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 agorelease: 0.99.19
Denis Ovsienko [Mon, 26 Sep 2011 14:50:06 +0000 (18:50 +0400)]
release: 0.99.19

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 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: 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 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 agoMerge remote-tracking branch 'origin/master'
Paul Jakma [Fri, 29 Jul 2011 17:21:50 +0000 (18:21 +0100)]
Merge remote-tracking branch 'origin/master'

13 years agoMerge branch 'attr-errors'
Paul Jakma [Fri, 29 Jul 2011 17:16:25 +0000 (18:16 +0100)]
Merge branch 'attr-errors'

Contains BGP fixes:

- set extcommunity crash: tihs patch tries to make the refcounting more robust
  but does not fully solve the problem, sadly.
- BGP attribute error handling: Little testing.

13 years agoMerge remote-tracking branch 'polymorf/master'
Greg Troxel [Wed, 13 Jul 2011 17:20:06 +0000 (13:20 -0400)]
Merge remote-tracking branch 'polymorf/master'

13 years agofix typo
Roman Hoog Antink [Mon, 27 Jun 2011 15:24:21 +0000 (17:24 +0200)]
fix typo

13 years agoOmit --opaque-lsa from build (now default).
Greg Troxel [Tue, 28 Jun 2011 19:05:05 +0000 (15:05 -0400)]
Omit --opaque-lsa from build (now default).

14 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

14 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.

14 years agobgpd: trivial format / warning fixes
Paul Jakma [Mon, 11 Apr 2011 15:31:43 +0000 (16:31 +0100)]
bgpd: trivial format / warning fixes

* bgp_aspath.c: (assegments_parse) just bail early if length doesn't match
  and fix the formatting.
* bgp_network.c: add include needed for set_nonblocking
* bgp_packet.c: formatting

14 years agoospf: Fix OSPF API and ospf-te LSA refreshers to match recent API change
Paul Jakma [Mon, 11 Apr 2011 15:28:16 +0000 (16:28 +0100)]
ospf: Fix OSPF API and ospf-te LSA refreshers to match recent API change

* ospf_apiserver.{c,h}: (ospf_apiserver_lsa_refresher) refreshers must now
  return the refreshed LSA.
* ospf_te.{c,h}: (ospf_mpls_te_lsa_refresh) ditto
* ospf_api.c: trivial compiler warning fix

14 years agoFix authorship of previous ospf6d commit
Paul Jakma [Mon, 4 Apr 2011 10:18:39 +0000 (11:18 +0100)]
Fix authorship of previous ospf6d commit

14 years agoospf6d: fix crash if zebra_interface_state_read can't find interface
Ingo Flaschberger [Mon, 4 Apr 2011 10:17:45 +0000 (11:17 +0100)]
ospf6d: fix crash if zebra_interface_state_read can't find interface

* ospf6_zebra.c: (ospf6_zebra_if_state_update) zebra_interface_state_read
  may return NULL, if it can't find an interface, deal with it.

14 years agoospf6d: fix crash if zebra_interface_state_read can't find interface
Paul Jakma [Mon, 4 Apr 2011 09:39:15 +0000 (10:39 +0100)]
ospf6d: fix crash if zebra_interface_state_read can't find interface

* ospf6_zebra.c: (ospf6_zebra_if_state_update) zebra_interface_state_read
  may return NULL, if it can't find an interface, deal with it.

14 years agobgpd: fix memory leak when deleting a community
Michael Lambert [Mon, 13 Sep 2010 15:48:11 +0000 (11:48 -0400)]
bgpd: fix memory leak when deleting a community

* bgp_routemap.c: (route_set_community_delete) When deleting a
  community in a route-map the old community was being orphaned.  Like
  the description of the same code in route_set_community, this is a
  hack, not a true fix.

14 years agoRevert "bgpd: "Intern" communities in route maps"
Paul Jakma [Fri, 1 Apr 2011 14:58:27 +0000 (15:58 +0100)]
Revert "bgpd: "Intern" communities in route maps"

This reverts commit 2c9fd7e07283b8904ef20030c9dadb032e999b12.

14 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.

14 years agoMerge remote-tracking branch 'remotes/quagga/master'
Paul Jakma [Tue, 29 Mar 2011 13:25:56 +0000 (14:25 +0100)]
Merge remote-tracking branch 'remotes/quagga/master'

14 years agobgpd: Fix merge error in jhash commit
Paul Jakma [Tue, 29 Mar 2011 13:18:49 +0000 (14:18 +0100)]
bgpd: Fix merge error in jhash commit

* bgp_attr.c: (attrhash_key_make) 98e30f should have changed jhash2 to jhash.

  These kinds of merge errors would be reduced and life would be easier if
  people would submit fully-formed fixes that could be chucked directly into
  git-am.

14 years agobgpd: refine the setting up of GTSM
Stephen Hemminger [Thu, 24 Mar 2011 17:30:21 +0000 (17:30 +0000)]
bgpd: refine the setting up of GTSM

* bgpd.h: Add error code for setting GTSM on iBGP
* bgpd.c: (peer_ttl_security_hops_set) use previous error code and signal
  incompatibility of GTSM+iBGP to vty.
  Consider the session state when setting GTSM, and reset Open/Active peers
  to let them pick up new TTL from start.

14 years agobuild: treat opaque-lsa default correctly for ospfapi
Greg Troxel [Thu, 24 Mar 2011 14:19:43 +0000 (10:19 -0400)]
build: treat opaque-lsa default correctly for ospfapi

In deciding whether to default ospfapi to on or off, use the same rule
for opaque-lsa as earlier: != no rather than = yes, so that not having
set it implies yes.

14 years agolib: Add support for IPv6 ttl security
Stephen Hemminger [Thu, 5 Aug 2010 17:26:27 +0000 (10:26 -0700)]
lib: Add support for IPv6 ttl security

* sockunion.c: (sockopt_minttl) Add IPv6 support for min hop count.
  The kernel support is Linux kernel 2.6.35 or later.

14 years agobgpd: Cleanups & fixes for minttl / GTSM
Stephen Hemminger [Thu, 24 Mar 2011 10:51:59 +0000 (10:51 +0000)]
bgpd: Cleanups & fixes for minttl / GTSM

* bgp_vty.c: (peer_ebgp_multihop_{un,}set_vty) tail-call cleanup.
  ({no_,}neighbor_ttl_security) ditto.
* bgpd.c: (peer_ttl_security_hops_set) Peer group checks and TTL set only
  need to be done on transition.
* sockunion.c: (sockopt_minttl) remove always-on debug and improve readability.

14 years agobgpd: RFC 5082 Generalized TTL Security Mechanism support
Nick Hilliard [Wed, 23 Mar 2011 15:33:17 +0000 (15:33 +0000)]
bgpd: RFC 5082 Generalized TTL Security Mechanism support

* bgpd: Add support for RFC 5082 GTSM, which allows the TTL field to be used
  to verify that incoming packets have been sent from neighbours no more
  than X IP hops away. In other words, this allows packets that were sent from
  further away (i.e. not by the neighbour with known distance, and so possibly
  a miscreant) to be filtered out.
* lib/sockunion.{c,h}: (sockopt_minttl) new function, to set a minimum TTL
  using the IP_MINTTL socket opt.
* bgpd.h: (BGP_ERR_NO_EBGP_MULTIHOP_WITH_TTLHACK) define for command
  error for minttl.
  (struct peer) add a config variable, to store the configured minttl.
  (peer_ttl_security_hops_{set,unset}) configuration handlers
* bgpd.c: (peer_group_get) init gtsm_hops
  (peer_ebgp_multihop_{un,}set) check for conflicts with GTSM. Multihop and
  GTSM can't both be active for a peer at the same time.
  (peer_ttl_security_hops_set) set minttl, taking care to avoid conflicts with
  ebgp_multihop.
  (bgp_config_write_peer) write out minttl as "neighbor .. ttl-security hops X".
* bgp_vty.c: (bgp_vty_return) message for
  BGP_ERR_NO_EBGP_MULTIHOP_WITH_TTLHACK
  (peer_ebgp_multihop_{un,}set_vty)
* bgp_network.c: (bgp_accept) set minttl on accepted sockets if appropriate.
  (bgp_connect) ditto for outbound.

14 years agoMerge branch 'master' of ssh://code.quagga.net/var/git/quagga
Paul Jakma [Wed, 23 Mar 2011 10:38:45 +0000 (10:38 +0000)]
Merge branch 'master' of ssh://code.quagga.net/var/git/quagga

14 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

14 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

14 years agobgpd: attribute jhash call should use a standard interface to in6_addr data
Stephen Hemminger [Tue, 22 Mar 2011 16:14:57 +0000 (16:14 +0000)]
bgpd: attribute jhash call should use a standard interface to in6_addr data

* bgp_attr.c; (attrhash_key_make) s6_addr is only member of in6_addr
  guaranteed to be available - s6_addr32 isn't. Fix to be more portable, and
  thus allow compilation on BSD again.

14 years agoospfd: Compile fix for opaque support
Paul Jakma [Tue, 22 Mar 2011 15:23:55 +0000 (15:23 +0000)]
ospfd: Compile fix for opaque support

* ospfd: Refresher logic cleanup broke OSPF opaque, which does its own thing
  with regard to refresher logic and which also, in the protocol, requires
  implementations to keep state of which OI an LSA is received on (rather
  than providing information in the LSA to allow it to be looked up - as
  other LSAs requiring such assocation were careful to do).
* ospf_lsa.h: (struct ospf_interface) Add back the pointer to oi, but only
  for type-9 now.
* ospf_nsm.c: (ospf_db_summary_add) check the oi actually exists first -
  doesn't obviate the need for opaque to ensure oi pointers get cleaned up
  when ospf_interfaces disappear.
* ospf_opaque.{c,h}: (ospf_opaque_functab,ospf_opaque_lsa_refresh) Refresher
  LSA functions now need to return the LSA to the general refresh logic,
  to indicate whether the LSA was refreshed.

14 years agobuild: change sense of opaque-{lsa,te} enable args to enable by default
Paul Jakma [Tue, 22 Mar 2011 10:18:05 +0000 (10:18 +0000)]
build: change sense of opaque-{lsa,te} enable args to enable by default

* configure.ac: (AC_ARG_ENABLE({ospf-te,opaque-lsa})) reverse the sense to
  --disable
  (enable_{opaque_lsa,ospf_te}) treat as enabled unless explicitly disabled.

14 years agobgpd: enable TCP corking
Stephen Hemminger [Thu, 5 Aug 2010 17:26:25 +0000 (10:26 -0700)]
bgpd: enable TCP corking

* bgp_packet.c: (bgp_write) On BGP write, use TCP_CORK to provide hints to
  kernel about TCP buffering.  This will cause BGP packets to occur in
  bigger chunks (full size MTU), improving performance and getting rid of
  one of the problems reported in the UNH BGP conformance test.

14 years agolib: add TCP_CORK wrapper
Stephen Hemminger [Thu, 5 Aug 2010 17:26:24 +0000 (10:26 -0700)]
lib: add TCP_CORK wrapper

* sockunion.{c,h}: (sockopt_cork) wrapper for TCP_CORK socket option for
  those platforms that provide it.  For other platforms, it is just a nop.

14 years agobgpd: leave peer socket in non-blocking mode (mostly)
Stephen Hemminger [Thu, 5 Aug 2010 17:26:23 +0000 (10:26 -0700)]
bgpd: leave peer socket in non-blocking mode (mostly)

* bgpd: Rather than toggling socket in/out of non-block mode, just leave it
  in nonblocking mode.

  One exception is in bgp_notify which only happens just before close.