aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2020-03-11 11:19:14 -0700
committerGuy Harris <guy@alum.mit.edu>2020-03-11 11:19:14 -0700
commit1e0fe43838e536bc71d19d7ef5e34b728a625c7b (patch)
tree52a66aa00d59b797dd5f54a9f136a06b570fa4ff
parent20a7221d81772a936912f302a859782b593866a5 (diff)
Fix the handling of LINKTYPE_ATM_CLIP.
It has to get mapped to DLT_ATM_CLIP, which does not have the same numerical value, even though LINKTYPE_ATM_CLIP is in the matching range.
-rw-r--r--pcap-common.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/pcap-common.c b/pcap-common.c
index 176c4ed9..d34b8b93 100644
--- a/pcap-common.c
+++ b/pcap-common.c
@@ -1319,11 +1319,20 @@ linktype_to_dlt(int linktype)
return (DLT_PKTAP);
/*
- * For all other values in the matching range, the LINKTYPE
- * value is the same as the DLT value.
+ * For all other values in the matching range, except for
+ * LINKTYPE_ATM_CLIP, the LINKTYPE value is the same as
+ * the DLT value.
+ *
+ * LINKTYPE_ATM_CLIP is a special case. DLT_ATM_CLIP is
+ * not on all platforms, but, so far, there don't appear
+ * to be any platforms that define it as anything other
+ * than 19; we define LINKTYPE_ATM_CLIP as something
+ * other than 19, just in case. That value is in the
+ * matching range, so we have to check for it.
*/
if (linktype >= LINKTYPE_MATCHING_MIN &&
- linktype <= LINKTYPE_MATCHING_MAX)
+ linktype <= LINKTYPE_MATCHING_MAX &&
+ linktype != LINKTYPE_ATM_CLIP)
return (linktype);
/*