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")) {
}
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);