]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes setting of route attributes of type router id.
authorOndrej Zajicek <santiago@crfreenet.org>
Tue, 27 Nov 2012 00:25:47 +0000 (01:25 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Tue, 27 Nov 2012 00:25:47 +0000 (01:25 +0100)
filter/filter.c

index 49b67391a673552d5e48019a6543ab08b547d10a..fb2034ee928dde0ea962b7dfae2db54c7b04845c 100644 (file)
@@ -956,11 +956,25 @@ interpret(struct f_inst *what)
       l->attrs[0].type = what->aux | EAF_ORIGINATED;
       switch (what->aux & EAF_TYPE_MASK) {
       case EAF_TYPE_INT:
-      case EAF_TYPE_ROUTER_ID:
        if (v1.type != T_INT)
          runtime( "Setting int attribute to non-int value" );
        l->attrs[0].u.data = v1.val.i;
        break;
+
+      case EAF_TYPE_ROUTER_ID:
+#ifndef IPV6
+       /* IP->Quad implicit conversion */
+       if (v1.type == T_IP) {
+         l->attrs[0].u.data = ipa_to_u32(v1.val.px.ip);
+         break;
+       }
+#endif
+       /* T_INT for backward compatibility */
+       if ((v1.type != T_QUAD) && (v1.type != T_INT))
+         runtime( "Setting quad attribute to non-quad value" );
+       l->attrs[0].u.data = v1.val.i;
+       break;
+
       case EAF_TYPE_OPAQUE:
        runtime( "Setting opaque attribute is not allowed" );
        break;