diff options
author | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2021-03-21 18:15:29 +0000 |
---|---|---|
committer | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2021-03-28 20:40:48 +0000 |
commit | 589d5d28a8119dac166346f890fa450e1b7b489c (patch) | |
tree | 9399b2a905b90c0cab7716cd966b9e3539d5026c | |
parent | 6f4f8a441aaab2e23a8e70ed0689daa05cec3ef4 (diff) | |
download | src-589d5d28a8119dac166346f890fa450e1b7b489c.tar.gz src-589d5d28a8119dac166346f890fa450e1b7b489c.zip |
Fix kassert panic when inserting multipath routes from multiple threads.
Reported by: Marco Zec <zec at fer.hr>
Approved by: re (gjb)
(cherry picked from commit 42f997d9b721ce5b64c37958f21fa81630f5a224)
-rw-r--r-- | sys/net/route/nhgrp_ctl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/route/nhgrp_ctl.c b/sys/net/route/nhgrp_ctl.c index c2119506370f..b329b907144f 100644 --- a/sys/net/route/nhgrp_ctl.c +++ b/sys/net/route/nhgrp_ctl.c @@ -488,7 +488,9 @@ get_nhgrp(struct nh_control *ctl, struct weightened_nhop *wn, int num_nhops, if (link_nhgrp(ctl, key) == 0) { /* Unable to allocate index? */ *perror = EAGAIN; - destroy_nhgrp(key); + free_nhgrp_nhops(key); + destroy_nhgrp_int(key); + return (NULL); } *perror = 0; return (key); |