Commit Graph

2269 Commits

Author SHA1 Message Date
Denis Ovsienko
05e54ee3df build: delete .cvsignore files 2011-12-13 14:27:01 +04:00
Denis Ovsienko
ad8d4802a3 ospfd: spelling 2011-12-13 14:26:53 +04:00
Vyacheslav Trushkin
3414d03545 lib: clearing zclient.c for some cases of building
lib/zclient.c: using of HAVE_TCP_ZEBRA in zclient_socket_*
definitions extended by else clause.
2011-12-13 14:26:45 +04:00
Vyacheslav Trushkin
b51146856e quagga: option "-z" ("--socket <path>") added
All daemons modified to support custom path to zserv
socket.

lib: generalize a zclient connection

zclient_socket_connect added. zclient_socket and
zclient_socket_un were hidden under static expression.
"zclient_serv_path_set" modified.
2011-12-13 14:26:28 +04:00
Vyacheslav Trushkin
2f658673fa isisd: indent longopts array 2011-12-13 14:26:18 +04:00
Vyacheslav Trushkin
1add115a9c bgpd: implement 'match probability' in route-maps
New clause 'match probability <percentage value>'
was added in route-maps (bgpd/bgp_routemap.c modified).
2011-12-13 14:25:54 +04:00
Vyacheslav Trushkin
9a9446eabb ospf6d: justify multicast group management
* ospf6_network.[ch]
  * ospf6_sso(): new function supersedes ospf6_join_allspfrouters(),
    ospf6_leave_allspfrouters(), ospf6_join_alldrouters() and
    ospf6_leave_alldrouters()
* ospf6_interface.c
  * ospf6_interface_state_change(): update respectively
  * interface_up(): ditto
  * interface_down(): ditto
2011-12-13 14:25:43 +04:00
Ulrich Weber
6989880ad7 ripngd: limit max of "timers basic" to 65535 as documented
and use VTY_GET_INTEGER_RANGE instead of calling strtoul
2011-12-13 14:25:33 +04:00
Ulrich Weber
bde12e3fd5 bgp: use VTY_GET_INTEGER_RANGE() in bgp_clear()
Second patch replaces "VTY_GET_LONG ("AS", as_ul, arg);"
by "VTY_GET_INTEGER_RANGE ("AS", as, arg, 1, BGP_AS4_MAX);"
as done in all other code, which parses AS numbers.
2011-12-13 14:25:25 +04:00
Vyacheslav Trushkin
42a7debf3c 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.
2011-12-13 14:25:03 +04:00
Stephen Hemminger
004b1238a2 lib: fix SMUX compiler warnings
Make progname a string, and cast when calling asn1.
Remove variable set but never used.
2011-12-07 01:31:16 +04:00
Stephen Hemminger
3c14ebb081 lib: fix compile warnings from set-never-used
The if_dump code had empty loop, that caused set-never-used warning.
2011-12-07 01:29:49 +04:00
Stephen Hemminger
c143c38bc7 ospf6d: fix compile warning from falling off end of main
ospf6 main always calls ospf6_exit() which always calls exit.
Use attributes to tell GCC that this is ok.
2011-12-07 01:25:46 +04:00
Stephen Hemminger
d7a083844d zebra: fix warnings in forward proc
Check result of fgets(), and don't set variable that is
never used.
2011-12-07 01:24:09 +04:00
Stephen Hemminger
04d5e24d74 bgpd: cleanup privs on termination
When doing valgrind testing, the privledges from zprivs_init() need
to be cleaned up on exit.
2011-12-07 01:23:58 +04:00
Stephen Hemminger
46901400a3 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
2011-12-07 01:23:48 +04:00
Stephen Hemminger
075e12f57d ospfd: remove unused code
The code for nssa_range and other bits that were written but
never used.
2011-12-07 01:23:32 +04:00
Stephen Hemminger
f04a80a5d2 bgpd: store nexthop info for redistributed IPV6 routes
BGP was ignoring nexthop info for static and other redistributed
routes for IPv6.  Build extra attribute info to store the nexthop.
See also:
  https://bugzilla.vyatta.com/show_bug.cgi?id=6073
2011-12-06 15:03:00 +04:00
Stephen Hemminger
fb01f87f4f ospfd: avoid redundant lookup in ospf_redistribute_withdraw
The old algorithim looked up every node twice as it withdrew
the entry. It looks up entry once in redistribute_withdraw, then
looks it up again info_delete. Use result of first lookup
to do the free directly.

This may explain the slow performance observed in
 https://bugzilla.vyatta.com/show_bug.cgi?id=4421
2011-12-06 15:02:52 +04:00
Stephen Hemminger
b24b19f719 lib: fix memory leak on connect() failure
Change sockunion_log() to not use strdup(). This fixes a small memory
leak that occurs on every failed connect(), and is simpler/cleaner.
2011-12-06 15:02:44 +04:00
Stephen Hemminger
6a2e0f36b1 lib: call filter delete hook before freeing access list
The delete_hook was being run after calling access list delete function.
This would cause ospf to dereference a NULL, in ospf_filter_update
because 'access->name' was already freed.

See also:
    https://bugzilla.vyatta.com/show_bug.cgi?id=7654
2011-12-06 15:02:34 +04:00
Oleg A. Arkhangelsky
ce0af6ff5a bgpd: fix memory leak for extra attributes
this fixes commit b881c7074b
2011-12-03 15:18:19 +04:00
Roderick Schertler
1ffe5e794c doc: rectify "match ip next-hop" in ripd (BZ#537) 2011-11-22 21:03:37 +04:00
David Lamparter
2fbd6f5a62 bgpd: remove unused function bgp_bind_address
bgp_bind_address is replaced with sockunion_bind.
2011-11-21 19:42:05 +04:00
David Lamparter
1727d2e2b9 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.
2011-11-21 19:41:59 +04:00
David Lamparter
17e52061ba 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.
2011-11-21 19:41:51 +04:00
Dmitrij Tejblum
681b84e8f5 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.
2011-11-17 21:50:47 +04:00
Dylan Hall
3cf1288bfd bgpd: fix "nexthop-local unchanged" (BZ#350) 2011-11-15 21:35:11 +04:00
Chris Luke
5c88f19d5b 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
2011-11-15 20:57:02 +04:00
Thomas Ries
4de148e5d6 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.
2011-11-15 20:50:48 +04:00
Sergey Y. Afonin
1758dbaa3b bgpd: revised fix to --dryrun (BZ#622) 2011-11-15 20:45:17 +04:00
Denis Ovsienko
267551879e 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()
2011-10-26 19:38:49 +04:00
Denis Ovsienko
b4cd242151 bgpd: check AGGREGATOR attr flags (BZ#678)
* bgp_attr.c
  * bgp_attr_aggregator(): check Optional/Transitive flag bits
2011-10-22 22:32:26 +04:00
Denis Ovsienko
bbb04bf3bb 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()
2011-10-19 17:28:01 +04:00
Denis Ovsienko
abc384f85b 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()
2011-10-18 13:55:07 +04:00
Denis Ovsienko
565b828dc0 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
2011-10-17 19:07:02 +04:00
Denis Ovsienko
f8627ff1ef bgpd: fix spelling of CLUSTER_LIST 2011-10-17 19:03:56 +04:00
Denis Ovsienko
0b83044b91 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
2011-10-17 19:03:31 +04:00
Denis Ovsienko
d595b566bc 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
2011-10-17 19:02:55 +04:00
Dmitrij Tejblum
566b36ebf9 vtysh: [build] silence preprocessor errors in some cases
* extract.pl.in: use configured CPPFLAGS in cpp invocation.
2011-10-17 19:00:02 +04:00
Denis Ovsienko
ad61af67b5 lib: compile even without IPV6_TCLASS 2011-10-17 18:59:26 +04:00
Stephen Hemminger
6d0732c8ab 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
2011-10-17 18:59:19 +04:00
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