Commit f857f674 authored by Pavel Tvrdik's avatar Pavel Tvrdik
Browse files

Merge tag 'v1.6.0' into bgpsec-mbaer

v1.6.0
parents e7284842 1e3810f9
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
Version 1.6.0 (2016-04-29)
  o Major RIP protocol redesign
  o New Babel routing protocol
  o BGP multipath support
  o KRT: Add support for plenty of kernel route metrics
  o KRT: Allow more than 256 routing tables
  o Static: Allow to specify attributes for static routes
  o Static: Support for BFD controlled static routes
  o FreeBSD: Setup password for BGP MD5 authentication
  o IO: Remove socket number limit
  o Plenty of bug fixes

  Upgrade notes:

  For RIP, most protocol options were moved to interface blocks.


Version 1.5.0 (2015-04-20)
  o Major OSPF protocol redesign.
  o OSPFv2 multi-instance extension (RFC 6549).
+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ What do we support:
	o  Static routes
	o  Inter-table protocol
	o  IPv6 router advertisements
	o  Bidirectional Forwarding Detection (BFD)
	o  Command-line interface (using the `birdc' client; to get
	   some help, just press `?')
	o  Soft reconfiguration -- no online commands for changing the
+8 −2
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@

#define SERVER_READ_BUF_LEN 4096

static char *opt_list = "s:vr";
static char *opt_list = "s:vrl";
static int verbose, restricted, once;
static char *init_cmd;

@@ -59,13 +59,14 @@ int term_lns, term_cls;
static void
usage(char *name)
{
  fprintf(stderr, "Usage: %s [-s <control-socket>] [-v] [-r]\n", name);
  fprintf(stderr, "Usage: %s [-s <control-socket>] [-v] [-r] [-l]\n", name);
  exit(1);
}

static void
parse_args(int argc, char **argv)
{
  int server_changed = 0;
  int c;

  while ((c = getopt(argc, argv, opt_list)) >= 0)
@@ -73,6 +74,7 @@ parse_args(int argc, char **argv)
      {
      case 's':
	server_path = optarg;
	server_changed = 1;
	break;
      case 'v':
	verbose++;
@@ -80,6 +82,10 @@ parse_args(int argc, char **argv)
      case 'r':
	restricted = 1;
	break;
      case 'l':
	if (!server_changed)
	  server_path = xbasename(server_path);
	break;
      default:
	usage(argv[0]);
      }
+2 −2
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ static struct cmd_node cmd_root;
void
cmd_build_tree(void)
{
  unsigned int i;
  uint i;

  cmd_root.plastson = &cmd_root.son;

@@ -67,7 +67,7 @@ cmd_build_tree(void)
	      new->plastson = &new->son;
	      new->len = c-d;
	      memcpy(new->token, d, c-d);
	      new->prio = (new->len == 3 && !memcmp(new->token, "roa", 3)) ? 0 : 1; /* Hack */
	      new->prio = (new->len == 3 && (!memcmp(new->token, "roa", 3) || !memcmp(new->token, "rip", 3))) ? 0 : 1; /* Hack */
	    }
	  old = new;
	  while (isspace(*c))
+43 −21
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ struct sym_scope {
static struct sym_scope *conf_this_scope;

static int cf_hash(byte *c);
static struct symbol *cf_find_sym(byte *c, unsigned int h0);
static inline struct symbol * cf_get_sym(byte *c, uint h0);

linpool *cfg_mem;

@@ -194,7 +194,7 @@ else: {
	}
      k=k->next;
    }
  cf_lval.s = cf_find_sym(yytext, h);
  cf_lval.s = cf_get_sym(yytext, h);
  return SYM;
}

@@ -426,8 +426,9 @@ check_eof(void)
}

static struct symbol *
cf_new_sym(byte *c, unsigned int h)
cf_new_sym(byte *c, uint h0)
{
  uint h = h0 & (SYM_HASH_SIZE-1);
  struct symbol *s, **ht;
  int l;

@@ -449,56 +450,77 @@ cf_new_sym(byte *c, unsigned int h)
}

static struct symbol *
cf_find_sym(byte *c, unsigned int h0)
cf_find_sym(struct config *cfg, byte *c, uint h0)
{
  unsigned int h = h0 & (SYM_HASH_SIZE-1);
  uint h = h0 & (SYM_HASH_SIZE-1);
  struct symbol *s, **ht;

  if (ht = new_config->sym_hash)
  if (ht = cfg->sym_hash)
    {
      for(s = ht[h]; s; s=s->next)
	if (!strcmp(s->name, c) && s->scope->active)
	  return s;
    }
  if (new_config->sym_fallback)
  if (ht = cfg->sym_fallback)
    {
      /* We know only top-level scope is active */
      for(s = new_config->sym_fallback[h]; s; s=s->next)
      for(s = ht[h]; s; s=s->next)
	if (!strcmp(s->name, c) && s->scope->active)
	  return s;
    }
  return cf_new_sym(c, h);

  return NULL;
}

static inline struct symbol *
cf_get_sym(byte *c, uint h0)
{
  return cf_find_sym(new_config, c, h0) ?: cf_new_sym(c, h0);
}

/**
 * cf_find_symbol - find a symbol by name
 * @cfg: specificed config
 * @c: symbol name
 *
 * This functions searches the symbol table for a symbol of given
 * name. First it examines the current scope, then the second recent
 * one and so on until it either finds the symbol and returns a pointer
 * to its &symbol structure or reaches the end of the scope chain
 * and returns %NULL to signify no match.
 * This functions searches the symbol table in the config @cfg for a symbol of
 * given name. First it examines the current scope, then the second recent one
 * and so on until it either finds the symbol and returns a pointer to its
 * &symbol structure or reaches the end of the scope chain and returns %NULL to
 * signify no match.
 */
struct symbol *
cf_find_symbol(byte *c)
cf_find_symbol(struct config *cfg, byte *c)
{
  return cf_find_sym(c, cf_hash(c));
  return cf_find_sym(cfg, c, cf_hash(c));
}

/**
 * cf_get_symbol - get a symbol by name
 * @c: symbol name
 *
 * This functions searches the symbol table of the currently parsed config
 * (@new_config) for a symbol of given name. It returns either the already
 * existing symbol or a newly allocated undefined (%SYM_VOID) symbol if no
 * existing symbol is found.
 */
struct symbol *
cf_get_symbol(byte *c)
{
  return cf_get_sym(c, cf_hash(c));
}

struct symbol *
cf_default_name(char *template, int *counter)
{
  char buf[32];
  char buf[SYM_MAX_LEN];
  struct symbol *s;
  char *perc = strchr(template, '%');

  for(;;)
    {
      bsprintf(buf, template, ++(*counter));
      s = cf_find_sym(buf, cf_hash(buf));
      if (!s)
	break;
      s = cf_get_sym(buf, cf_hash(buf));
      if (s->class == SYM_VOID)
	return s;
      if (!perc)
@@ -529,7 +551,7 @@ cf_define_symbol(struct symbol *sym, int type, void *def)
    {
      if (sym->scope == conf_this_scope)
	cf_error("Symbol already defined");
      sym = cf_new_sym(sym->name, cf_hash(sym->name) & (SYM_HASH_SIZE-1));
      sym = cf_new_sym(sym->name, cf_hash(sym->name));
    }
  sym->class = type;
  sym->def = def;
Loading