1
0
Fork 0
mirror of https://passt.top/passt synced 2025-06-23 15:05:34 +02:00

Makefile, conf, passt: Drop passt4netns references, explicit argc check

Nobody currently calls this as passt4netns, that was the name I used
before 'pasta', drop any reference before it's too late.

While at it, explicitly check that argc is bigger than or equal to
one, just as a defensive measure: argv[0] being NULL is not an issue
anyway.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2022-02-17 01:41:28 +01:00
parent fb70301b13
commit ce4e7b4d5d
3 changed files with 15 additions and 13 deletions

View file

@ -322,16 +322,21 @@ int main(int argc, char **argv)
sigaction(SIGTERM, &sa, NULL);
sigaction(SIGQUIT, &sa, NULL);
if (strstr(argv[0], "pasta") || strstr(argv[0], "passt4netns")) {
if (argc < 1)
exit(EXIT_FAILURE);
if (strstr(argv[0], "pasta")) {
sa.sa_handler = pasta_child_handler;
sigaction(SIGCHLD, &sa, NULL);
signal(SIGPIPE, SIG_IGN);
c.mode = MODE_PASTA;
log_name = "pasta";
} else {
} else if (strstr(argv[0], "passt")) {
c.mode = MODE_PASST;
log_name = "passt";
} else {
exit(EXIT_FAILURE);
}
if (madvise(pkt_buf, TAP_BUF_BYTES, MADV_HUGEPAGE))