projects
/
project
/
netifd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
netifd v2: Fix source routing for IPv4
[project/netifd.git]
/
system-linux.c
diff --git
a/system-linux.c
b/system-linux.c
index
8518f0f
..
ed69bef
100644
(file)
--- a/
system-linux.c
+++ b/
system-linux.c
@@
-1433,8
+1433,12
@@
static int system_rt(struct device *dev, struct device_route *route, int cmd)
if (route->mask)
nla_put(msg, RTA_DST, alen, &route->addr);
if (route->mask)
nla_put(msg, RTA_DST, alen, &route->addr);
- if (route->sourcemask)
- nla_put(msg, RTA_SRC, alen, &route->source);
+ if (route->sourcemask) {
+ if (rtm.rtm_family == AF_INET)
+ nla_put(msg, RTA_PREFSRC, alen, &route->source);
+ else
+ nla_put(msg, RTA_SRC, alen, &route->source);
+ }
if (route->metric > 0)
nla_put_u32(msg, RTA_PRIORITY, route->metric);
if (route->metric > 0)
nla_put_u32(msg, RTA_PRIORITY, route->metric);