aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv4/fib_semantics.c2
-rw-r--r--net/ipv4/route.c7
2 files changed, 3 insertions, 6 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index ae301c897a19..d71bfbdc0bf4 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -794,6 +794,8 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
794 val = nla_get_u32(nla); 794 val = nla_get_u32(nla);
795 if (type == RTAX_ADVMSS && val > 65535 - 40) 795 if (type == RTAX_ADVMSS && val > 65535 - 40)
796 val = 65535 - 40; 796 val = 65535 - 40;
797 if (type == RTAX_MTU && val > 65535 - 15)
798 val = 65535 - 15;
797 fi->fib_metrics[type - 1] = val; 799 fi->fib_metrics[type - 1] = val;
798 } 800 }
799 } 801 }
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 677d65253e4c..1678b575165b 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1763,21 +1763,16 @@ static void rt_set_nexthop(struct rtable *rt, const struct flowi4 *fl4,
1763 const struct fib_result *res, 1763 const struct fib_result *res,
1764 struct fib_info *fi, u16 type, u32 itag) 1764 struct fib_info *fi, u16 type, u32 itag)
1765{ 1765{
1766 struct dst_entry *dst = &rt->dst;
1767
1768 if (fi) { 1766 if (fi) {
1769 if (FIB_RES_GW(*res) && 1767 if (FIB_RES_GW(*res) &&
1770 FIB_RES_NH(*res).nh_scope == RT_SCOPE_LINK) 1768 FIB_RES_NH(*res).nh_scope == RT_SCOPE_LINK)
1771 rt->rt_gateway = FIB_RES_GW(*res); 1769 rt->rt_gateway = FIB_RES_GW(*res);
1772 rt_init_metrics(rt, fl4, fi); 1770 rt_init_metrics(rt, fl4, fi);
1773#ifdef CONFIG_IP_ROUTE_CLASSID 1771#ifdef CONFIG_IP_ROUTE_CLASSID
1774 dst->tclassid = FIB_RES_NH(*res).nh_tclassid; 1772 rt->dst.tclassid = FIB_RES_NH(*res).nh_tclassid;
1775#endif 1773#endif
1776 } 1774 }
1777 1775
1778 if (dst_mtu(dst) > IP_MAX_MTU)
1779 dst_metric_set(dst, RTAX_MTU, IP_MAX_MTU);
1780
1781#ifdef CONFIG_IP_ROUTE_CLASSID 1776#ifdef CONFIG_IP_ROUTE_CLASSID
1782#ifdef CONFIG_IP_MULTIPLE_TABLES 1777#ifdef CONFIG_IP_MULTIPLE_TABLES
1783 set_class_tag(rt, fib_rules_tclass(res)); 1778 set_class_tag(rt, fib_rules_tclass(res));