Commit c651cef7 authored by Maria Matejka's avatar Maria Matejka
Browse files

Global interface list renamed to not clash with local lists

parent b6c92635
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@

static pool *if_pool;

list iface_list;
list global_iface_list;
struct iface default_vrf;

static void if_recalc_preferred(struct iface *i);
@@ -111,7 +111,7 @@ if_dump_all(void)
  struct iface *i;

  debug("Known network interfaces:\n");
  WALK_LIST(i, iface_list)
  WALK_LIST(i, global_iface_list)
    if_dump(i);
  debug("Router ID: %08x\n", config->router_id);
}
@@ -307,7 +307,7 @@ if_update(struct iface *new)
  if (!new->master)
    new->master = &default_vrf;

  WALK_LIST(i, iface_list)
  WALK_LIST(i, global_iface_list)
    if (!strcmp(new->name, i->name))
      {
	new->flags = if_recalc_flags(new, new->flags);
@@ -340,7 +340,7 @@ if_update(struct iface *new)
newif:
  init_list(&i->neighbors);
  i->flags |= IF_UPDATED | IF_TMP_DOWN;		/* Tmp down as we don't have addresses yet */
  add_tail(&iface_list, &i->n);
  add_tail(&global_iface_list, &i->n);
  return i;
}

@@ -350,7 +350,7 @@ if_start_update(void)
  struct iface *i;
  struct ifa *a;

  WALK_LIST(i, iface_list)
  WALK_LIST(i, global_iface_list)
    {
      i->flags &= ~IF_UPDATED;
      WALK_LIST(a, i->addrs)
@@ -374,7 +374,7 @@ if_end_update(void)
  struct iface *i;
  struct ifa *a, *b;

  WALK_LIST(i, iface_list)
  WALK_LIST(i, global_iface_list)
    {
      if (!(i->flags & IF_UPDATED))
	if_change_flags(i, (i->flags & ~IF_ADMIN_UP) | IF_SHUTDOWN);
@@ -413,7 +413,7 @@ if_feed_baby(struct proto *p)
  if (!p->if_notify && !p->ifa_notify)	/* shortcut */
    return;
  DBG("Announcing interfaces to new protocol %s\n", p->name);
  WALK_LIST(i, iface_list)
  WALK_LIST(i, global_iface_list)
    {
      if_send_notify(p, IF_CHANGE_CREATE | ((i->flags & IF_UP) ? IF_CHANGE_UP : 0), i);
      if (i->flags & IF_UP)
@@ -435,7 +435,7 @@ if_find_by_index(unsigned idx)
{
  struct iface *i;

  WALK_LIST(i, iface_list)
  WALK_LIST(i, global_iface_list)
    if (i->index == idx && !(i->flags & IF_SHUTDOWN))
      return i;
  return NULL;
@@ -454,7 +454,7 @@ if_find_by_name(const char *name)
{
  struct iface *i;

  WALK_LIST(i, iface_list)
  WALK_LIST(i, global_iface_list)
    if (!strcmp(i->name, name) && !(i->flags & IF_SHUTDOWN))
      return i;
  return NULL;
@@ -465,7 +465,7 @@ if_get_by_name(const char *name)
{
  struct iface *i;

  WALK_LIST(i, iface_list)
  WALK_LIST(i, global_iface_list)
    if (!strcmp(i->name, name))
      return i;

@@ -475,7 +475,7 @@ if_get_by_name(const char *name)
  i->flags = IF_SHUTDOWN;
  init_list(&i->addrs);
  init_list(&i->neighbors);
  add_tail(&iface_list, &i->n);
  add_tail(&global_iface_list, &i->n);
  return i;
}

@@ -561,7 +561,7 @@ if_recalc_all_preferred_addresses(void)
{
  struct iface *i;

  WALK_LIST(i, iface_list)
  WALK_LIST(i, global_iface_list)
  {
    if_recalc_preferred(i);

@@ -669,7 +669,7 @@ if_choose_router_id(struct iface_patt *mask, u32 old_id)
  struct ifa *a, *b;

  b = NULL;
  WALK_LIST(i, iface_list)
  WALK_LIST(i, global_iface_list)
    {
      if (!(i->flags & IF_ADMIN_UP) ||
	  (i->flags & IF_SHUTDOWN))
@@ -716,7 +716,7 @@ void
if_init(void)
{
  if_pool = rp_new(&root_pool, &main_birdloop, "Interfaces");
  init_list(&iface_list);
  init_list(&global_iface_list);
  strcpy(default_vrf.name, "default");
  neigh_init(if_pool);
}
@@ -844,7 +844,7 @@ if_show(void)
  struct ifa *a;
  char *type;

  WALK_LIST(i, iface_list)
  WALK_LIST(i, global_iface_list)
    {
      if (i->flags & IF_SHUTDOWN)
	continue;
@@ -887,7 +887,7 @@ if_show_summary(void)
  struct iface *i;

  cli_msg(-2005, "%-10s %-6s %-18s %s", "Interface", "State", "IPv4 address", "IPv6 address");
  WALK_LIST(i, iface_list)
  WALK_LIST(i, global_iface_list)
    {
      byte a4[IPA_MAX_TEXT_LENGTH + 17];
      byte a6[IPA_MAX_TEXT_LENGTH + 17];
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
#include "lib/lists.h"
#include "lib/ip.h"

extern list iface_list;
extern list global_iface_list;

struct proto;
struct pool;
+3 −3
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ if_connected_any(ip_addr a, struct iface *vrf, struct iface **iface, struct ifa
  *addr = NULL;

  /* Prefer SCOPE_HOST or longer prefix */
  WALK_LIST(i, iface_list)
  WALK_LIST(i, global_iface_list)
    if ((!vrf || vrf == i->master) && ((s = if_connected(a, i, &b, flags)) >= 0))
      if (scope_better(s, scope) || (scope_remote(s, scope) && ifa_better(b, *addr)))
      {
@@ -440,7 +440,7 @@ neigh_if_up(struct iface *i)
  node *x, *y;

  /* Update neighbors that might be better off with the new iface */
  WALK_LIST(ii, iface_list)
  WALK_LIST(ii, global_iface_list)
    if (!EMPTY_LIST(ii->neighbors) && (ii != i) && if_intersect(i, ii))
      WALK_LIST2_DELSAFE(n, x, y, ii->neighbors, if_n)
	neigh_update(n, i);
@@ -502,7 +502,7 @@ neigh_ifa_up(struct ifa *a)
  node *x, *y;

  /* Update neighbors that might be better off with the new ifa */
  WALK_LIST(ii, iface_list)
  WALK_LIST(ii, global_iface_list)
    if (!EMPTY_LIST(ii->neighbors) && ifa_intersect(a, ii))
      WALK_LIST2_DELSAFE(n, x, y, ii->neighbors, if_n)
	neigh_update(n, i);
+1 −1
Original line number Diff line number Diff line
@@ -1907,7 +1907,7 @@ babel_reconfigure_ifaces(struct babel_proto *p, struct babel_config *cf)
{
  struct iface *iface;

  WALK_LIST(iface, iface_list)
  WALK_LIST(iface, global_iface_list)
  {
    if (!(iface->flags & IF_UP))
      continue;
+2 −2
Original line number Diff line number Diff line
@@ -1225,7 +1225,7 @@ ospf_reconfigure_ifaces2(struct ospf_proto *p)
  struct iface *iface;
  struct ifa *a;

  WALK_LIST(iface, iface_list)
  WALK_LIST(iface, global_iface_list)
  {
    if (! (iface->flags & IF_UP))
      continue;
@@ -1271,7 +1271,7 @@ ospf_reconfigure_ifaces3(struct ospf_proto *p)
  struct iface *iface;
  struct ifa *a;

  WALK_LIST(iface, iface_list)
  WALK_LIST(iface, global_iface_list)
  {
    if (! (iface->flags & IF_UP))
      continue;
Loading