Revision 013a9b91 sysdep/unix/krt-set.c

View differences:

sysdep/unix/krt-set.c
133 133
krt_set_preconfig(struct krt_config *c)
134 134
{
135 135
}
136

  
137
void
138
krt_set_shutdown(struct krt_proto *x)
139
{
140
  struct rtable *t = &master_table;
141

  
142
  if (((struct krt_config *) x->p.cf)->setopt.persist)
143
    return;
144
  DBG("Flushing kernel routes...\n");
145
  while (t && t->tos)
146
    t = t->sibling;
147
  if (!t)
148
    return;
149
  FIB_WALK(&t->fib, f)
150
    {
151
      net *n = (net *) f;
152
      rte *e = n->routes;
153
      if (e)
154
	{
155
	  rta *a = e->attrs;
156
	  if (a->source != RTS_DEVICE && a->source != RTS_INHERIT)
157
	    krt_remove_route(e);
158
	}
159
    }
160
  FIB_WALK_END;
161
} 

Also available in: Unified diff