X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=system-linux.c;h=7b3e08fd4e85aed6650942292af81dc94f76f1b3;hp=714729f9dc5110c00639e7b224c4b590ff668d2b;hb=4106d0ced43327848791ed6182f28d461c01a4b8;hpb=93124d96594415563f68bda0ca24c3307e014efd diff --git a/system-linux.c b/system-linux.c index 714729f..7b3e08f 100644 --- a/system-linux.c +++ b/system-linux.c @@ -1142,6 +1142,7 @@ static int system_rt(struct device *dev, struct device_route *route, int cmd) struct rtmsg rtm = { .rtm_family = (alen == 4) ? AF_INET : AF_INET6, .rtm_dst_len = route->mask, + .rtm_src_len = route->sourcemask, .rtm_table = (table < 256) ? table : RT_TABLE_UNSPEC, .rtm_protocol = (route->flags & DEVADDR_KERNEL) ? RTPROT_KERNEL : RTPROT_STATIC, .rtm_scope = scope, @@ -1167,6 +1168,9 @@ 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->metric > 0) nla_put_u32(msg, RTA_PRIORITY, route->metric);