char *act, *arg;
char *saveptr = NULL;
bool drop = false;
+ int n_actions;
- for (act = strtok_r(str, ", \t\r\n", &saveptr); act;
- act = strtok_r(NULL, ", \t\r\n", &saveptr))
+ for (act = strtok_r(str, ", \t\r\n", &saveptr), n_actions = 0; act;
+ act = strtok_r(NULL, ", \t\r\n", &saveptr), n_actions++)
{
uint16_t port;
} else if (!strcasecmp(act, "drop")) {
/* A drop action in OpenFlow occurs by just not setting
* an action. */
- drop=true;
+ drop = true;
+ if (n_actions) {
+ ofp_fatal(0, "Drop actions must not be preceded by other "
+ "actions");
+ }
#ifdef SUPPORT_SNAT
} else if (!strcasecmp(act, "nat")) {
struct nx_action_snat *sa;