Commit 7fc55925 authored by Ondrej Zajicek (work)'s avatar Ondrej Zajicek (work)
Browse files

Several minor fixes

parent ed1d853e
Loading
Loading
Loading
Loading
+21 −13
Original line number Diff line number Diff line
@@ -2044,6 +2044,7 @@ avoid routing loops.
<item> <rfc id="7911"> - Advertisement of Multiple Paths in BGP
<item> <rfc id="7947"> - Internet Exchange BGP Route Server
<item> <rfc id="8092"> - BGP Large Communities Attribute
<item> <rfc id="8203"> - BGP Administrative Shutdown Communication
</itemize>

<sect1>Route selection rules
@@ -2258,6 +2259,20 @@ using the following configuration parameters:
	related procedures. Note that even when disabled, BIRD can send route
	refresh requests.  Default: on.

	<tag><label id="bgp-graceful-restart">graceful restart <m/switch/|aware</tag>
	When a BGP speaker restarts or crashes, neighbors will discard all
	received paths from the speaker, which disrupts packet forwarding even
	when the forwarding plane of the speaker remains intact. <rfc id="4724">
	specifies an optional graceful restart mechanism to alleviate this
	issue. This option controls the mechanism. It has three states:
	Disabled, when no support is provided. Aware, when the graceful restart
	support is announced and the support for restarting neighbors is
	provided, but no local graceful restart is allowed (i.e. receiving-only
	role). Enabled, when the full graceful restart support is provided
	(i.e. both restarting and receiving role). Restarting role could be also
	configured per-channel. Note that proper support for local graceful
	restart requires also configuration of other protocols. Default: aware.

	<tag><label id="bgp-graceful-restart-time">graceful restart time <m/number/</tag>
	The restart time is announced in the BGP graceful restart capability
	and specifies how long the neighbor would wait for the BGP session to
@@ -2487,19 +2502,12 @@ together with their appropriate channels follows.
	TX direction. When active, all available routes accepted by the export
	filter are advertised to the neighbor. Default: off.

	<tag><label id="bgp-graceful-restart">graceful restart <m/switch/|aware</tag>
	When a BGP speaker restarts or crashes, neighbors will discard all
	received paths from the speaker, which disrupts packet forwarding even
	when the forwarding plane of the speaker remains intact. <rfc
	id="4724"> specifies an optional graceful restart mechanism to
	alleviate this issue. This option controls the mechanism. It has three
	states: Disabled, when no support is provided. Aware, when the graceful
	restart support is announced and the support for restarting neighbors
	is provided, but no local graceful restart is allowed (i.e.
	receiving-only role). Enabled, when the full graceful restart
	support is provided (i.e. both restarting and receiving role). Note
	that proper support for local graceful restart requires also
	configuration of other protocols.  Default: aware.
	<tag><label id="bgp-graceful-restart-c">graceful restart <m/switch/</tag>
	Although BGP graceful restart is configured mainly by protocol-wide
	<ref id="bgp-graceful-restart" name="options">, it is possible to
	configure restarting role per AFI/SAFI pair by this channel option.
	The option is ignored if graceful restart is disabled by protocol-wide
	option. Default: off in aware mode, on in full mode.
</descrip>

<sect1>Attributes
+5 −2
Original line number Diff line number Diff line
@@ -230,11 +230,14 @@ static inline int net_type_match(const net_addr *a, u32 mask)
static inline int net_is_ip(const net_addr *a)
{ return (a->type == NET_IP4) || (a->type == NET_IP6); }

static inline int net_is_vpn(const net_addr *a)
{ return (a->type == NET_VPN4) || (a->type == NET_VPN6); }

static inline int net_is_roa(const net_addr *a)
{ return (a->type == NET_ROA4) || (a->type == NET_ROA6); }

static inline int net_is_vpn(const net_addr *a)
{ return (a->type == NET_VPN4) || (a->type == NET_VPN6); }
static inline int net_is_flow(const net_addr *a)
{ return (a->type == NET_FLOW4) || (a->type == NET_FLOW6); }


static inline ip4_addr net4_prefix(const net_addr *a)
+2 −2
Original line number Diff line number Diff line
@@ -849,7 +849,7 @@ if_show(void)
      else if (i->master_index)
	bsprintf(mbuf, " master=#%u", i->master_index);

      cli_msg(-1001, "%s %s (index=%d%s)", i->name, (i->flags & IF_UP) ? "Up" : "Down", i->index, mbuf);
      cli_msg(-1001, "%s %s (index=%d%s)", i->name, (i->flags & IF_UP) ? "up" : "down", i->index, mbuf);
      if (!(i->flags & IF_MULTIACCESS))
	type = "PtP";
      else
@@ -897,7 +897,7 @@ if_show_summary(void)
	a6[0] = 0;

      cli_msg(-1005, "%-10s %-6s %-18s %s",
	      i->name, (i->flags & IF_UP) ? "Up" : "Down", a4, a6);
	      i->name, (i->flags & IF_UP) ? "up" : "down", a4, a6);
    }
  cli_msg(0, "");
}
+3 −1
Original line number Diff line number Diff line
@@ -897,7 +897,9 @@ rte_validate(rte *e)
    return 0;
  }

  c = net_classify(n->n.addr);
  /* FIXME: better handling different nettypes */
  c = !net_is_flow(n->n.addr) ?
    net_classify(n->n.addr): (IADDR_HOST | SCOPE_UNIVERSE);
  if ((c < 0) || !(c & IADDR_HOST) || ((c & IADDR_SCOPE_MASK) <= SCOPE_LINK))
  {
    log(L_WARN "Ignoring bogus route %N received via %s",
+16 −2
Original line number Diff line number Diff line
@@ -64,8 +64,6 @@
 * format - Optional hook that converts eattr to textual representation.
 */

// XXXX review pool usage : c->c.proto->pool


struct bgp_attr_desc {
  const char *name;
@@ -1175,6 +1173,22 @@ bgp_init_bucket_table(struct bgp_channel *c)
  c->withdraw_bucket = NULL;
}

void
bgp_free_bucket_table(struct bgp_channel *c)
{
  HASH_FREE(c->bucket_hash);

  struct bgp_bucket *b;
  WALK_LIST_FIRST(b, c->bucket_queue)
  {
    rem_node(&b->send_node);
    mb_free(b);
  }

  mb_free(c->withdraw_bucket);
  c->withdraw_bucket = NULL;
}

static struct bgp_bucket *
bgp_get_bucket(struct bgp_channel *c, ea_list *new)
{
Loading