diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2018-12-11 09:02:15 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2018-12-11 09:02:15 +0000 |
commit | bf129b3f320c50facaadd3b350190cb1b9b34af2 (patch) | |
tree | d6d39c98fe7f2f04757367e18c9e872eceb03c3a /usr.sbin/bgpd/rde_filter.c | |
parent | 1cdeef6e27ba4d263bbf57c118336f16f20b0c33 (diff) |
Refactor aspath code a bit. Move cached source_as (for origin validation)
into struct aspath and pass that struct to aspath_match().
OK denis@
Diffstat (limited to 'usr.sbin/bgpd/rde_filter.c')
-rw-r--r-- | usr.sbin/bgpd/rde_filter.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/rde_filter.c b/usr.sbin/bgpd/rde_filter.c index d731bed35cc..187ea3c546b 100644 --- a/usr.sbin/bgpd/rde_filter.c +++ b/usr.sbin/bgpd/rde_filter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_filter.c,v 1.114 2018/11/28 08:32:27 claudio Exp $ */ +/* $OpenBSD: rde_filter.c,v 1.115 2018/12/11 09:02:14 claudio Exp $ */ /* * Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org> @@ -219,8 +219,8 @@ rde_filter_match(struct filter_rule *f, struct rde_peer *peer, } if (asp != NULL && f->match.as.type != AS_UNDEF) { - if (aspath_match(asp->aspath->data, asp->aspath->len, - &f->match.as, peer->conf.remote_as) == 0) + if (aspath_match(asp->aspath, &f->match.as, + peer->conf.remote_as) == 0) return (0); } @@ -289,7 +289,7 @@ rde_filter_match(struct filter_rule *f, struct rde_peer *peer, pt_getaddr(p->re->prefix, prefix); plen = p->re->prefix->prefixlen; if (trie_roa_check(&f->match.originset.ps->th, prefix, plen, - asp->source_as) != ROA_VALID) + aspath_origin(asp->aspath)) != ROA_VALID) return (0); } |