diff options
author | David S. Miller <davem@davemloft.net> | 2012-06-17 19:47:34 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-17 19:47:34 -0700 |
commit | 6fac262526ee91ee66210b8919a4297dcf7d544e (patch) | |
tree | b013fa21c5a0940523c431cf6041b1d7aa509dfe /net/ipv4/fib_semantics.c | |
parent | a7e2eaadd0edf6d71637c0d99aca404b0da8c1be (diff) | |
download | lwn-6fac262526ee91ee66210b8919a4297dcf7d544e.tar.gz lwn-6fac262526ee91ee66210b8919a4297dcf7d544e.zip |
ipv4: Cap ADVMSS metric in the FIB rather than the routing cache.
It makes no sense to execute this limit test every time we create a
routing cache entry.
We can't simply error out on these things since we've silently
accepted and truncated them forever.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_semantics.c')
-rw-r--r-- | net/ipv4/fib_semantics.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index e5b7182fa099..415f8230fc88 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -779,9 +779,14 @@ struct fib_info *fib_create_info(struct fib_config *cfg) int type = nla_type(nla); if (type) { + u32 val; + if (type > RTAX_MAX) goto err_inval; - fi->fib_metrics[type - 1] = nla_get_u32(nla); + val = nla_get_u32(nla); + if (type == RTAX_ADVMSS && val > 65535 - 40) + val = 65535 - 40; + fi->fib_metrics[type - 1] = val; } } } |