From: Guy Harris Date: Sun, 24 Jun 2018 19:14:45 +0000 (-0700) Subject: Make sure DLT_ updates include LINKTYPE_ updates. X-Git-Tag: libpcap-1.9-bp~2 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/3367fed4b1ff7341966428e5e59674475729cc1c Make sure DLT_ updates include LINKTYPE_ updates. From a suggestion by mcr. --- diff --git a/pcap-common.c b/pcap-common.c index 7f2b81a3..7561fb3d 100644 --- a/pcap-common.c +++ b/pcap-common.c @@ -1083,6 +1083,15 @@ #define LINKTYPE_MATCHING_MAX 275 /* highest value in the "matching" range */ +/* + * The DLT_ and LINKTYPE_ values in the "matching" range should be the + * same, so DLT_MATCHING_MAX and LINKTYPE_MATCHING_MAX should be the + * same. + */ +#if LINKTYPE_MATCHING_MAX != DLT_MATCHING_MAX +#error The LINKTYPE_ matching range doesn't match the DLT_ matching range +#endif + static struct linktype_map { int dlt; int linktype;