summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bgpctl/bgpctl.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2019-08-05 12:51:32 +0000
committerclaudio <claudio@openbsd.org>2019-08-05 12:51:32 +0000
commit143a9790363bcf535f6ef7e641e947b44d451699 (patch)
tree4eb66dab35ef23383e7bb8246d26a8ca0b825051 /usr.sbin/bgpctl/bgpctl.c
parentDon't use a 0 element to determine the end of an OID when comparing two (diff)
downloadwireguard-openbsd-143a9790363bcf535f6ef7e641e947b44d451699.tar.xz
wireguard-openbsd-143a9790363bcf535f6ef7e641e947b44d451699.zip
Add a comment why network_bulk() is not using send_filterset(). Using
send_filterset() would result in a use after free because send_filterset() frees the set after sending but network_bulk() runs in a loop.
Diffstat (limited to 'usr.sbin/bgpctl/bgpctl.c')
-rw-r--r--usr.sbin/bgpctl/bgpctl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c
index 8242c0d95d2..c30a64f8f57 100644
--- a/usr.sbin/bgpctl/bgpctl.c
+++ b/usr.sbin/bgpctl/bgpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpctl.c,v 1.242 2019/07/03 06:15:48 claudio Exp $ */
+/* $OpenBSD: bgpctl.c,v 1.243 2019/08/05 12:51:32 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -2036,6 +2036,10 @@ network_bulk(struct parse_result *res)
if (res->action == NETWORK_BULK_ADD) {
imsg_compose(ibuf, IMSG_NETWORK_ADD,
0, 0, -1, &net, sizeof(net));
+ /*
+ * can't use send_filterset since that
+ * would free the set.
+ */
TAILQ_FOREACH(s, &res->set, entry) {
imsg_compose(ibuf,
IMSG_FILTER_SET,