laforge has uploaded this change for review. ( 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(-)
git pull ssh://gerrit.osmocom.org:29418/dahdi-tools refs/changes/75/27275/1
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 = ???