From 59af4c15f779eeaa82c2df4caa871cd06610e241 Mon Sep 17 00:00:00 2001 From: denis Date: Sat, 23 Jun 2018 09:54:17 +0000 Subject: Fix a segfault when inserting the same prefix multiple times OK bluhm@, jca@, kn@ --- regress/sys/net/rtable/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'regress') diff --git a/regress/sys/net/rtable/util.c b/regress/sys/net/rtable/util.c index ded34dbc5d1..ea037b9409f 100644 --- a/regress/sys/net/rtable/util.c +++ b/regress/sys/net/rtable/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.6 2017/07/27 13:34:30 mpi Exp $ */ +/* $OpenBSD: util.c,v 1.7 2018/06/23 09:54:16 denis Exp $ */ /* * Copyright (c) 2015 Martin Pieuchot @@ -110,7 +110,7 @@ route_insert(unsigned int rid, sa_family_t af, char *string) rt_maskedcopy(dst, ndst, mask); if ((error = rtable_insert(rid, ndst, mask, NULL, 0, rt)) != 0) { - inet_net_satop(af, rt_key(rt), plen, ip, sizeof(ip)); + inet_net_satop(af, ndst, plen, ip, sizeof(ip)); errx(1, "can't add route: %s, %s\n", ip, strerror(error)); } nrt = rtable_lookup(rid, dst, mask, NULL, RTP_ANY); -- cgit v1.2.3