X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=system-linux.c;h=ed69bef015055ffeabbb3a4aa927cb00b32cda57;hp=8518f0fe4b958d1c8fc76045ec67217d13499add;hb=25289c946427db676d41c0fa4e6c01ade2f43b66;hpb=3c570d03d747f6835bfecbf8a43e0b7092015fad diff --git a/system-linux.c b/system-linux.c index 8518f0f..ed69bef 100644 --- 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->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);