diff options
author | Ben Pfaff <blp@nicira.com> | 2012-07-20 10:24:50 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2012-07-20 10:24:50 -0700 |
commit | 91aff446f3ad343e8e392a9e2b3659b895d1487f (patch) | |
tree | 7c3db788b623c6522e85f8a455b5d7d3f9a019ab /lib | |
parent | df778240e1e311f7eba9dfda4f5f8bf0f915ae5f (diff) | |
download | openvswitch-91aff446f3ad343e8e392a9e2b3659b895d1487f.tar.gz |
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 <lgiraudo@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/netdev-vport.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index 836069f70..db5c3db8d 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")) { |