diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2014-05-07 09:19:07 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2014-05-09 15:50:33 +0200 |
commit | 5dc8988377cccbdd9a520f21000d2cea1fc76f7f (patch) | |
tree | f41884ef5f9138a40714445a434e3610579221da /system-linux.c | |
parent | 173a1077ef4d198c2ce1b30f611e5fe5875faa01 (diff) |
netifd: Effectively apply configured route mtu
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'system-linux.c')
-rw-r--r-- | system-linux.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/system-linux.c b/system-linux.c index 8f46705..b513948 100644 --- a/system-linux.c +++ b/system-linux.c @@ -1260,7 +1260,22 @@ static int system_rt(struct device *dev, struct device_route *route, int cmd) if (table >= 256) nla_put_u32(msg, RTA_TABLE, table); + if (route->flags & DEVROUTE_MTU) { + struct nlattr *metrics; + + if (!(metrics = nla_nest_start(msg, RTA_METRICS))) + goto nla_put_failure; + + nla_put_u32(msg, RTAX_MTU, route->mtu); + + nla_nest_end(msg, metrics); + } + return system_rtnl_call(msg); + +nla_put_failure: + nlmsg_free(msg); + return -ENOMEM; } int system_add_route(struct device *dev, struct device_route *route) |