mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2025-10-10 18:37:02 +00:00
Fix ip rule flush
This commit is contained in:
parent
393c43784c
commit
b77caeba0e
@ -1,3 +1,7 @@
|
||||
2005-10-12 Jamal Hadi Salim <hadi@znyx.com>
|
||||
|
||||
* Fix ip rule flush, need to reopen rtnl
|
||||
|
||||
2005-10-07 Stephen Hemminger <shemminger@osdl.org>
|
||||
|
||||
* Reenable ip mroute
|
||||
|
@ -300,6 +300,7 @@ static int iprule_modify(int cmd, int argc, char **argv)
|
||||
|
||||
static int flush_rule(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
|
||||
{
|
||||
struct rtnl_handle rth2;
|
||||
struct rtmsg *r = NLMSG_DATA(n);
|
||||
int len = n->nlmsg_len;
|
||||
struct rtattr * tb[RTA_MAX+1];
|
||||
@ -314,8 +315,13 @@ static int flush_rule(const struct sockaddr_nl *who, struct nlmsghdr *n, void *a
|
||||
n->nlmsg_type = RTM_DELRULE;
|
||||
n->nlmsg_flags = NLM_F_REQUEST;
|
||||
|
||||
if (rtnl_talk(&rth, n, 0, 0, NULL, NULL, NULL) < 0)
|
||||
if (rtnl_open(&rth2, 0) < 0)
|
||||
return -1;
|
||||
|
||||
if (rtnl_talk(&rth2, n, 0, 0, NULL, NULL, NULL) < 0)
|
||||
return -2;
|
||||
|
||||
rtnl_close(&rth2);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user