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);