aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-03-13 08:32:28 -0400
committerDave Barach <dave@barachs.net>2020-03-13 08:33:00 -0400
commit7e86947d779d2ac949c2e753590e5d097d56650e (patch)
tree08ec8e67e3040dc1cf6d6939479d1e2ff8e3da4d /src/vnet
parenta73f2d6f53c224668bd6bbea1a980ee4313c794f (diff)
devices: netlink create the object if missing
Type: fix Fixes: b49bc1a Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I3dd81a2484c8b4925fd07556576c29d1cde337e1
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/devices/netlink.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vnet/devices/netlink.c b/src/vnet/devices/netlink.c
index e3e33a3b2d0..72603514772 100644
--- a/src/vnet/devices/netlink.c
+++ b/src/vnet/devices/netlink.c
@@ -243,7 +243,7 @@ vnet_netlink_add_ip4_addr (int ifindex, void *addr, int pfx_len)
ifa.ifa_index = ifindex;
vnet_netlink_msg_init (&m, RTM_NEWADDR,
- NLM_F_REQUEST | NLM_F_REPLACE,
+ NLM_F_REQUEST | NLM_F_CREATE | NLM_F_REPLACE,
&ifa, sizeof (struct ifaddrmsg));
vnet_netlink_msg_add_rtattr (&m, IFA_LOCAL, addr, 4);
@@ -266,7 +266,7 @@ vnet_netlink_add_ip6_addr (int ifindex, void *addr, int pfx_len)
ifa.ifa_index = ifindex;
vnet_netlink_msg_init (&m, RTM_NEWADDR,
- NLM_F_REQUEST | NLM_F_REPLACE,
+ NLM_F_REQUEST | NLM_F_CREATE | NLM_F_REPLACE,
&ifa, sizeof (struct ifaddrmsg));
vnet_netlink_msg_add_rtattr (&m, IFA_LOCAL, addr, 16);
@@ -291,7 +291,7 @@ vnet_netlink_add_ip4_route (void *dst, u8 dst_len, void *gw)
rtm.rtm_dst_len = dst_len;
vnet_netlink_msg_init (&m, RTM_NEWROUTE,
- NLM_F_REQUEST | NLM_F_REPLACE,
+ NLM_F_REQUEST | NLM_F_CREATE | NLM_F_REPLACE,
&rtm, sizeof (struct rtmsg));
vnet_netlink_msg_add_rtattr (&m, RTA_GATEWAY, gw, 4);
@@ -316,7 +316,7 @@ vnet_netlink_add_ip6_route (void *dst, u8 dst_len, void *gw)
rtm.rtm_dst_len = dst_len;
vnet_netlink_msg_init (&m, RTM_NEWROUTE,
- NLM_F_REQUEST | NLM_F_REPLACE,
+ NLM_F_REQUEST | NLM_F_CREATE | NLM_F_REPLACE,
&rtm, sizeof (struct rtmsg));
vnet_netlink_msg_add_rtattr (&m, RTA_GATEWAY, gw, 16);