-/* $OpenBSD: bgpd.h,v 1.448 2022/07/28 13:11:48 deraadt Exp $ */
+/* $OpenBSD: bgpd.h,v 1.449 2022/08/10 14:17:01 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
struct bgpd_addr nexthop;
struct bgpd_addr gateway;
struct bgpd_addr net;
+ uint8_t netlen;
uint8_t valid;
uint8_t connected;
- uint8_t netlen;
};
struct session_dependon {
-/* $OpenBSD: rde.c,v 1.561 2022/08/10 11:11:02 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.562 2022/08/10 14:17:01 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
nexthop = prefix_nexthop(p);
peer = prefix_peer(p);
- bzero(&rib, sizeof(rib));
+ memset(&rib, 0, sizeof(rib));
rib.age = getmonotime() - p->lastchange;
rib.local_pref = asp->lpref;
rib.med = asp->med;
sizeof(rib.remote_addr));
rib.remote_id = peer->remote_bgpid;
if (nexthop != NULL) {
- memcpy(&rib.true_nexthop, &nexthop->true_nexthop,
- sizeof(rib.true_nexthop));
- memcpy(&rib.exit_nexthop, &nexthop->exit_nexthop,
- sizeof(rib.exit_nexthop));
+ rib.exit_nexthop = nexthop->exit_nexthop;
+ rib.true_nexthop = nexthop->true_nexthop;
} else {
- /* announced network may have a NULL nexthop */
- bzero(&rib.true_nexthop, sizeof(rib.true_nexthop));
- bzero(&rib.exit_nexthop, sizeof(rib.exit_nexthop));
- rib.true_nexthop.aid = p->pt->aid;
+ /* announced network can have a NULL nexthop */
rib.exit_nexthop.aid = p->pt->aid;
+ rib.true_nexthop.aid = p->pt->aid;
}
pt_getaddr(p->pt, &rib.prefix);
rib.prefixlen = p->pt->prefixlen;
-/* $OpenBSD: rde_rib.c,v 1.242 2022/07/28 13:11:51 deraadt Exp $ */
+/* $OpenBSD: rde_rib.c,v 1.243 2022/08/10 14:17:01 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
if (msg->connected) {
nh->flags |= NEXTHOP_CONNECTED;
- memcpy(&nh->true_nexthop, &nh->exit_nexthop,
- sizeof(nh->true_nexthop));
+ nh->true_nexthop = nh->exit_nexthop;
} else
- memcpy(&nh->true_nexthop, &msg->gateway,
- sizeof(nh->true_nexthop));
+ nh->true_nexthop = msg->gateway;
- memcpy(&nh->nexthop_net, &msg->net,
- sizeof(nh->nexthop_net));
+ nh->nexthop_net = msg->net;
nh->nexthop_netlen = msg->netlen;
nh->next_prefix = LIST_FIRST(&nh->prefix_h);