-/* $OpenBSD: bgpd.h,v 1.432 2022/06/19 10:30:09 claudio Exp $ */
+/* $OpenBSD: bgpd.h,v 1.433 2022/06/22 14:48:51 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
struct ctl_show_nexthop {
struct bgpd_addr addr;
struct ctl_show_interface iface;
- union {
- struct kroute kr4;
- struct kroute6 kr6;
- } kr;
+ struct kroute_full kr;
uint8_t valid;
uint8_t krvalid;
};
-/* $OpenBSD: kroute.c,v 1.261 2022/06/22 12:28:33 claudio Exp $ */
+/* $OpenBSD: kroute.c,v 1.262 2022/06/22 14:48:51 claudio Exp $ */
/*
* Copyright (c) 2022 Claudio Jeker <claudio@openbsd.org>
kr = h->kroute;
snh.valid = kroute_validate(&kr->r);
snh.krvalid = 1;
- memcpy(&snh.kr.kr4, &kr->r,
- sizeof(snh.kr.kr4));
+ snh.kr = *kr_tofull(&kr->r);
ifindex = kr->r.ifindex;
break;
case AID_INET6:
kr6 = h->kroute;
snh.valid = kroute6_validate(&kr6->r);
snh.krvalid = 1;
- memcpy(&snh.kr.kr6, &kr6->r,
- sizeof(snh.kr.kr6));
+ snh.kr = *kr6_tofull(&kr6->r);
ifindex = kr6->r.ifindex;
break;
}