]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes a new bug in the pipe protocol soft reconfiguration.
authorOndrej Zajicek <santiago@crfreenet.org>
Sun, 20 Dec 2009 13:59:12 +0000 (14:59 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Sun, 20 Dec 2009 13:59:12 +0000 (14:59 +0100)
Also updates route reload for pipes.

doc/bird.sgml
proto/pipe/pipe.c

index 3905a29ee010a8555e239ebc2a899cbb669c3ad3..a6278a1a022544f0955bf8bed130e6e06eb090c8 100644 (file)
@@ -513,7 +513,9 @@ This argument can be omitted if there exists only a single instance.
        Re-export always succeeds, but re-import is protocol-dependent
        and might fail (for example, if BGP neighbor does not support
        route-refresh extension). In that case, re-export is also
-       skipped.
+       skipped. Note that for the pipe protocol, both directions are
+       always reloaded together (<cf/in/ or <cf/out/ options are
+       ignored in that case).
 
        <tag/down/
        Shut BIRD down.
index 18f1c005881845fac032f86503a00769a1274273..aa76a1523ce310b24c0073e83b7ed8a61b3e89c3 100644 (file)
@@ -113,6 +113,19 @@ pipe_import_control(struct proto *P, rte **ee, ea_list **ea UNUSED, struct linpo
   return 0;
 }
 
+static int
+pipe_reload_routes(struct proto *P)
+{
+  /*
+   * Because the pipe protocol feeds routes from both routing tables
+   * together, both directions are reloaded during refeed and 'reload
+   * out' command works like 'reload' command. For symmetry, we also
+   * request refeed when 'reload in' command is used.
+   */
+  proto_request_feeding(P);
+  return 1;
+}
+
 static int
 pipe_start(struct proto *P)
 {
@@ -183,6 +196,7 @@ pipe_init(struct proto_config *C)
   P->accept_ra_types = (p->mode == PIPE_OPAQUE) ? RA_OPTIMAL : RA_ANY;
   P->rt_notify = pipe_rt_notify_pri;
   P->import_control = pipe_import_control;
+  P->reload_routes = pipe_reload_routes;
   return P;
 }
 
@@ -206,12 +220,18 @@ pipe_get_status(struct proto *P, byte *buf)
 }
 
 static int
-pipe_reconfigure(struct proto *p, struct proto_config *new)
+pipe_reconfigure(struct proto *P, struct proto_config *new)
 {
-  struct pipe_config *o = (struct pipe_config *) p->cf;
+  struct pipe_proto *p = (struct pipe_proto *) P;
+  struct pipe_config *o = (struct pipe_config *) P->cf;
   struct pipe_config *n = (struct pipe_config *) new;
 
-  return (o->peer->table == n->peer->table) && (o->mode == n->mode);
+  if ((o->peer->table != n->peer->table) || (o->mode != n->mode))
+    return 0;
+
+  /* Update also the filter in the phantom protocol */
+  p->phantom->p.out_filter = new->in_filter;
+  return 1;
 }
 
 struct protocol proto_pipe = {