[IPFilter] Assert if getprotobyname() problem (#977)

This commit is contained in:
Sukchan Lee 2021-05-07 10:47:10 +09:00
parent dc870cc839
commit 182a61dc0b
3 changed files with 10 additions and 2 deletions

View File

@ -3269,8 +3269,16 @@ add_proto0(ipfw_insn *cmd, char *av, u_char *protop)
proto = strtol(av, &ep, 10);
if (*ep != '\0' || proto <= 0) {
#if 0 /* modified by acetcom */
if ((pe = getprotobyname(av)) == NULL)
return NULL;
#else
if ((pe = getprotobyname(av)) == NULL) {
ogs_fatal("getprotobyname('%s') failed", av);
ogs_assert_if_reached();
return NULL;
}
#endif
proto = pe->p_proto;
}

View File

@ -29,6 +29,8 @@
* XXX The context is not restored after each line.
*/
#include "ogs-ipfw.h"
struct cmdline_opts {
/* boolean options: */
int do_value_as_ip; /* show table value as IP */

View File

@ -24,8 +24,6 @@
#endif
#endif
#include "ogs-ipfw.h"
#include "ipfw2.h"
#include "objs/include_e/netinet/ip_fw.h"