]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Nest: Fix export of tmpattrs through pipes
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Mon, 14 Jun 2021 18:02:50 +0000 (20:02 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Mon, 14 Jun 2021 18:02:50 +0000 (20:02 +0200)
Pipes copy the original rte with old values, so they require rte to be
exported with stored tmpattrs. Other protocols access stored attributes
using eattr list, so they require rte to be exported with expanded
tmpattrs. This is temporary hack, we plan to remove whoe tmpattr mechanism.

Thanks to Paul Donohue for the bugreport.

nest/rt-table.c

index 13209dd7c7c44603f33d5bfbf2c8c27788cafb55..390b3277ca330a3eacff59d68772e1b072d8fcd1 100644 (file)
@@ -618,6 +618,12 @@ export_filter_(struct channel *c, rte *rt0, rte **rt_free, linpool *pool, int si
       goto reject;
     }
 
+#ifdef CONFIG_PIPE
+  /* Pipes need rte with stored tmpattrs, remaining protocols need expanded tmpattrs */
+  if (p->proto == &proto_pipe)
+    rte_store_tmp_attrs(rt, pool, NULL);
+#endif
+
  accept:
   if (rt != rt0)
     *rt_free = rt;