Otherwise the kernel will reject it later and the result is no tunnel,
whereas a tunnel with an unexpected TOS seems like a better result.
Bug #12566.
Reported-by: Luca Giraudo <lgiraudo@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
char *endptr;
int tos;
tos = strtol(node->value, &endptr, 0);
- if (*endptr == '\0') {
+ if (*endptr == '\0' && tos == (tos & IP_DSCP_MASK)) {
nl_msg_put_u8(options, OVS_TUNNEL_ATTR_TOS, tos);
+ } else {
+ VLOG_WARN("%s: invalid TOS %s", name, node->value);
}
}
} else if (!strcmp(node->key, "ttl")) {