projects
/
oweals
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
206958f
)
fix adding routes
author
Felix Fietkau
<nbd@openwrt.org>
Fri, 14 Oct 2011 01:35:52 +0000
(
03:35
+0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Fri, 14 Oct 2011 01:35:52 +0000
(
03:35
+0200)
system-linux.c
patch
|
blob
|
history
diff --git
a/system-linux.c
b/system-linux.c
index e04fa233530fa2508d62d194cdb9bbb0c7d168c0..cf4e9c7e64c0d4fe6b5dff2e4d4f16f5551867b1 100644
(file)
--- a/
system-linux.c
+++ b/
system-linux.c
@@
-393,6
+393,7
@@
static int system_rt(struct device *dev, struct device_route *route, int cmd)
{
int alen = ((route->flags & DEVADDR_FAMILY) == DEVADDR_INET4) ? 4 : 16;
bool have_gw;
+ unsigned int flags = 0;
if (alen == 4)
have_gw = !!route->nexthop.in.s_addr;
@@
-414,7
+415,10
@@
static int system_rt(struct device *dev, struct device_route *route, int cmd)
.rtm_type = (cmd == RTM_DELROUTE) ? 0: RTN_UNICAST,
};
- struct nl_msg *msg = nlmsg_alloc_simple(cmd, 0);
+ if (cmd == RTM_NEWROUTE)
+ flags |= NLM_F_CREATE | NLM_F_REPLACE;
+
+ struct nl_msg *msg = nlmsg_alloc_simple(cmd, flags);
if (!msg)
return -1;