diff options
author | Justin Iurman <justin.iurman@uliege.be> | 2021-10-11 20:04:11 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-12 11:49:49 +0100 |
commit | 2bbc977ca689e5e18e8cf98f68854f92bd053c97 (patch) | |
tree | 72520ed24c4665b5a509ae02f528efaa043fa404 /net/ipv6/ioam6_iptunnel.c | |
parent | ef1100ef20f29aec4e62abeccdb5bdbebba1e378 (diff) |
ipv6: ioam: move the check for undefined bits
The check for undefined bits in the trace type is moved from the input side to
the output side, while the input side is relaxed and now inserts default empty
values when an undefined bit is set.
Signed-off-by: Justin Iurman <justin.iurman@uliege.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ioam6_iptunnel.c')
-rw-r--r-- | net/ipv6/ioam6_iptunnel.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv6/ioam6_iptunnel.c b/net/ipv6/ioam6_iptunnel.c index f9ee04541c17..9b7b726f8f45 100644 --- a/net/ipv6/ioam6_iptunnel.c +++ b/net/ipv6/ioam6_iptunnel.c @@ -75,7 +75,11 @@ static bool ioam6_validate_trace_hdr(struct ioam6_trace_hdr *trace) u32 fields; if (!trace->type_be32 || !trace->remlen || - trace->remlen > IOAM6_TRACE_DATA_SIZE_MAX / 4) + trace->remlen > IOAM6_TRACE_DATA_SIZE_MAX / 4 || + trace->type.bit12 | trace->type.bit13 | trace->type.bit14 | + trace->type.bit15 | trace->type.bit16 | trace->type.bit17 | + trace->type.bit18 | trace->type.bit19 | trace->type.bit20 | + trace->type.bit21) return false; trace->nodelen = 0; |