summaryrefslogtreecommitdiff
path: root/trafgen.c
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2015-05-05 23:06:56 +0300
committerTobias Klauser <tklauser@distanz.ch>2015-05-06 09:05:47 +0200
commit096b043a8581ad43f030323a69b4e6c6e78530fa (patch)
tree99c488838fbce2ae93b107a6c43500a622c117b8 /trafgen.c
parentd8f6f8236b29ff573415d3730a66a4a39e2fb443 (diff)
sock: Fix capturing extra packets from other dev
Create PF_PACKET socket with proto=0 which does not setup packet handler and will not capture packets until bind() will be invoked. Also replaced pf_tx_socket by pf_socket as these funcs became the same, as proto arg is set to 0. Suggested-by: Daniel Borkmann <borkmann@iogearbox.net> Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen.c')
-rw-r--r--trafgen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/trafgen.c b/trafgen.c
index f981eaf..53320fe 100644
--- a/trafgen.c
+++ b/trafgen.c
@@ -822,7 +822,7 @@ static void main_loop(struct ctx *ctx, char *confname, bool slow,
fflush(stdout);
}
- sock = pf_tx_socket();
+ sock = pf_socket();
if (ctx->qdisc_path == false)
set_sock_qdisc_bypass(sock, ctx->verbose);