Get DLT_MATCHING_MAX right in gencode.c on NetBSD.

Even though libpcap had DLT_MATCHING_MAX defined to 290 in its
"pcap/dlt.h" header, on NetBSD 9.1 gencode.c ended up with the value 275
from /usr/include/net/dlt.h (regardless if the libpcap package, which
defined it as 276 in /usr/pkg/include/pcap/dlt.h, was installed).

This made the current master branch of tcpdump compiled with the current
master branch of libpcap fail some tests, such as:

tcpdump: unknown data link type 284

Move the HAVE_NET_PFVAR_H block and add a comment. This solves the
problem on NetBSD and does not introduce any immediate regressions on
FreeBSD 13.0, Linux or Solaris 11.

(cherry picked from commit bb02779a37fdf815da58e8828eb4ce99a4f86580)
diff --git a/gencode.c b/gencode.c
index b8e5bf8..efdcb98 100644
--- a/gencode.c
+++ b/gencode.c
@@ -48,6 +48,20 @@
 #include "pcap-dos.h"
 #endif
 
+#ifdef HAVE_NET_PFVAR_H
+/*
+ * In NetBSD <net/if.h> includes <net/dlt.h>, which is an older version of
+ * "pcap/dlt.h" with a lower value of DLT_MATCHING_MAX. Include the headers
+ * below before "pcap-int.h", which eventually includes "pcap/dlt.h", which
+ * redefines DLT_MATCHING_MAX from what this version of NetBSD has to what
+ * this version of libpcap has.
+ */
+#include <sys/socket.h>
+#include <net/if.h>
+#include <net/pfvar.h>
+#include <net/if_pflog.h>
+#endif /* HAVE_NET_PFVAR_H */
+
 #include "pcap-int.h"
 
 #include "extract.h"
@@ -73,13 +87,6 @@
 #include <linux/filter.h>
 #endif
 
-#ifdef HAVE_NET_PFVAR_H
-#include <sys/socket.h>
-#include <net/if.h>
-#include <net/pfvar.h>
-#include <net/if_pflog.h>
-#endif
-
 #ifndef offsetof
 #define offsetof(s, e) ((size_t)&((s *)0)->e)
 #endif