laforge has submitted this change. ( https://gerrit.osmocom.org/c/dahdi-tools/+/27275 )
Change subject: dahdi_pcap: Fix the use of the pkttype field
......................................................................
dahdi_pcap: Fix the use of the pkttype field
* pkttype is big-endian, so '3' is not valid, but htons(3)
* let's not use magic numbers but the actual #define PACKET_*
* differentiate PACKET_HOST (rx) from PACKET_OUTGOING (tx),
which makes wireshark properly show rx/tx packets, allows coloring
or filtering based on direction, etc.
Change-Id: I8c66a011a0fa0c5275bf3d5cf6b42064f02e28c0
---
M dahdi_pcap.c
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
manawyrm: Looks good to me, approved
diff --git a/dahdi_pcap.c b/dahdi_pcap.c
index 225fe78..0eadde3 100644
--- a/dahdi_pcap.c
+++ b/dahdi_pcap.c
@@ -41,6 +41,7 @@
#include <sys/ioctl.h>
#include <stdlib.h>
#include <getopt.h>
+#include <linux/if_packet.h>
#define BLOCK_SIZE 512
#define MAX_CHAN 16
@@ -161,7 +162,7 @@
hdr.caplen = res+sizeof(struct lapd_sll_hdr)-2;
hdr.len = res+sizeof(struct lapd_sll_hdr)-2;
- lapd->sll_pkttype = 3;
+ lapd->sll_pkttype = htons(is_read ? PACKET_HOST : PACKET_OUTGOING);
lapd->sll_hatype = 0;
lapd->sll_halen = htons(8);
// lapd->sll_addr = ???
--
To view, visit https://gerrit.osmocom.org/c/dahdi-tools/+/27275
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: dahdi-tools
Gerrit-Branch: master
Gerrit-Change-Id: I8c66a011a0fa0c5275bf3d5cf6b42064f02e28c0
Gerrit-Change-Number: 27275
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: manawyrm <osmocom.account(a)tbspace.de>
Gerrit-Reviewer: roox <mardnh(a)gmx.de>
Gerrit-MessageType: merged
Attention is currently required from: roox, laforge.
manawyrm has posted comments on this change. ( https://gerrit.osmocom.org/c/dahdi-tools/+/27275 )
Change subject: dahdi_pcap: Fix the use of the pkttype field
......................................................................
Patch Set 3: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/dahdi-tools/+/27275
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: dahdi-tools
Gerrit-Branch: master
Gerrit-Change-Id: I8c66a011a0fa0c5275bf3d5cf6b42064f02e28c0
Gerrit-Change-Number: 27275
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: manawyrm <osmocom.account(a)tbspace.de>
Gerrit-Reviewer: roox <mardnh(a)gmx.de>
Gerrit-Attention: roox <mardnh(a)gmx.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Mon, 21 Feb 2022 20:46:26 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment