summaryrefslogtreecommitdiff
path: root/print-sll.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-02-21 00:27:00 -0800
committerGuy Harris <guy@alum.mit.edu>2010-02-21 00:27:00 -0800
commite8b523758959c1854689d71c7a4686c631e5501c (patch)
tree67d50632c8f8f0410d2a8d227a78709a7aca1ca2 /print-sll.c
parentb00042a8ae3656f01e022bf6df1eb761e6323d3d (diff)
downloadtcpdump-e8b523758959c1854689d71c7a4686c631e5501c.tar.gz
Don't directly fetch multi-byte integers from packets.
Use the EXTRACT_ macros to extract multi-byte integral values from packets, rather than just dereferencing pointers into the packet; there is no guarantee that the packet data will be aligned on the right boundary, and there is no guarantee that, if they're not, a direct access will work correctly.
Diffstat (limited to 'print-sll.c')
-rw-r--r--print-sll.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/print-sll.c b/print-sll.c
index 0057ca21..8edf3b0e 100644
--- a/print-sll.c
+++ b/print-sll.c
@@ -142,7 +142,7 @@ sll_if_print(const struct pcap_pkthdr *h, const u_char *p)
caplen -= SLL_HDR_LEN;
p += SLL_HDR_LEN;
- ether_type = ntohs(sllp->sll_protocol);
+ ether_type = EXTRACT_16BITS(&sllp->sll_protocol);
/*
* Is it (gag) an 802.3 encapsulation, or some non-Ethernet