X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fnetdev-vport.c;h=db5c3db8d71cf77da9dd05e284ab2dd18bbe2222;hb=e0f3585d4499db4ad0f22fd3c4749ba2e9814c33;hp=7fe169e3603913c0f000077705e71f669dbe0d08;hpb=79f1cbe9f86ddfb1b5d92b80d85e09cd44768d6c;p=sliver-openvswitch.git diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index 7fe169e36..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")) { @@ -681,10 +683,14 @@ parse_tunnel_config(const char *name, const char *type, } if (is_ipsec) { - char *file_name = xasprintf("%s/%s", ovs_rundir(), - "ovs-monitor-ipsec.pid"); - pid_t pid = read_pidfile(file_name); - free(file_name); + static pid_t pid = 0; + if (pid <= 0) { + char *file_name = xasprintf("%s/%s", ovs_rundir(), + "ovs-monitor-ipsec.pid"); + pid = read_pidfile(file_name); + free(file_name); + } + if (pid < 0) { VLOG_ERR("%s: IPsec requires the ovs-monitor-ipsec daemon", name);