From 2c8dcae0d9a5f9b8ec13a513a69ecf92dfc7642c Mon Sep 17 00:00:00 2001 From: Bill Yuan Date: Fri, 13 Apr 2018 01:49:26 +0000 Subject: [PATCH] ipfw3nat: flush all configurations --- sys/net/ipfw3_nat/ip_fw3_nat.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/net/ipfw3_nat/ip_fw3_nat.c b/sys/net/ipfw3_nat/ip_fw3_nat.c index 584308ea1b..d44498466c 100644 --- a/sys/net/ipfw3_nat/ip_fw3_nat.c +++ b/sys/net/ipfw3_nat/ip_fw3_nat.c @@ -578,7 +578,16 @@ ip_fw3_ctl_nat_del(struct sockopt *sopt) int ip_fw3_ctl_nat_flush(struct sockopt *sopt) { - /* TODO */ + struct netmsg_nat_del nat_del_msg, *msg; + int i; + msg = &nat_del_msg; + for (i = 0; i < NAT_ID_MAX; i++) { + msg->id = i + 1; + netmsg_init(&msg->base, NULL, &curthread->td_msgport, + 0, nat_del_dispatch); + + netisr_domsg(&msg->base, 0); + } return 0; } -- 2.11.4.GIT