Commit Graph

2720 Commits

Author SHA1 Message Date
Denis Ovsienko
a5b228b379 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
2011-10-12 13:59:09 +04:00
Peter Pentchev
21cc76941a 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
2011-10-08 20:17:21 +04:00
Denis Ovsienko
a624cae2b2 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
2011-10-08 14:18:00 +04:00
Denis Ovsienko
b84b62dfb6 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
2011-09-30 14:11:13 +04:00
Denis Ovsienko
2d42e68aa0 bgpd: ignore 4 bits of attribute flags byte 2011-09-30 10:32:02 +04:00
Denis Ovsienko
214bcaa13e 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
2011-09-30 10:30:36 +04:00
Denis Ovsienko
bc3443ebf0 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
2011-09-30 01:24:35 +04:00
Denis Ovsienko
0a28130d35 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
2011-09-29 22:19:08 +04:00
Denis Ovsienko
42e6d745d1 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
2011-09-29 22:14:11 +04:00
Denis Ovsienko
beb1ca03bf 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()
2011-09-29 22:07:54 +04:00
Denis Ovsienko
48f99b0c2b release: 0.99.20 2011-09-29 16:55:23 +04:00
Denis Ovsienko
792b6fa2c4 version RE-0.99.17.5 2011-09-29 16:50:46 +04:00
YAMAMOTO Shigeru
3aad46bdaa 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()'
2011-09-29 16:27:29 +04:00
YAMAMOTO Shigeru
992d4d1ca9 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()'
2011-09-29 16:27:01 +04:00
Denis Ovsienko
52ecbbea36 ospfd: remove unused macro 2011-09-27 21:46:14 +04:00
Dmitrij Tejblum
4b4e07d2d8 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.
2011-09-27 21:46:04 +04:00
Dmitrij Tejblum
51abba509a 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.
2011-09-27 21:45:53 +04:00
Dmitrij Tejblum
eda3529e9c configure: test for glibc backtrace even without glibc.
Other platform may have compatible facilities.
2011-09-27 21:45:37 +04:00
Denis Ovsienko
bcc6c59ac5 ospfd: spelling 2011-09-27 21:43:27 +04:00
Denis Ovsienko
e6ec1c3648 bgpd: spelling 2011-09-27 21:43:15 +04:00
Denis Ovsienko
7ccf5e59c1 bgpd: spelling 2011-09-27 21:43:03 +04:00
Denis Ovsienko
171c9a996d ospfd: use existing macro for consistency 2011-09-27 21:42:52 +04:00
Denis Ovsienko
7dbeea9d4f zebra: add missing includes 2011-09-27 21:42:14 +04:00
Denis Ovsienko
87362ceb5d 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
2011-09-27 21:41:33 +04:00
Denis Ovsienko
05b7709dad 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
2011-09-27 21:41:00 +04:00
Dmitrij Tejblum
10d04cdb41 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
2011-09-27 21:39:12 +04:00
Dmitrij Tejblum
ee7e75d38b lib: futher simplification of setsockopt_ipv4_multicast()
* sockopt.c (setsockopt_ipv4_multicast): check for wrong optname with
  assert(), rather than return an error.
2011-09-27 21:38:16 +04:00
Dmitrij Tejblum
e0afa6f44a lib: fix omission in the previous commit to lib/sockopt.c
* sockopt.c (setsockopt_ipv4_multicast_if): fix missed line in
  the previous commit.
2011-09-27 21:37:46 +04:00
Dmitrij Tejblum
69bf3a3993 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
2011-09-27 21:37:35 +04:00
Denis Ovsienko
ea4021984f ospf6d: spelling 2011-09-27 21:36:54 +04:00
Denis Ovsienko
3a8c3dd7d0 lib: remove unused variable
* sockopt.c (getsockopt_ifindex): "ifindex" was never used
2011-09-27 21:34:48 +04:00
Denis Ovsienko
b82cdeb18f delete CVS keywords 2011-09-27 21:34:26 +04:00
Denis Ovsienko
6159928d28 configure: fix OpenPAM detection 2011-09-27 21:33:16 +04:00
Denis Ovsienko
9eba2ada18 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
2011-09-27 21:21:27 +04:00
Denis Ovsienko
2cfadf09a8 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
2011-09-27 21:19:44 +04:00
Denis Ovsienko
0ea968d21f 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
2011-09-27 21:15:56 +04:00
heasley
1212dc1961 bgpd: add useful notification logs (BZ#616)
* bgp_packet.c
  * bgp_notify_send_with_data(): add calls to zlog_info()
2011-09-27 21:07:07 +04:00
heasley
d68ab1009f bgpd: consistent log msg format (BZ#565) 2011-09-27 21:05:30 +04:00
Jon Andersson
5fdaa04e63 ospf6d: add lost lines to area config block
* ospf6_area.c
  * ospf6_area_config_write(): write filter-list, import-list and
    export-list lines
2011-09-27 21:02:41 +04:00
Christian Hammers
75d044d234 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
2011-09-27 21:02:26 +04:00
Denis Ovsienko
2b43bf231c 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.
2011-09-27 20:59:46 +04:00
Peter Szilagyi
306ca83213 isisd: include hash.h, not hash.c 2011-09-27 20:50:17 +04:00
Fritz Reichmann
8998075956 isisd: raise hello rate for DIS (BZ#539)
* isis_pdu.c: Divide hello interval by three, depending if we are DIS or
  not.
2011-09-27 20:49:26 +04:00
Fritz Reichmann
5574999e59 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.
2011-09-27 20:48:43 +04:00
Stephen Hemminger
b69442d456 configure: dismiss libutil.h
Recent versions of libc on Linux (Debian Testing) create lots of
compile warnings about direct usage of libutil.h
2011-09-27 20:47:18 +04:00
Dmitry Popov
83d1614952 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
2011-09-27 20:46:25 +04:00
Alexandre Chappuis
3c9cfcdebf 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>
2011-09-27 20:45:22 +04:00
Alexandre Chappuis
c31e5726be doc: BGP route-flap dampening 2011-09-27 20:42:26 +04:00
Alexandre Chappuis
37075da75d doc: add missing word
* ospfd.texi: Adjust meaning of the rfc1583compatibility option in
  order to match the RFC specification and the actual source code.
2011-09-27 20:39:19 +04:00
Denis Ovsienko
0998342b5f release: 0.99.19 2011-09-26 18:50:06 +04:00