diff options
author | 2006-01-10 16:03:11 +0000 | |
---|---|---|
committer | 2006-01-10 16:03:11 +0000 | |
commit | 0422f938a75c80eb136fb035c6ca419a6def14b8 (patch) | |
tree | 409aad2d073b4813423105a6596da7ffca11c57a | |
parent | - rewrite RCS keyword expansion. the old way of doing it was very slow, (diff) | |
download | wireguard-openbsd-0422f938a75c80eb136fb035c6ca419a6def14b8.tar.xz wireguard-openbsd-0422f938a75c80eb136fb035c6ca419a6def14b8.zip |
In attr_diff() compare the attributes flags too. They may be different and
especially they are accounted in the hash. While there change a 0 to NULL.
-rw-r--r-- | usr.sbin/bgpd/rde_attr.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/rde_attr.c b/usr.sbin/bgpd/rde_attr.c index 37b3be82247..59c0d57661c 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.56 2006/01/05 16:00:07 claudio Exp $ */ +/* $OpenBSD: rde_attr.c,v 1.57 2006/01/10 16:03:11 claudio Exp $ */ /* * Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org> @@ -113,7 +113,7 @@ attr_optadd(struct rde_aspath *asp, u_int8_t flags, u_int8_t type, struct attr *a, *t; /* known optional attributes were validated previously */ - if ((a = attr_lookup(flags, type, data, len)) == 0) + if ((a = attr_lookup(flags, type, data, len)) == NULL) a = attr_alloc(flags, type, data, len); /* attribute allowed only once */ @@ -194,6 +194,10 @@ attr_diff(struct attr *oa, struct attr *ob) { int r; + if (oa->flags > ob->flags) + return (1); + if (oa->flags < ob->flags) + return (-1); if (oa->type > ob->type) return (1); if (oa->type < ob->type) |