static void parse_esp_spis(const char *spistring, u_int32_t *spis) { char *buffer; char *cp; buffer = strdup(spistring); if ((cp = strchr(buffer, ':')) == NULL) spis[0] = spis[1] = parse_esp_spi(buffer); else { *cp = '\0'; cp++; spis[0] = buffer[0] ? parse_esp_spi(buffer) : 0; spis[1] = cp[0] ? parse_esp_spi(cp) : 0xFFFFFFFF; } free(buffer); }
static void parse_esp_spis(const char *spistring, uint32_t *spis) { char *buffer; char *cp; buffer = strdup(spistring); if ((cp = strchr(buffer, ':')) == NULL) spis[0] = spis[1] = parse_esp_spi(buffer); else { *cp = '\0'; cp++; spis[0] = buffer[0] ? parse_esp_spi(buffer) : 0; spis[1] = cp[0] ? parse_esp_spi(cp) : 0xFFFFFFFF; if (spis[0] > spis[1]) xtables_error(PARAMETER_PROBLEM, "Invalid ESP spi range: %s", spistring); } free(buffer); }