-/* $OpenBSD: rde_prefix.c,v 1.40 2021/01/18 12:15:36 claudio Exp $ */
+/* $OpenBSD: rde_prefix.c,v 1.41 2022/02/25 12:56:12 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
{
struct pt_entry *p = NULL;
- p = pt_fill(prefix, prefixlen);
- p = pt_alloc(p);
+ p = pt_alloc(pt_fill(prefix, prefixlen));
if (RB_INSERT(pt_tree, &pttable, p) != NULL)
fatalx("pt_add: insert failed");
-/* $OpenBSD: rde_rib.c,v 1.226 2022/02/25 11:36:54 claudio Exp $ */
+/* $OpenBSD: rde_rib.c,v 1.227 2022/02/25 12:56:12 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
rib_get(struct rib *rib, struct bgpd_addr *prefix, int prefixlen)
{
struct rib_entry xre, *re;
- struct pt_entry *pte;
- pte = pt_fill(prefix, prefixlen);
memset(&xre, 0, sizeof(xre));
- xre.prefix = pte;
+ xre.prefix = pt_fill(prefix, prefixlen);
re = RB_FIND(rib_tree, rib_tree(rib), &xre);
if (re && re->rib_id != rib->id)
struct bgpd_addr *prefix, int prefixlen)
{
struct prefix xp;
- struct pt_entry *pte;
memset(&xp, 0, sizeof(xp));
- pte = pt_fill(prefix, prefixlen);
- xp.pt = pte;
+ xp.pt = pt_fill(prefix, prefixlen);
xp.path_id_tx = path_id;
return RB_FIND(prefix_index, &peer->adj_rib_out, &xp);
int prefixlen)
{
struct prefix xp, *np;
- struct pt_entry *pte;
memset(&xp, 0, sizeof(xp));
- pte = pt_fill(prefix, prefixlen);
- xp.pt = pte;
+ xp.pt = pt_fill(prefix, prefixlen);
np = RB_NFIND(prefix_index, &peer->adj_rib_out, &xp);
if (np != NULL && pt_prefix_cmp(np->pt, xp.pt) != 0)