[Midnightbsd-cvs] src [11151] trunk/contrib/tcpdump: sync freebds cnages

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Tue Jun 26 20:45:59 EDT 2018


Revision: 11151
          http://svnweb.midnightbsd.org/src/?rev=11151
Author:   laffer1
Date:     2018-06-26 20:45:58 -0400 (Tue, 26 Jun 2018)
Log Message:
-----------
sync freebds cnages

Modified Paths:
--------------
    trunk/contrib/tcpdump/addrtoname.c
    trunk/contrib/tcpdump/ethertype.h
    trunk/contrib/tcpdump/extract.h
    trunk/contrib/tcpdump/ieee802_11_radio.h
    trunk/contrib/tcpdump/ipproto.h
    trunk/contrib/tcpdump/nfs.h
    trunk/contrib/tcpdump/nfsfh.h
    trunk/contrib/tcpdump/parsenfsfh.c
    trunk/contrib/tcpdump/pmap_prot.h
    trunk/contrib/tcpdump/ppp.h
    trunk/contrib/tcpdump/print-arp.c
    trunk/contrib/tcpdump/print-atalk.c
    trunk/contrib/tcpdump/print-atm.c
    trunk/contrib/tcpdump/print-bootp.c
    trunk/contrib/tcpdump/print-domain.c
    trunk/contrib/tcpdump/print-ether.c
    trunk/contrib/tcpdump/print-fddi.c
    trunk/contrib/tcpdump/print-fr.c
    trunk/contrib/tcpdump/print-icmp.c
    trunk/contrib/tcpdump/print-ip.c
    trunk/contrib/tcpdump/print-ip6.c
    trunk/contrib/tcpdump/print-ipx.c
    trunk/contrib/tcpdump/print-isoclns.c
    trunk/contrib/tcpdump/print-llc.c
    trunk/contrib/tcpdump/print-nfs.c
    trunk/contrib/tcpdump/print-ntp.c
    trunk/contrib/tcpdump/print-null.c
    trunk/contrib/tcpdump/print-pfsync.c
    trunk/contrib/tcpdump/print-pim.c
    trunk/contrib/tcpdump/print-ppp.c
    trunk/contrib/tcpdump/print-sl.c
    trunk/contrib/tcpdump/print-sunrpc.c
    trunk/contrib/tcpdump/print-token.c
    trunk/contrib/tcpdump/print-udp.c
    trunk/contrib/tcpdump/rpc_auth.h
    trunk/contrib/tcpdump/rpc_msg.h
    trunk/contrib/tcpdump/tcpdump.c
    trunk/contrib/tcpdump/token.h

Modified: trunk/contrib/tcpdump/addrtoname.c
===================================================================
--- trunk/contrib/tcpdump/addrtoname.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/addrtoname.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -21,7 +21,7 @@
  *  Internet, ethernet, port, and protocol string to address
  *  and address to string conversion routines
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/addrtoname.c 252283 2013-06-27 00:37:59Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/addrtoname.c 251158 2013-05-30 20:51:22Z delphij $
  */
 #ifndef lint
 static const char rcsid[] _U_ =

Modified: trunk/contrib/tcpdump/ethertype.h
===================================================================
--- trunk/contrib/tcpdump/ethertype.h	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/ethertype.h	2018-06-27 00:45:58 UTC (rev 11151)
@@ -19,7 +19,7 @@
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * @(#) $Header: /tcpdump/master/tcpdump/ethertype.h,v 1.30 2008-02-06 10:47:53 guy Exp $ (LBL)
- * $FreeBSD: release/9.2.0/contrib/tcpdump/ethertype.h 252283 2013-06-27 00:37:59Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/ethertype.h 251158 2013-05-30 20:51:22Z delphij $
  */
 
 /*

Modified: trunk/contrib/tcpdump/extract.h
===================================================================
--- trunk/contrib/tcpdump/extract.h	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/extract.h	2018-06-27 00:45:58 UTC (rev 11151)
@@ -51,14 +51,26 @@
 	u_int32_t	val;
 } __attribute__((packed)) unaligned_u_int32_t;
 
-#define EXTRACT_16BITS(p) \
-	((u_int16_t)ntohs(((const unaligned_u_int16_t *)(p))->val))
-#define EXTRACT_32BITS(p) \
-	((u_int32_t)ntohl(((const unaligned_u_int32_t *)(p))->val))
-#define EXTRACT_64BITS(p) \
-	((u_int64_t)(((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 0)->val)) << 32 | \
-		     ((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 1)->val)) << 0))
+static inline u_int16_t
+EXTRACT_16BITS(const void *p)
+{
+	return ((u_int16_t)ntohs(((const unaligned_u_int16_t *)(p))->val));
+}
 
+static inline u_int32_t
+EXTRACT_32BITS(const void *p)
+{
+	return ((u_int32_t)ntohl(((const unaligned_u_int32_t *)(p))->val));
+}
+
+static inline u_int64_t
+EXTRACT_64BITS(const void *p)
+{
+	return ((u_int64_t)(((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 0)->val)) << 32 | \
+		((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 1)->val)) << 0));
+
+}
+
 #else /* HAVE___ATTRIBUTE__ */
 /*
  * We don't have __attribute__, so do unaligned loads of big-endian
@@ -88,13 +100,26 @@
  * The processor natively handles unaligned loads, so we can just
  * cast the pointer and fetch through it.
  */
-#define EXTRACT_16BITS(p) \
-	((u_int16_t)ntohs(*(const u_int16_t *)(p)))
-#define EXTRACT_32BITS(p) \
-	((u_int32_t)ntohl(*(const u_int32_t *)(p)))
-#define EXTRACT_64BITS(p) \
-	((u_int64_t)(((u_int64_t)ntohl(*((const u_int32_t *)(p) + 0))) << 32 | \
-		     ((u_int64_t)ntohl(*((const u_int32_t *)(p) + 1))) << 0))
+static inline u_int16_t
+EXTRACT_16BITS(const void *p)
+{
+	return ((u_int16_t)ntohs(*(const u_int16_t *)(p)));
+}
+
+static inline u_int32_t
+EXTRACT_32BITS(const void *p)
+{
+	return ((u_int32_t)ntohl(*(const u_int32_t *)(p)));
+}
+
+static inline u_int64_t
+EXTRACT_64BITS(const void *p)
+{
+	return ((u_int64_t)(((u_int64_t)ntohl(*((const u_int32_t *)(p) + 0))) << 32 | \
+		((u_int64_t)ntohl(*((const u_int32_t *)(p) + 1))) << 0));
+
+}
+
 #endif /* LBL_ALIGN */
 
 #define EXTRACT_24BITS(p) \

Modified: trunk/contrib/tcpdump/ieee802_11_radio.h
===================================================================
--- trunk/contrib/tcpdump/ieee802_11_radio.h	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/ieee802_11_radio.h	2018-06-27 00:45:58 UTC (rev 11151)
@@ -1,4 +1,4 @@
-/* $FreeBSD: release/9.2.0/contrib/tcpdump/ieee802_11_radio.h 236192 2012-05-28 19:13:21Z delphij $ */
+/* $FreeBSD: stable/10/contrib/tcpdump/ieee802_11_radio.h 235530 2012-05-17 05:11:57Z delphij $ */
 /* NetBSD: ieee802_11_radio.h,v 1.2 2006/02/26 03:04:03 dyoung Exp  */
 /* $Header: /tcpdump/master/tcpdump/ieee802_11_radio.h,v 1.3 2007-08-29 02:31:44 mcr Exp $ */
 

Modified: trunk/contrib/tcpdump/ipproto.h
===================================================================
--- trunk/contrib/tcpdump/ipproto.h	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/ipproto.h	2018-06-27 00:45:58 UTC (rev 11151)
@@ -34,7 +34,7 @@
  *
  * From:
  *	@(#)in.h	8.3 (Berkeley) 1/3/94
- * $FreeBSD: release/9.2.0/contrib/tcpdump/ipproto.h 236192 2012-05-28 19:13:21Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/ipproto.h 235530 2012-05-17 05:11:57Z delphij $
  * FreeBSD: src/sys/netinet/in.h,v 1.38.2.3 1999/08/29 16:29:34 peter Exp
  */
 

Modified: trunk/contrib/tcpdump/nfs.h
===================================================================
--- trunk/contrib/tcpdump/nfs.h	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/nfs.h	2018-06-27 00:45:58 UTC (rev 11151)
@@ -36,7 +36,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/nfs.h 214478 2010-10-28 19:06:17Z rpaulo $
+ * $FreeBSD: stable/10/contrib/tcpdump/nfs.h 214478 2010-10-28 19:06:17Z rpaulo $
  *	@(#)nfsproto.h	8.2 (Berkeley) 3/30/95
  */
 

Modified: trunk/contrib/tcpdump/nfsfh.h
===================================================================
--- trunk/contrib/tcpdump/nfsfh.h	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/nfsfh.h	2018-06-27 00:45:58 UTC (rev 11151)
@@ -39,7 +39,7 @@
  * Jeffrey C. Mogul
  * Digital Equipment Corporation
  * Western Research Laboratory
- *	$FreeBSD: release/9.2.0/contrib/tcpdump/nfsfh.h 190207 2009-03-21 18:30:25Z rpaulo $
+ *	$FreeBSD: stable/10/contrib/tcpdump/nfsfh.h 190207 2009-03-21 18:30:25Z rpaulo $
  *	$NetBSD: nfsfh.h,v 1.1.1.2 1997/10/03 17:25:13 christos Exp $
  */
 

Modified: trunk/contrib/tcpdump/parsenfsfh.c
===================================================================
--- trunk/contrib/tcpdump/parsenfsfh.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/parsenfsfh.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -39,7 +39,7 @@
  * Digital Equipment Corporation
  * Western Research Laboratory
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/parsenfsfh.c 190207 2009-03-21 18:30:25Z rpaulo $
+ * $FreeBSD: stable/10/contrib/tcpdump/parsenfsfh.c 190207 2009-03-21 18:30:25Z rpaulo $
  */
 
 #ifndef lint

Modified: trunk/contrib/tcpdump/pmap_prot.h
===================================================================
--- trunk/contrib/tcpdump/pmap_prot.h	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/pmap_prot.h	2018-06-27 00:45:58 UTC (rev 11151)
@@ -29,7 +29,7 @@
  *
  *	from: @(#)pmap_prot.h 1.14 88/02/08 SMI
  *	from: @(#)pmap_prot.h	2.1 88/07/29 4.0 RPCSRC
- * $FreeBSD: release/9.2.0/contrib/tcpdump/pmap_prot.h 190207 2009-03-21 18:30:25Z rpaulo $
+ * $FreeBSD: stable/10/contrib/tcpdump/pmap_prot.h 190207 2009-03-21 18:30:25Z rpaulo $
  * FreeBSD: src/include/rpc/pmap_prot.h,v 1.9.2.1 1999/08/29 14:39:05 peter Exp
  */
 

Modified: trunk/contrib/tcpdump/ppp.h
===================================================================
--- trunk/contrib/tcpdump/ppp.h	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/ppp.h	2018-06-27 00:45:58 UTC (rev 11151)
@@ -15,7 +15,7 @@
  * suitability of this software for any purpose.  It is provided "as is"
  * without express or implied warranty.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/ppp.h 190207 2009-03-21 18:30:25Z rpaulo $
+ * $FreeBSD: stable/10/contrib/tcpdump/ppp.h 190207 2009-03-21 18:30:25Z rpaulo $
  */
 #define PPP_HDRLEN	4	/* length of PPP header */
 

Modified: trunk/contrib/tcpdump/print-arp.c
===================================================================
--- trunk/contrib/tcpdump/print-arp.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-arp.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-arp.c 236192 2012-05-28 19:13:21Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-arp.c 235530 2012-05-17 05:11:57Z delphij $
  */
 
 #ifndef lint

Modified: trunk/contrib/tcpdump/print-atalk.c
===================================================================
--- trunk/contrib/tcpdump/print-atalk.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-atalk.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -20,7 +20,7 @@
  *
  * Format and print AppleTalk packets.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-atalk.c 236192 2012-05-28 19:13:21Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-atalk.c 235530 2012-05-17 05:11:57Z delphij $
  */
 
 #ifndef lint

Modified: trunk/contrib/tcpdump/print-atm.c
===================================================================
--- trunk/contrib/tcpdump/print-atm.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-atm.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-atm.c 236192 2012-05-28 19:13:21Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-atm.c 235530 2012-05-17 05:11:57Z delphij $
  */
 #ifndef lint
 static const char rcsid[] _U_ =

Modified: trunk/contrib/tcpdump/print-bootp.c
===================================================================
--- trunk/contrib/tcpdump/print-bootp.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-bootp.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -20,7 +20,7 @@
  *
  * Format and print bootp packets.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-bootp.c 214478 2010-10-28 19:06:17Z rpaulo $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-bootp.c 214478 2010-10-28 19:06:17Z rpaulo $
  */
 #ifndef lint
 static const char rcsid[] _U_ =

Modified: trunk/contrib/tcpdump/print-domain.c
===================================================================
--- trunk/contrib/tcpdump/print-domain.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-domain.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-domain.c 252283 2013-06-27 00:37:59Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-domain.c 251158 2013-05-30 20:51:22Z delphij $
  */
 
 #ifndef lint

Modified: trunk/contrib/tcpdump/print-ether.c
===================================================================
--- trunk/contrib/tcpdump/print-ether.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-ether.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-ether.c 252283 2013-06-27 00:37:59Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-ether.c 251158 2013-05-30 20:51:22Z delphij $
  */
 #ifndef lint
 static const char rcsid[] _U_ =

Modified: trunk/contrib/tcpdump/print-fddi.c
===================================================================
--- trunk/contrib/tcpdump/print-fddi.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-fddi.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-fddi.c 190207 2009-03-21 18:30:25Z rpaulo $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-fddi.c 190207 2009-03-21 18:30:25Z rpaulo $
  */
 
 #ifndef lint

Modified: trunk/contrib/tcpdump/print-fr.c
===================================================================
--- trunk/contrib/tcpdump/print-fr.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-fr.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-fr.c 236192 2012-05-28 19:13:21Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-fr.c 235530 2012-05-17 05:11:57Z delphij $
  */
 
 #ifndef lint

Modified: trunk/contrib/tcpdump/print-icmp.c
===================================================================
--- trunk/contrib/tcpdump/print-icmp.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-icmp.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-icmp.c 236192 2012-05-28 19:13:21Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-icmp.c 235530 2012-05-17 05:11:57Z delphij $
  */
 
 #ifndef lint

Modified: trunk/contrib/tcpdump/print-ip.c
===================================================================
--- trunk/contrib/tcpdump/print-ip.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-ip.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-ip.c 252283 2013-06-27 00:37:59Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-ip.c 263086 2014-03-12 10:45:58Z glebius $
  */
 
 #ifndef lint
@@ -483,9 +483,11 @@
 		pgm_print(ipds->cp, ipds->len, (const u_char *)ipds->ip);
 		break;
 
+#if defined(HAVE_NET_PFVAR_H)
 	case IPPROTO_PFSYNC:
 		pfsync_ip_print(ipds->cp, ipds->len);
 		break;
+#endif
 
 	default:
 		if (ndo->ndo_nflag==0 && (proto = getprotobynumber(ipds->nh)) != NULL)

Modified: trunk/contrib/tcpdump/print-ip6.c
===================================================================
--- trunk/contrib/tcpdump/print-ip6.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-ip6.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-ip6.c 236192 2012-05-28 19:13:21Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-ip6.c 235530 2012-05-17 05:11:57Z delphij $
  */
 
 #ifndef lint

Modified: trunk/contrib/tcpdump/print-ipx.c
===================================================================
--- trunk/contrib/tcpdump/print-ipx.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-ipx.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -21,7 +21,7 @@
  * Format and print Novell IPX packets.
  * Contributed by Brad Parker (brad at fcr.com).
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-ipx.c 236192 2012-05-28 19:13:21Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-ipx.c 235530 2012-05-17 05:11:57Z delphij $
  */
 
 #ifndef lint

Modified: trunk/contrib/tcpdump/print-isoclns.c
===================================================================
--- trunk/contrib/tcpdump/print-isoclns.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-isoclns.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -23,7 +23,7 @@
  * Extensively modified by Hannes Gredler (hannes at juniper.net) for more
  * complete IS-IS & CLNP support.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-isoclns.c 252283 2013-06-27 00:37:59Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-isoclns.c 251158 2013-05-30 20:51:22Z delphij $
  */
 
 #ifndef lint

Modified: trunk/contrib/tcpdump/print-llc.c
===================================================================
--- trunk/contrib/tcpdump/print-llc.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-llc.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -21,7 +21,7 @@
  * Code by Matt Thomas, Digital Equipment Corporation
  *	with an awful lot of hacking by Jeffrey Mogul, DECWRL
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-llc.c 236192 2012-05-28 19:13:21Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-llc.c 235530 2012-05-17 05:11:57Z delphij $
  */
 
 #ifndef lint

Modified: trunk/contrib/tcpdump/print-nfs.c
===================================================================
--- trunk/contrib/tcpdump/print-nfs.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-nfs.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-nfs.c 214478 2010-10-28 19:06:17Z rpaulo $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-nfs.c 214478 2010-10-28 19:06:17Z rpaulo $
  */
 
 #ifndef lint

Modified: trunk/contrib/tcpdump/print-ntp.c
===================================================================
--- trunk/contrib/tcpdump/print-ntp.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-ntp.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -22,7 +22,7 @@
  *	By Jeffrey Mogul/DECWRL
  *	loosely based on print-bootp.c
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-ntp.c 252283 2013-06-27 00:37:59Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-ntp.c 251158 2013-05-30 20:51:22Z delphij $
  */
 
 #ifndef lint

Modified: trunk/contrib/tcpdump/print-null.c
===================================================================
--- trunk/contrib/tcpdump/print-null.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-null.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-null.c 236192 2012-05-28 19:13:21Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-null.c 235530 2012-05-17 05:11:57Z delphij $
  */
 
 #ifndef lint

Modified: trunk/contrib/tcpdump/print-pfsync.c
===================================================================
--- trunk/contrib/tcpdump/print-pfsync.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-pfsync.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -37,10 +37,10 @@
 
 #include <sys/endian.h>
 #include <net/if.h>
-#define	TCPSTATES
 #include <net/pfvar.h>	/* XXX */
 #include <net/if_pfsync.h>
 #include <netinet/ip.h>
+#define	TCPSTATES
 #include <netinet/tcp_fsm.h>
 
 #include <string.h>

Modified: trunk/contrib/tcpdump/print-pim.c
===================================================================
--- trunk/contrib/tcpdump/print-pim.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-pim.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-pim.c 242485 2012-11-02 16:57:51Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-pim.c 241235 2012-10-05 20:19:28Z delphij $
  */
 
 #ifndef lint

Modified: trunk/contrib/tcpdump/print-ppp.c
===================================================================
--- trunk/contrib/tcpdump/print-ppp.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-ppp.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -21,7 +21,7 @@
  * Extensively modified by Motonori Shindo (mshindo at mshindo.net) for more
  * complete PPP support.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-ppp.c 236192 2012-05-28 19:13:21Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-ppp.c 235530 2012-05-17 05:11:57Z delphij $
  */
 
 /*

Modified: trunk/contrib/tcpdump/print-sl.c
===================================================================
--- trunk/contrib/tcpdump/print-sl.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-sl.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-sl.c 236192 2012-05-28 19:13:21Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-sl.c 235530 2012-05-17 05:11:57Z delphij $
  */
 
 #ifndef lint

Modified: trunk/contrib/tcpdump/print-sunrpc.c
===================================================================
--- trunk/contrib/tcpdump/print-sunrpc.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-sunrpc.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-sunrpc.c 236192 2012-05-28 19:13:21Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-sunrpc.c 235530 2012-05-17 05:11:57Z delphij $
  */
 
 #ifndef lint

Modified: trunk/contrib/tcpdump/print-token.c
===================================================================
--- trunk/contrib/tcpdump/print-token.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-token.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -23,7 +23,7 @@
  * Further tweaked to more closely resemble print-fddi.c
  *	Guy Harris <guy at alum.mit.edu>
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-token.c 214478 2010-10-28 19:06:17Z rpaulo $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-token.c 214478 2010-10-28 19:06:17Z rpaulo $
  */
 #ifndef lint
 static const char rcsid[] _U_ =

Modified: trunk/contrib/tcpdump/print-udp.c
===================================================================
--- trunk/contrib/tcpdump/print-udp.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/print-udp.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/print-udp.c 252283 2013-06-27 00:37:59Z delphij $
+ * $FreeBSD: stable/10/contrib/tcpdump/print-udp.c 251158 2013-05-30 20:51:22Z delphij $
  */
 
 #ifndef lint

Modified: trunk/contrib/tcpdump/rpc_auth.h
===================================================================
--- trunk/contrib/tcpdump/rpc_auth.h	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/rpc_auth.h	2018-06-27 00:45:58 UTC (rev 11151)
@@ -29,7 +29,7 @@
  *
  *	from: @(#)auth.h 1.17 88/02/08 SMI
  *	from: @(#)auth.h	2.3 88/08/07 4.0 RPCSRC
- * $FreeBSD: release/9.2.0/contrib/tcpdump/rpc_auth.h 190207 2009-03-21 18:30:25Z rpaulo $
+ * $FreeBSD: stable/10/contrib/tcpdump/rpc_auth.h 190207 2009-03-21 18:30:25Z rpaulo $
  * FreeBSD: src/include/rpc/auth.h,v 1.14.2.1 1999/08/29 14:39:02 peter Exp
  */
 

Modified: trunk/contrib/tcpdump/rpc_msg.h
===================================================================
--- trunk/contrib/tcpdump/rpc_msg.h	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/rpc_msg.h	2018-06-27 00:45:58 UTC (rev 11151)
@@ -29,7 +29,7 @@
  *
  *	from: @(#)rpc_msg.h 1.7 86/07/16 SMI
  *	from: @(#)rpc_msg.h	2.1 88/07/29 4.0 RPCSRC
- * $FreeBSD: release/9.2.0/contrib/tcpdump/rpc_msg.h 190207 2009-03-21 18:30:25Z rpaulo $
+ * $FreeBSD: stable/10/contrib/tcpdump/rpc_msg.h 190207 2009-03-21 18:30:25Z rpaulo $
  * FreeBSD: src/include/rpc/rpc_msg.h,v 1.11.2.1 1999/08/29 14:39:07 peter Exp 
  */
 

Modified: trunk/contrib/tcpdump/tcpdump.c
===================================================================
--- trunk/contrib/tcpdump/tcpdump.c	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/tcpdump.c	2018-06-27 00:45:58 UTC (rev 11151)
@@ -33,7 +33,7 @@
     "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.283 2008-09-25 21:45:50 guy Exp $ (LBL)";
 #endif
 
-/* $FreeBSD: release/9.2.0/contrib/tcpdump/tcpdump.c 252283 2013-06-27 00:37:59Z delphij $ */
+/* $FreeBSD: stable/10/contrib/tcpdump/tcpdump.c 314560 2017-03-02 17:17:06Z emaste $ */
 
 /*
  * tcpdump - monitor tcp/ip traffic on an ethernet.
@@ -68,6 +68,15 @@
 #include <stdlib.h>
 #include <string.h>
 #include <limits.h>
+#ifdef __FreeBSD__
+#include <sys/capsicum.h>
+#include <sys/ioccom.h>
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#include <net/bpf.h>
+#include <fcntl.h>
+#include <libgen.h>
+#endif	/* __FreeBSD__ */
 #ifndef WIN32
 #include <sys/wait.h>
 #include <sys/resource.h>
@@ -384,6 +393,9 @@
 	char	*CurrentFileName;
 	pcap_t	*pd;
 	pcap_dumper_t *p;
+#ifdef __FreeBSD__
+	int	dirfd;
+#endif
 };
 
 #ifdef HAVE_PCAP_SET_TSTAMP_TYPE
@@ -672,6 +684,76 @@
 	return ret;
 }
 
+#ifdef __FreeBSD__
+/*
+ * Ensure that, on a dump file's descriptor, we have all the rights
+ * necessary to make the standard I/O library work with an fdopen()ed
+ * FILE * from that descriptor.
+ *
+ * A long time ago, in a galaxy far far away, AT&T decided that, instead
+ * of providing separate APIs for getting and setting the FD_ flags on a
+ * descriptor, getting and setting the O_ flags on a descriptor, and
+ * locking files, they'd throw them all into a kitchen-sink fcntl() call
+ * along the lines of ioctl(), the fact that ioctl() operations are
+ * largely specific to particular character devices but fcntl() operations
+ * are either generic to all descriptors or generic to all descriptors for
+ * regular files nonwithstanding.
+ *
+ * The Capsicum people decided that fine-grained control of descriptor
+ * operations was required, so that you need to grant permission for
+ * reading, writing, seeking, and fcntl-ing.  The latter, courtesy of
+ * AT&T's decision, means that "fcntl-ing" isn't a thing, but a motley
+ * collection of things, so there are *individual* fcntls for which
+ * permission needs to be granted.
+ *
+ * The FreeBSD standard I/O people implemented some optimizations that
+ * requires that the standard I/O routines be able to determine whether
+ * the descriptor for the FILE * is open append-only or not; as that
+ * descriptor could have come from an open() rather than an fopen(),
+ * that requires that it be able to do an F_GETFL fcntl() to read
+ * the O_ flags.
+ *
+ * Tcpdump uses ftell() to determine how much data has been written
+ * to a file in order to, when used with -C, determine when it's time
+ * to rotate capture files.  ftell() therefore needs to do an lseek()
+ * to find out the file offset and must, thanks to the aforementioned
+ * optimization, also know whether the descriptor is open append-only
+ * or not.
+ *
+ * The net result of all the above is that we need to grant CAP_SEEK,
+ * CAP_WRITE, and CAP_FCNTL with the CAP_FCNTL_GETFL subcapability.
+ *
+ * Perhaps this is the universe's way of saying that either
+ *
+ *	1) there needs to be an fopenat() call and a pcap_dump_openat() call
+ *	   using it, so that Capsicum-capable tcpdump wouldn't need to do
+ *	   an fdopen()
+ *
+ * or
+ *
+ *	2) there needs to be a cap_fdopen() call in the FreeBSD standard
+ *	   I/O library that knows what rights are needed by the standard
+ *	   I/O library, based on the open mode, and assigns them, perhaps
+ *	   with an additional argument indicating, for example, whether
+ *	   seeking should be allowed, so that tcpdump doesn't need to know
+ *	   what the standard I/O library happens to require this week.
+ */
+static void
+set_dumper_capsicum_rights(pcap_dumper_t *p)
+{
+	int fd = fileno(pcap_dump_file(p));
+	cap_rights_t rights;
+
+	cap_rights_init(&rights, CAP_SEEK, CAP_WRITE, CAP_FCNTL);
+	if (cap_rights_limit(fd, &rights) < 0 && errno != ENOSYS) {
+		error("unable to limit dump descriptor");
+	}
+	if (cap_fcntls_limit(fd, CAP_FCNTL_GETFL) < 0 && errno != ENOSYS) {
+		error("unable to limit dump descriptor fcntls");
+	}
+}
+#endif
+
 int
 main(int argc, char **argv)
 {
@@ -702,6 +784,11 @@
 #endif
 	int status;
 	FILE *VFile;
+#ifdef __FreeBSD__
+	cap_rights_t rights;
+	int cansandbox;
+#endif	/* __FreeBSD__ */
+
 #ifdef WIN32
 	if(wsockinit() != 0) return 1;
 #endif /* WIN32 */
@@ -1189,6 +1276,13 @@
 		pd = pcap_open_offline(RFileName, ebuf);
 		if (pd == NULL)
 			error("%s", ebuf);
+#ifdef __FreeBSD__
+		cap_rights_init(&rights, CAP_READ);
+		if (cap_rights_limit(fileno(pcap_file(pd)), &rights) < 0 &&
+		    errno != ENOSYS) {
+			error("unable to limit pcap descriptor");
+		}
+#endif
 		dlt = pcap_datalink(pd);
 		dlt_name = pcap_datalink_val_to_name(dlt);
 		if (dlt_name == NULL) {
@@ -1287,6 +1381,27 @@
 			         *cp != '\0')
 				error("%s: %s\n(%s)", device,
 				    pcap_statustostr(status), cp);
+#ifdef __FreeBSD__
+			else if (status == PCAP_ERROR_RFMON_NOTSUP &&
+			    strncmp(device, "wlan", 4) == 0) {
+				char parent[8], newdev[8];
+				char sysctl[32];
+				size_t s = sizeof(parent);
+
+				snprintf(sysctl, sizeof(sysctl),
+				    "net.wlan.%d.%%parent", atoi(device + 4));
+				sysctlbyname(sysctl, parent, &s, NULL, 0);
+				strlcpy(newdev, device, sizeof(newdev));
+				/* Suggest a new wlan device. */
+				newdev[strlen(newdev)-1]++;
+				error("%s is not a monitor mode VAP\n"
+				    "To create a new monitor mode VAP use:\n"
+				    "  ifconfig %s create wlandev %s wlanmode "
+				    "monitor\nand use %s as the tcpdump "
+				    "interface", device, newdev, parent,
+				    newdev);
+			}
+#endif
 			else
 				error("%s: %s", device,
 				    pcap_statustostr(status));
@@ -1437,6 +1552,26 @@
 
 	if (pcap_setfilter(pd, &fcode) < 0)
 		error("%s", pcap_geterr(pd));
+#ifdef __FreeBSD__
+	if (RFileName == NULL && VFileName == NULL) {
+		static const unsigned long cmds[] = { BIOCGSTATS, BIOCROTZBUF };
+
+		/*
+		 * The various libpcap devices use a combination of
+		 * read (bpf), ioctl (bpf, netmap), poll (netmap).
+		 * Grant the relevant access rights, sorted by name.
+		 */
+		cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ);
+		if (cap_rights_limit(pcap_fileno(pd), &rights) < 0 &&
+		    errno != ENOSYS) {
+			error("unable to limit pcap descriptor");
+		}
+		if (cap_ioctls_limit(pcap_fileno(pd), cmds,
+		    sizeof(cmds) / sizeof(cmds[0])) < 0 && errno != ENOSYS) {
+			error("unable to limit ioctls on pcap descriptor");
+		}
+	}
+#endif
 	if (WFileName) {
 		pcap_dumper_t *p;
 		/* Do not exceed the default PATH_MAX for files. */
@@ -1458,9 +1593,32 @@
 #endif
 		if (p == NULL)
 			error("%s", pcap_geterr(pd));
+#ifdef __FreeBSD__
+		set_dumper_capsicum_rights(p);
+#endif
 		if (Cflag != 0 || Gflag != 0) {
+#ifdef __FreeBSD__
+			dumpinfo.WFileName = strdup(basename(WFileName));
+			dumpinfo.dirfd = open(dirname(WFileName),
+			    O_DIRECTORY | O_RDONLY);
+			if (dumpinfo.dirfd < 0) {
+				error("unable to open directory %s",
+				    dirname(WFileName));
+			}
+			cap_rights_init(&rights, CAP_CREATE, CAP_FCNTL,
+			    CAP_FTRUNCATE, CAP_LOOKUP, CAP_SEEK, CAP_WRITE);
+			if (cap_rights_limit(dumpinfo.dirfd, &rights) < 0 &&
+			    errno != ENOSYS) {
+				error("unable to limit directory rights");
+			}
+			if (cap_fcntls_limit(fileno(pcap_dump_file(p)), CAP_FCNTL_GETFL) < 0 &&
+			    errno != ENOSYS) {
+				error("unable to limit dump descriptor fcntls");
+			}
+#else	/* !__FreeBSD__ */
+			dumpinfo.WFileName = WFileName;
+#endif
 			callback = dump_packet_and_trunc;
-			dumpinfo.WFileName = WFileName;
 			dumpinfo.pd = pd;
 			dumpinfo.p = p;
 			pcap_userdata = (u_char *)&dumpinfo;
@@ -1530,6 +1688,13 @@
 		(void)fflush(stderr);
 	}
 #endif /* WIN32 */
+
+#ifdef __FreeBSD__
+	cansandbox = (nflag && VFileName == NULL && zflag == NULL);
+	if (cansandbox && cap_enter() < 0 && errno != ENOSYS)
+		error("unable to enter the capability mode");
+#endif	/* __FreeBSD__ */
+
 	do {
 		status = pcap_loop(pd, cnt, callback, pcap_userdata);
 		if (WFileName == NULL) {
@@ -1569,6 +1734,13 @@
 				pd = pcap_open_offline(RFileName, ebuf);
 				if (pd == NULL)
 					error("%s", ebuf);
+#ifdef __FreeBSD__
+				cap_rights_init(&rights, CAP_READ);
+				if (cap_rights_limit(fileno(pcap_file(pd)),
+				    &rights) < 0 && errno != ENOSYS) {
+					error("unable to limit pcap descriptor");
+				}
+#endif
 				new_dlt = pcap_datalink(pd);
 				if (WFileName && new_dlt != dlt)
 					error("%s: new dlt does not match original", RFileName);
@@ -1765,6 +1937,11 @@
 
 		/* If the time is greater than the specified window, rotate */
 		if (t - Gflag_time >= Gflag) {
+#ifdef __FreeBSD__
+			FILE *fp;
+			int fd;
+#endif
+
 			/* Update the Gflag_time */
 			Gflag_time = t;
 			/* Update Gflag_count */
@@ -1811,7 +1988,23 @@
 			capng_update(CAPNG_ADD, CAPNG_EFFECTIVE, CAP_DAC_OVERRIDE);
 			capng_apply(CAPNG_EFFECTIVE);
 #endif /* HAVE_CAP_NG_H */
+#ifdef __FreeBSD__
+			fd = openat(dump_info->dirfd,
+			    dump_info->CurrentFileName,
+			    O_CREAT | O_WRONLY | O_TRUNC, 0644);
+			if (fd < 0) {
+				error("unable to open file %s",
+				    dump_info->CurrentFileName);
+			}
+			fp = fdopen(fd, "w");
+			if (fp == NULL) {
+				error("unable to fdopen file %s",
+				    dump_info->CurrentFileName);
+			}
+			dump_info->p = pcap_dump_fopen(dump_info->pd, fp);
+#else	/* !__FreeBSD__ */
 			dump_info->p = pcap_dump_open(dump_info->pd, dump_info->CurrentFileName);
+#endif
 #ifdef HAVE_CAP_NG_H
 			capng_update(CAPNG_DROP, CAPNG_EFFECTIVE, CAP_DAC_OVERRIDE);
 			capng_apply(CAPNG_EFFECTIVE);
@@ -1818,6 +2011,9 @@
 #endif /* HAVE_CAP_NG_H */
 			if (dump_info->p == NULL)
 				error("%s", pcap_geterr(pd));
+#ifdef __FreeBSD__
+			set_dumper_capsicum_rights(dump_info->p);
+#endif
 		}
 	}
 
@@ -1827,6 +2023,11 @@
 	 * file could put it over Cflag.
 	 */
 	if (Cflag != 0 && pcap_dump_ftell(dump_info->p) > Cflag) {
+#ifdef __FreeBSD__
+		FILE *fp;
+		int fd;
+#endif
+
 		/*
 		 * Close the current file and open a new one.
 		 */
@@ -1849,9 +2050,27 @@
 		if (dump_info->CurrentFileName == NULL)
 			error("dump_packet_and_trunc: malloc");
 		MakeFilename(dump_info->CurrentFileName, dump_info->WFileName, Cflag_count, WflagChars);
+#ifdef __FreeBSD__
+		fd = openat(dump_info->dirfd, dump_info->CurrentFileName,
+		    O_CREAT | O_WRONLY | O_TRUNC, 0644);
+		if (fd < 0) {
+			error("unable to open file %s",
+			    dump_info->CurrentFileName);
+		}
+		fp = fdopen(fd, "w");
+		if (fp == NULL) {
+			error("unable to fdopen file %s",
+			    dump_info->CurrentFileName);
+		}
+		dump_info->p = pcap_dump_fopen(dump_info->pd, fp);
+#else	/* !__FreeBSD__ */
 		dump_info->p = pcap_dump_open(dump_info->pd, dump_info->CurrentFileName);
+#endif
 		if (dump_info->p == NULL)
 			error("%s", pcap_geterr(pd));
+#ifdef __FreeBSD__
+		set_dumper_capsicum_rights(dump_info->p);
+#endif
 	}
 
 	pcap_dump((u_char *)dump_info->p, h, sp);

Modified: trunk/contrib/tcpdump/token.h
===================================================================
--- trunk/contrib/tcpdump/token.h	2018-06-27 00:44:15 UTC (rev 11150)
+++ trunk/contrib/tcpdump/token.h	2018-06-27 00:45:58 UTC (rev 11151)
@@ -25,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: release/9.2.0/contrib/tcpdump/token.h 214478 2010-10-28 19:06:17Z rpaulo $
+ * $FreeBSD: stable/10/contrib/tcpdump/token.h 214478 2010-10-28 19:06:17Z rpaulo $
  */
 
 #define TOKEN_HDRLEN		14



More information about the Midnightbsd-cvs mailing list