char *tail;
uint32_t value;
- if (!str) {
+ if (!str[0]) {
ovs_fatal(0, "missing required numeric argument");
}
char *tail;
uint64_t value;
+ if (!str[0]) {
+ ovs_fatal(0, "missing required numeric argument");
+ }
+
errno = 0;
value = strtoull(str, &tail, 0);
if (errno == EINVAL || errno == ERANGE || *tail) {
pos = str;
n_actions = 0;
for (;;) {
+ char empty_string[] = "";
char *act, *arg;
size_t actlen;
uint16_t port;
pos = arg + arglen;
} else {
/* There might be no argument at all. */
- arg = NULL;
+ arg = empty_string;
pos = act + actlen + (act[actlen] != '\0');
}
act[actlen] = '\0';
nan->subtype = htons(NXAST_NOTE);
b->size -= sizeof nan->note;
- while (arg && *arg != '\0') {
+ while (*arg != '\0') {
uint8_t byte;
bool ok;
/* Unless a numeric argument is specified, we send the whole
* packet to the controller. */
- if (arg && (strspn(arg, "0123456789") == strlen(arg))) {
+ if (arg[0] && (strspn(arg, "0123456789") == strlen(arg))) {
oao->max_len = htons(str_to_u32(arg));
} else {
oao->max_len = htons(UINT16_MAX);
FIELD(F_ARP_SHA, "arp_sha", FWW_ARP_SHA) \
FIELD(F_ARP_THA, "arp_tha", FWW_ARP_THA) \
FIELD(F_IPV6_SRC, "ipv6_src", 0) \
- FIELD(F_IPV6_DST, "ipv6_dst", 0)
+ FIELD(F_IPV6_DST, "ipv6_dst", 0) \
+ FIELD(F_ND_TARGET, "nd_target", FWW_ND_TARGET) \
+ FIELD(F_ND_SLL, "nd_sll", FWW_ARP_SHA) \
+ FIELD(F_ND_TLL, "nd_tll", FWW_ARP_THA)
enum field_index {
#define FIELD(ENUM, NAME, WILDCARD) ENUM,
cls_rule_set_ipv6_dst_masked(rule, &ipv6, &ipv6_mask);
break;
+ case F_ND_TARGET:
+ str_to_ipv6(value, &ipv6, NULL);
+ cls_rule_set_nd_target(rule, ipv6);
+ break;
+
+ case F_ND_SLL:
+ str_to_mac(value, mac);
+ cls_rule_set_arp_sha(rule, mac);
+ break;
+
+ case F_ND_TLL:
+ str_to_mac(value, mac);
+ cls_rule_set_arp_tha(rule, mac);
+ break;
+
case N_FIELDS:
NOT_REACHED();
}
fsr->out_port = fm.out_port;
fsr->table_id = table_id;
}
-