From 9872ec4b58fa1b6825c9db2c2364b56b4a59fa52 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Fri, 12 Mar 2004 21:21:40 +0000 Subject: bgpctl has a empty-as keyword so make this actually work. Handle AS_EMPTY in aspath_match(). --- usr.sbin/bgpd/rde_attr.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'usr.sbin/bgpd/rde_attr.c') diff --git a/usr.sbin/bgpd/rde_attr.c b/usr.sbin/bgpd/rde_attr.c index fc35e3cb05e..155ec52cc02 100644 --- a/usr.sbin/bgpd/rde_attr.c +++ b/usr.sbin/bgpd/rde_attr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_attr.c,v 1.23 2004/03/12 21:14:35 claudio Exp $ */ +/* $OpenBSD: rde_attr.c,v 1.24 2004/03/12 21:21:39 claudio Exp $ */ /* * Copyright (c) 2004 Claudio Jeker @@ -947,6 +947,13 @@ aspath_match(struct aspath *a, enum as_spec type, u_int16_t as) u_int16_t len, seg_size; u_int8_t i, seg_type, seg_len; + if (type == AS_EMPTY) { + if (a->hdr.len == 0) + return (1); + else + return (0); + } + final = 0; seg = a->data; for (len = a->hdr.len; len > 0; len -= seg_size, seg += seg_size) { -- cgit v1.2.3