From f701899c64ddd0aaf5be852d1b76db01c4472ee8 Mon Sep 17 00:00:00 2001 From: ben64 Date: Thu, 10 Dec 2020 12:08:32 +0100 Subject: [PATCH 1/2] Fix command line for manual BPF --- etherpuppet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etherpuppet.c b/etherpuppet.c index a3c6b56..f957c8f 100644 --- a/etherpuppet.c +++ b/etherpuppet.c @@ -298,7 +298,7 @@ int main(int argc, char *argv[]) sigaddset(&sa.sa_mask, SIGINT); sa.sa_flags = SA_SIGINFO | SA_ONESHOT | SA_RESTART; - while ((c = getopt(argc, argv, "ms:c:i:I:hdBSMCvuU:")) != -1) { + while ((c = getopt(argc, argv, "ms:c:i:I:hdBSM:CvuU:")) != -1) { switch (c) { case 'v': version(); From 97b8bc1f576d843784096ba9f193fb17bd58a4f7 Mon Sep 17 00:00:00 2001 From: ben64 Date: Thu, 10 Dec 2020 16:35:55 +0100 Subject: [PATCH 2/2] Fix bad jump --- etherpuppet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etherpuppet.c b/etherpuppet.c index f957c8f..d159931 100644 --- a/etherpuppet.c +++ b/etherpuppet.c @@ -119,7 +119,7 @@ enum { struct sock_filter the_BPF[]= { { 0x28, 0, 0, 0x0000000c }, // 00: ldh [12] - { 0x15, 0, 14, 0x00000800 }, // 01: jeq #0x800 jt 2 jf 27 + { 0x15, 0, 25, 0x00000800 }, // 01: jeq #0x800 jt 2 jf 27 { 0x30, 0, 0, 0x00000017 }, // 02: ldb [23] { 0x15, 0, 11, 0x00000006 }, // 03: jeq #0x6 jt 4 jf 15 { 0x20, 0, 0, 0x0000001e }, // 04: ld [30]