On Mon, Aug 27, 2018 at 12:11:43PM +0200, Claudio Jeker wrote:
> This is in preparation for introducing as-sets (a fast lookup table for
> when you want to make sure that your peering partner is realy only passing
> you traffic he should).
> 
> To make as-set possible lets do some cleanup beforehands. This mainly
> removes one element from the filter_as struct, uses as_min for unary
> operations and changes the way we pass the and check the neighbor-as.
> as_compare() and aspath_match() now take the neighbor-as as last argument
> and will match against it if AS_FLAG_NEIGHBORAS is set. Simplifies the
> rde_filter_match() a fair bit.
> 

And here is the bgpctl diff needed for this change.

-- 
:wq Claudio

Index: bgpctl.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpctl/bgpctl.c,v
retrieving revision 1.210
diff -u -p -r1.210 bgpctl.c
--- bgpctl.c    29 Jul 2018 13:02:01 -0000      1.210
+++ bgpctl.c    27 Aug 2018 12:02:44 -0000
@@ -159,7 +159,7 @@ main(int argc, char *argv[])
        case IRRFILTER:
                if (!(res->flags & (F_IPV4|F_IPV6)))
                        res->flags |= (F_IPV4|F_IPV6);
-               irr_main(res->as.as, res->flags, res->irr_outdir);
+               irr_main(res->as.as_min, res->flags, res->irr_outdir);
                break;
        case SHOW_MRT:
                if (pledge("stdio", NULL) == -1)
@@ -2056,7 +2056,7 @@ show_mrt_dump(struct mrt_rib *mr, struct
                /* filter by AS */
                if (req->as.type != AS_NONE &&
                   !aspath_match(mre->aspath, mre->aspath_len,
-                  &req->as, req->as.as))
+                  &req->as, 0))
                        continue;
 
                if (req->flags & F_CTL_DETAIL) {
@@ -2122,7 +2122,7 @@ network_mrt_dump(struct mrt_rib *mr, str
                /* filter by AS */
                if (req->as.type != AS_NONE &&
                   !aspath_match(mre->aspath, mre->aspath_len,
-                  &req->as, req->as.as))
+                  &req->as, 0))
                        continue;
 
                bzero(&net, sizeof(net));
Index: parser.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpctl/parser.c,v
retrieving revision 1.82
diff -u -p -r1.82 parser.c
--- parser.c    10 Jul 2018 13:03:06 -0000      1.82
+++ parser.c    27 Aug 2018 12:01:46 -0000
@@ -614,7 +614,7 @@ match_token(int *argc, char **argv[], co
                        }
                        break;
                case ASNUM:
-                       if (parse_asnum(word, wordlen, &res.as.as)) {
+                       if (parse_asnum(word, wordlen, &res.as.as_min)) {
                                match++;
                                t = &table[i];
                        }

Reply via email to