From: Ben Pfaff Date: Fri, 20 Jul 2012 17:24:50 +0000 (-0700) Subject: netdev-vport: Warn about invalid TOS. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91aff446f3ad343e8e392a9e2b3659b895d1487f;p=openvswitch netdev-vport: Warn about invalid TOS. 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 Signed-off-by: Ben Pfaff --- diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index 836069f7..db5c3db8 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -614,8 +614,10 @@ parse_tunnel_config(const char *name, const char *type, 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")) {