mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2025-10-11 07:39:04 +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>
|
2005-10-07 Stephen Hemminger <shemminger@osdl.org>
|
||||||
|
|
||||||
* Reenable ip mroute
|
* 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)
|
static int flush_rule(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
|
||||||
{
|
{
|
||||||
|
struct rtnl_handle rth2;
|
||||||
struct rtmsg *r = NLMSG_DATA(n);
|
struct rtmsg *r = NLMSG_DATA(n);
|
||||||
int len = n->nlmsg_len;
|
int len = n->nlmsg_len;
|
||||||
struct rtattr * tb[RTA_MAX+1];
|
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_type = RTM_DELRULE;
|
||||||
n->nlmsg_flags = NLM_F_REQUEST;
|
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;
|
return -2;
|
||||||
|
|
||||||
|
rtnl_close(&rth2);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user