diff options
Diffstat (limited to 'main/linux-grsec/linux-3.0.x-regression-with-ipv4-routes-having-mtu.patch')
-rw-r--r-- | main/linux-grsec/linux-3.0.x-regression-with-ipv4-routes-having-mtu.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/main/linux-grsec/linux-3.0.x-regression-with-ipv4-routes-having-mtu.patch b/main/linux-grsec/linux-3.0.x-regression-with-ipv4-routes-having-mtu.patch new file mode 100644 index 0000000000..7ca4147826 --- /dev/null +++ b/main/linux-grsec/linux-3.0.x-regression-with-ipv4-routes-having-mtu.patch @@ -0,0 +1,53 @@ +diff --git a/net/ipv4/route.c b/net/ipv4/route.c +index f30112f..26a6249 100644 +--- a/net/ipv4/route.c ++++ b/net/ipv4/route.c +@@ -1841,6 +1841,22 @@ static unsigned int ipv4_mtu(const struct dst_entry *dst) + return mtu; + } + ++static void __rt_init_metrics(struct rtable *rt, struct fib_info *fi, ++ struct inet_peer *peer) ++{ ++ if (peer && fi->fib_metrics == (u32 *) dst_default_metrics) { ++ dst_init_metrics(&rt->dst, peer->metrics, false); ++ return; ++ } ++ ++ if (fi->fib_metrics != (u32 *) dst_default_metrics) { ++ rt->fi = fi; ++ atomic_inc(&fi->fib_clntref); ++ } ++ ++ dst_init_metrics(&rt->dst, fi->fib_metrics, true); ++} ++ + static void rt_init_metrics(struct rtable *rt, const struct flowi4 *fl4, + struct fib_info *fi) + { +@@ -1859,7 +1875,8 @@ static void rt_init_metrics(struct rtable *rt, const struct flowi4 *fl4, + if (inet_metrics_new(peer)) + memcpy(peer->metrics, fi->fib_metrics, + sizeof(u32) * RTAX_MAX); +- dst_init_metrics(&rt->dst, peer->metrics, false); ++ ++ __rt_init_metrics(rt, fi, peer); + + check_peer_pmtu(&rt->dst, peer); + if (peer->redirect_genid != redirect_genid) +@@ -1869,13 +1886,8 @@ static void rt_init_metrics(struct rtable *rt, const struct flowi4 *fl4, + rt->rt_gateway = peer->redirect_learned.a4; + rt->rt_flags |= RTCF_REDIRECTED; + } +- } else { +- if (fi->fib_metrics != (u32 *) dst_default_metrics) { +- rt->fi = fi; +- atomic_inc(&fi->fib_clntref); +- } +- dst_init_metrics(&rt->dst, fi->fib_metrics, true); +- } ++ } else ++ __rt_init_metrics(rt, fi, NULL); + } + + static void rt_set_nexthop(struct rtable *rt, const struct flowi4 *fl4, |