summaryrefslogtreecommitdiff
path: root/netsniff-ng.c
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2014-04-07 16:30:15 +0200
committerDaniel Borkmann <dborkman@redhat.com>2014-04-07 16:34:39 +0200
commit3bcd95bb1da97f00eb0e1d6e8d497911c14b4e44 (patch)
treef2e14c575116acdbdc167abc401e9478774fd057 /netsniff-ng.c
parentc10621e6fa8de50619d7dd28546dd3288f053ab8 (diff)
pcap_io: fill sll when reading pcap
When reading from a pcap in Kuznetsov/netsniff-ng format, we currently do not fill out sll. Do so so that users can see pkttype and the interface. Reported-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'netsniff-ng.c')
-rw-r--r--netsniff-ng.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/netsniff-ng.c b/netsniff-ng.c
index 351dcc9..6a83702 100644
--- a/netsniff-ng.c
+++ b/netsniff-ng.c
@@ -281,7 +281,7 @@ static void pcap_to_xmit(struct ctx *ctx)
!bpf_run_filter(&bpf_ops, out,
pcap_get_length(&phdr, ctx->magic)));
- pcap_pkthdr_to_tpacket_hdr(&phdr, ctx->magic, &hdr->tp_h);
+ pcap_pkthdr_to_tpacket_hdr(&phdr, ctx->magic, &hdr->tp_h, NULL);
ctx->tx_bytes += hdr->tp_h.tp_len;;
ctx->tx_packets++;
@@ -620,7 +620,7 @@ static void read_pcap(struct ctx *ctx)
!bpf_run_filter(&bpf_ops, out,
pcap_get_length(&phdr, ctx->magic)));
- pcap_pkthdr_to_tpacket_hdr(&phdr, ctx->magic, &fm.tp_h);
+ pcap_pkthdr_to_tpacket_hdr(&phdr, ctx->magic, &fm.tp_h, &fm.s_ll);
ctx->tx_bytes += fm.tp_h.tp_len;
ctx->tx_packets++;