From 55c7d8f55b6bdb264a52410467a7e8cff3bec3a9 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 29 Jun 2012 13:26:32 +0200 Subject: [PATCH] interface-ip.{c,h}: add new flag DEVROUTE_MTU and set it for per-route mtu overrides --- interface-ip.c | 4 +++- interface-ip.h | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/interface-ip.c b/interface-ip.c index b097c1f..fa84fc7 100644 --- a/interface-ip.c +++ b/interface-ip.c @@ -238,8 +238,10 @@ interface_ip_add_route(struct interface *iface, struct blob_attr *attr, bool v6) route->flags |= DEVROUTE_METRIC; } - if ((cur = tb[ROUTE_MTU]) != NULL) + if ((cur = tb[ROUTE_MTU]) != NULL) { route->mtu = blobmsg_get_u32(cur); + route->flags |= DEVROUTE_MTU; + } vlist_add(&ip->route, &route->node, &route->flags); return; diff --git a/interface-ip.h b/interface-ip.h index d206eca..1a82ad6 100644 --- a/interface-ip.h +++ b/interface-ip.h @@ -28,8 +28,11 @@ enum device_addr_flags { /* route overrides the default interface metric */ DEVROUTE_METRIC = (1 << 3), + /* route overrides the default interface mtu */ + DEVROUTE_MTU = (1 << 4), + /* route automatically added by kernel */ - DEVADDR_KERNEL = (1 << 4), + DEVADDR_KERNEL = (1 << 5), }; union if_addr { -- 2.25.1