diff options
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/rde.h | 6 | ||||
-rw-r--r-- | usr.sbin/bgpd/rde_rib.c | 10 |
2 files changed, 7 insertions, 9 deletions
diff --git a/usr.sbin/bgpd/rde.h b/usr.sbin/bgpd/rde.h index 7878aaac262..776c37a03f2 100644 --- a/usr.sbin/bgpd/rde.h +++ b/usr.sbin/bgpd/rde.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.h,v 1.231 2020/01/09 14:44:55 claudio Exp $ */ +/* $OpenBSD: rde.h,v 1.232 2020/01/09 15:50:34 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> and @@ -215,14 +215,16 @@ struct rde_aspath { struct attr **others; struct aspath *aspath; u_int64_t hash; + int refcnt; u_int32_t flags; /* internally used */ +#define aspath_hashstart med u_int32_t med; /* multi exit disc */ u_int32_t lpref; /* local pref */ u_int32_t weight; /* low prio lpref */ - int refcnt; u_int16_t rtlabelid; /* route label id */ u_int16_t pftableid; /* pf table id */ u_int8_t origin; +#define aspath_hashend others_len u_int8_t others_len; }; diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c index 116e55cb531..2df44649e2f 100644 --- a/usr.sbin/bgpd/rde_rib.c +++ b/usr.sbin/bgpd/rde_rib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_rib.c,v 1.212 2020/01/09 11:55:25 claudio Exp $ */ +/* $OpenBSD: rde_rib.c,v 1.213 2020/01/09 15:50:34 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> @@ -701,12 +701,8 @@ path_hash(struct rde_aspath *asp) u_int64_t hash; SipHash24_Init(&ctx, &pathtablekey); - SipHash24_Update(&ctx, &asp->origin, sizeof(asp->origin)); - SipHash24_Update(&ctx, &asp->med, sizeof(asp->med)); - SipHash24_Update(&ctx, &asp->lpref, sizeof(asp->lpref)); - SipHash24_Update(&ctx, &asp->weight, sizeof(asp->weight)); - SipHash24_Update(&ctx, &asp->rtlabelid, sizeof(asp->rtlabelid)); - SipHash24_Update(&ctx, &asp->pftableid, sizeof(asp->pftableid)); + SipHash24_Update(&ctx, &asp->aspath_hashstart, + (char *)&asp->aspath_hashend - (char *)&asp->aspath_hashstart); if (asp->aspath) SipHash24_Update(&ctx, asp->aspath->data, asp->aspath->len); |