CVS commit: src/external/bsd/tcpdump/dist

2021-05-30 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun May 30 21:48:42 UTC 2021

Modified Files:
src/external/bsd/tcpdump/dist: print-icmp6.c

Log Message:
Minimal change to suppress unaligned access errors on NetBSD/alpha; add
the UNALIGNED decoration to icmp6 related structures.

PR bin/56199.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/tcpdump/dist/print-icmp6.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/print-icmp6.c
diff -u src/external/bsd/tcpdump/dist/print-icmp6.c:1.13 src/external/bsd/tcpdump/dist/print-icmp6.c:1.14
--- src/external/bsd/tcpdump/dist/print-icmp6.c:1.13	Mon Feb 24 18:39:47 2020
+++ src/external/bsd/tcpdump/dist/print-icmp6.c	Sun May 30 21:48:42 2021
@@ -21,7 +21,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: print-icmp6.c,v 1.13 2020/02/24 18:39:47 kamil Exp $");
+__RCSID("$NetBSD: print-icmp6.c,v 1.14 2021/05/30 21:48:42 thorpej Exp $");
 #endif
 
 /* \summary: IPv6 Internet Control Message Protocol (ICMPv6) printer */
@@ -91,7 +91,7 @@ struct icmp6_hdr {
 		uint16_t	icmp6_un_data16[2]; /* type-specific field */
 		uint8_t		icmp6_un_data8[4];  /* type-specific field */
 	} icmp6_dataun;
-};
+} UNALIGNED;
 
 #define icmp6_data32	icmp6_dataun.icmp6_un_data32
 #define icmp6_data16	icmp6_dataun.icmp6_un_data16
@@ -183,7 +183,7 @@ struct icmp6_hdr {
 struct mld6_hdr {
 	struct icmp6_hdr	mld6_hdr;
 	struct in6_addr		mld6_addr; /* multicast address */
-};
+} UNALIGNED;
 
 #define mld6_type	mld6_hdr.icmp6_type
 #define mld6_code	mld6_hdr.icmp6_code
@@ -201,7 +201,7 @@ struct mld6_hdr {
 struct nd_router_solicit {	/* router solicitation */
 	struct icmp6_hdr 	nd_rs_hdr;
 	/* could be followed by options */
-};
+} UNALIGNED;
 
 #define nd_rs_type	nd_rs_hdr.icmp6_type
 #define nd_rs_code	nd_rs_hdr.icmp6_code
@@ -213,7 +213,7 @@ struct nd_router_advert {	/* router adve
 	uint32_t		nd_ra_reachable;	/* reachable time */
 	uint32_t		nd_ra_retransmit;	/* retransmit timer */
 	/* could be followed by options */
-};
+} UNALIGNED;
 
 #define nd_ra_type		nd_ra_hdr.icmp6_type
 #define nd_ra_code		nd_ra_hdr.icmp6_code
@@ -241,7 +241,7 @@ struct nd_neighbor_solicit {	/* neighbor
 	struct icmp6_hdr	nd_ns_hdr;
 	struct in6_addr		nd_ns_target;	/*target address */
 	/* could be followed by options */
-};
+} UNALIGNED;
 
 #define nd_ns_type		nd_ns_hdr.icmp6_type
 #define nd_ns_code		nd_ns_hdr.icmp6_code
@@ -252,7 +252,7 @@ struct nd_neighbor_advert {	/* neighbor 
 	struct icmp6_hdr	nd_na_hdr;
 	struct in6_addr		nd_na_target;	/* target address */
 	/* could be followed by options */
-};
+} UNALIGNED;
 
 #define nd_na_type		nd_na_hdr.icmp6_type
 #define nd_na_code		nd_na_hdr.icmp6_code
@@ -268,7 +268,7 @@ struct nd_redirect {		/* redirect */
 	struct in6_addr		nd_rd_target;	/* target address */
 	struct in6_addr		nd_rd_dst;	/* destination address */
 	/* could be followed by options */
-};
+} UNALIGNED;
 
 #define nd_rd_type		nd_rd_hdr.icmp6_type
 #define nd_rd_code		nd_rd_hdr.icmp6_code
@@ -301,7 +301,7 @@ struct nd_opt_prefix_info {	/* prefix in
 	nd_uint32_t		nd_opt_pi_preferred_time;
 	nd_uint32_t		nd_opt_pi_reserved2;
 	struct in6_addr	nd_opt_pi_prefix;
-};
+} UNALIGNED;
 
 #define ND_OPT_PI_FLAG_ONLINK		0x80
 #define ND_OPT_PI_FLAG_AUTO		0x40
@@ -313,14 +313,14 @@ struct nd_opt_rd_hdr { /* redire
 	uint16_t	nd_opt_rh_reserved1;
 	uint32_t	nd_opt_rh_reserved2;
 	/* followed by IP header and data */
-};
+} UNALIGNED;
 
 struct nd_opt_mtu {		/* MTU option */
 	uint8_t		nd_opt_mtu_type;
 	uint8_t		nd_opt_mtu_len;
 	uint16_t	nd_opt_mtu_reserved;
 	uint32_t	nd_opt_mtu_mtu;
-};
+} UNALIGNED;
 
 struct nd_opt_rdnss {		/* RDNSS RFC 6106 5.1 */
 	uint8_t		nd_opt_rdnss_type;
@@ -328,7 +328,7 @@ struct nd_opt_rdnss {		/* RDNSS RFC 6106
 	uint16_t	nd_opt_rdnss_reserved;
 	uint32_t	nd_opt_rdnss_lifetime;
 	struct in6_addr nd_opt_rdnss_addr[1];	/* variable-length */
-};
+} UNALIGNED;
 
 struct nd_opt_dnssl {		/* DNSSL RFC 6106 5.2 */
 	uint8_t  nd_opt_dnssl_type;
@@ -336,14 +336,14 @@ struct nd_opt_dnssl {		/* DNSSL RFC 6106
 	uint16_t nd_opt_dnssl_reserved;
 	uint32_t nd_opt_dnssl_lifetime;
 	/* followed by list of DNS search domains, variable-length */
-};
+} UNALIGNED;
 
 struct nd_opt_advinterval {	/* Advertisement interval option */
 	uint8_t		nd_opt_adv_type;
 	uint8_t		nd_opt_adv_len;
 	uint16_t	nd_opt_adv_reserved;
 	uint32_t	nd_opt_adv_interval;
-};
+} UNALIGNED;
 
 struct nd_opt_homeagent_info {	/* Home Agent info */
 	uint8_t		nd_opt_hai_type;
@@ -351,7 +351,7 @@ struct nd_opt_homeagent_info {	/* Home A
 	uint16_t	nd_opt_hai_reserved;
 	int16_t		nd_opt_hai_preference;
 	uint16_t	nd_opt_hai_lifetime;
-};
+} UNALIGNED;
 
 struct nd_opt_route_info {	/* route info */
 	uint8_t		nd_opt_rti_type;
@@ -360,7 +360,7 @@ struct nd_opt_route_info {	/* route info
 	uint8_t		nd_opt_rti_flags;
 	uint32_t	nd_opt_rti_lifetime;
 	/* prefix 

CVS commit: src/external/bsd/tcpdump/dist

2021-05-30 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun May 30 21:01:43 UTC 2021

Modified Files:
src/external/bsd/tcpdump/dist: print-icmp.c

Log Message:
Minimal change to suppress unaligned access errors on NetBSD/alpha; add
the UNALIGNED decoration to struct icmp.

PR bin/56199.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/tcpdump/dist/print-icmp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/print-icmp.c
diff -u src/external/bsd/tcpdump/dist/print-icmp.c:1.11 src/external/bsd/tcpdump/dist/print-icmp.c:1.12
--- src/external/bsd/tcpdump/dist/print-icmp.c:1.11	Mon Feb 24 18:39:47 2020
+++ src/external/bsd/tcpdump/dist/print-icmp.c	Sun May 30 21:01:43 2021
@@ -21,7 +21,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: print-icmp.c,v 1.11 2020/02/24 18:39:47 kamil Exp $");
+__RCSID("$NetBSD: print-icmp.c,v 1.12 2021/05/30 21:01:43 thorpej Exp $");
 #endif
 
 /* \summary: Internet Control Message Protocol (ICMP) printer */
@@ -89,7 +89,7 @@ struct icmp {
 #define	icmp_ip		icmp_dun.id_ip.idi_ip
 #define	icmp_mask	icmp_dun.id_mask
 #define	icmp_data	icmp_dun.id_data
-};
+} UNALIGNED;
 
 #define ICMP_MPLS_EXT_EXTRACT_VERSION(x) (((x)&0xf0)>>4)
 #define ICMP_MPLS_EXT_VERSION 2



CVS commit: src/external/bsd/tcpdump/dist

2020-02-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Feb 24 18:39:47 UTC 2020

Modified Files:
src/external/bsd/tcpdump/dist: print-ah.c print-bgp.c print-esp.c
print-icmp.c print-icmp6.c print-igmp.c print-m3ua.c print-msnlb.c
print-nfs.c print-ntp.c print-ospf6.c print-pgm.c print-rip.c
print-ripng.c print-sctp.c print-tcp.c print-timed.c print-tipc.c
print-udp.c print-wb.c

Log Message:
Use UNALIGNED_OK to disable unaligned pointer arithmetic checks in UBSan

Upstream fixed it differently by refactoring the code and the problem will
go away on upgrade to 5.0.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/tcpdump/dist/print-ah.c \
src/external/bsd/tcpdump/dist/print-timed.c
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/tcpdump/dist/print-bgp.c \
src/external/bsd/tcpdump/dist/print-esp.c \
src/external/bsd/tcpdump/dist/print-icmp.c
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/tcpdump/dist/print-icmp6.c
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/tcpdump/dist/print-igmp.c \
src/external/bsd/tcpdump/dist/print-ntp.c \
src/external/bsd/tcpdump/dist/print-rip.c \
src/external/bsd/tcpdump/dist/print-ripng.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/tcpdump/dist/print-m3ua.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/tcpdump/dist/print-msnlb.c \
src/external/bsd/tcpdump/dist/print-tipc.c
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/tcpdump/dist/print-nfs.c \
src/external/bsd/tcpdump/dist/print-ospf6.c \
src/external/bsd/tcpdump/dist/print-pgm.c \
src/external/bsd/tcpdump/dist/print-tcp.c \
src/external/bsd/tcpdump/dist/print-wb.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/tcpdump/dist/print-sctp.c \
src/external/bsd/tcpdump/dist/print-udp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/print-ah.c
diff -u src/external/bsd/tcpdump/dist/print-ah.c:1.6 src/external/bsd/tcpdump/dist/print-ah.c:1.7
--- src/external/bsd/tcpdump/dist/print-ah.c:1.6	Sun Feb  5 04:05:05 2017
+++ src/external/bsd/tcpdump/dist/print-ah.c	Mon Feb 24 18:39:47 2020
@@ -23,7 +23,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: print-ah.c,v 1.6 2017/02/05 04:05:05 spz Exp $");
+__RCSID("$NetBSD: print-ah.c,v 1.7 2020/02/24 18:39:47 kamil Exp $");
 #endif
 
 /* \summary: IPSEC Authentication Header printer */
@@ -39,6 +39,7 @@ __RCSID("$NetBSD: print-ah.c,v 1.6 2017/
 #include "netdissect.h"
 #include "extract.h"
 
+UNALIGNED_OK
 int
 ah_print(netdissect_options *ndo, register const u_char *bp)
 {
Index: src/external/bsd/tcpdump/dist/print-timed.c
diff -u src/external/bsd/tcpdump/dist/print-timed.c:1.6 src/external/bsd/tcpdump/dist/print-timed.c:1.7
--- src/external/bsd/tcpdump/dist/print-timed.c:1.6	Sun Feb  5 04:05:05 2017
+++ src/external/bsd/tcpdump/dist/print-timed.c	Mon Feb 24 18:39:47 2020
@@ -21,7 +21,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: print-timed.c,v 1.6 2017/02/05 04:05:05 spz Exp $");
+__RCSID("$NetBSD: print-timed.c,v 1.7 2020/02/24 18:39:47 kamil Exp $");
 #endif
 
 /* \summary: BSD time daemon protocol printer */
@@ -99,6 +99,7 @@ static const char *tsptype[TSPTYPENUMBER
   "DATE", "DATEREQ", "DATEACK", "TRACEON", "TRACEOFF", "MSITE", "MSITEREQ",
   "TEST", "SETDATE", "SETDATEREQ", "LOOP" };
 
+UNALIGNED_OK
 void
 timed_print(netdissect_options *ndo,
 register const u_char *bp)

Index: src/external/bsd/tcpdump/dist/print-bgp.c
diff -u src/external/bsd/tcpdump/dist/print-bgp.c:1.10 src/external/bsd/tcpdump/dist/print-bgp.c:1.11
--- src/external/bsd/tcpdump/dist/print-bgp.c:1.10	Tue Oct  1 16:06:16 2019
+++ src/external/bsd/tcpdump/dist/print-bgp.c	Mon Feb 24 18:39:47 2020
@@ -32,7 +32,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: print-bgp.c,v 1.10 2019/10/01 16:06:16 christos Exp $");
+__RCSID("$NetBSD: print-bgp.c,v 1.11 2020/02/24 18:39:47 kamil Exp $");
 #endif
 
 /* \summary: Border Gateway Protocol (BGP) printer */
@@ -921,6 +921,7 @@ static const struct tok bgp_multicast_vp
 { 0, NULL}
 };
 
+UNALIGNED_OK
 static int
 decode_multicast_vpn(netdissect_options *ndo,
  const u_char *pptr, char *buf, u_int buflen)
Index: src/external/bsd/tcpdump/dist/print-esp.c
diff -u src/external/bsd/tcpdump/dist/print-esp.c:1.10 src/external/bsd/tcpdump/dist/print-esp.c:1.11
--- src/external/bsd/tcpdump/dist/print-esp.c:1.10	Tue Oct  1 16:06:16 2019
+++ src/external/bsd/tcpdump/dist/print-esp.c	Mon Feb 24 18:39:47 2020
@@ -23,7 +23,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: print-esp.c,v 1.10 2019/10/01 16:06:16 christos Exp $");
+__RCSID("$NetBSD: print-esp.c,v 1.11 2020/02/24 18:39:47 kamil Exp $");
 #endif
 
 /* \summary: IPSEC Encapsulating Security Payload (ESP) printer */
@@ -654,6 +654,7 @@ void esp_print_decodesecret(netdissect_o
 
 #endif
 
+UNALIGNED_OK
 #ifdef HAVE_LIBCRYPTO
 USES_APPLE_DEPRECATED_API
 #endif

CVS commit: src/external/bsd/tcpdump/dist

2020-02-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Feb 24 16:19:35 UTC 2020

Modified Files:
src/external/bsd/tcpdump/dist: extract.h

Log Message:
Rearrange the code to make UNALIGNED_OK available for __NetBSD__


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/tcpdump/dist/extract.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/extract.h
diff -u src/external/bsd/tcpdump/dist/extract.h:1.8 src/external/bsd/tcpdump/dist/extract.h:1.9
--- src/external/bsd/tcpdump/dist/extract.h:1.8	Fri Sep  8 14:01:12 2017
+++ src/external/bsd/tcpdump/dist/extract.h	Mon Feb 24 16:19:35 2020
@@ -19,6 +19,37 @@
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
+
+/*
+ * If we have versions of GCC or Clang that support an __attribute__
+ * to say "if we're building with unsigned behavior sanitization,
+ * don't complain about undefined behavior in this function", we
+ * label these functions with that attribute - we *know* it's undefined
+ * in the C standard, but we *also* know it does what we want with
+ * the ISA we're targeting and the compiler we're using.
+ *
+ * For GCC 4.9.0 and later, we use __attribute__((no_sanitize_undefined));
+ * pre-5.0 GCC doesn't have __has_attribute, and I'm not sure whether
+ * GCC or Clang first had __attribute__((no_sanitize(XXX)).
+ *
+ * For Clang, we check for __attribute__((no_sanitize(XXX)) with
+ * __has_attribute, as there are versions of Clang that support
+ * __attribute__((no_sanitize("undefined")) but don't support
+ * __attribute__((no_sanitize_undefined)).
+ *
+ * We define this here, rather than in funcattrs.h, because we
+ * only want it used here, we don't want it to be broadly used.
+ * (Any printer will get this defined, but this should at least
+ * make it harder for people to find.)
+ */
+#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 409)
+#define UNALIGNED_OK	__attribute__((no_sanitize_undefined))
+#elif __has_attribute(no_sanitize)
+#define UNALIGNED_OK	__attribute__((no_sanitize("undefined")))
+#else
+#define UNALIGNED_OK
+#endif
+
 #ifdef __NetBSD__
 #include 
 
@@ -139,36 +170,6 @@ static inline uint64_t EXTRACT_LE_64BITS
  */
 #include "funcattrs.h"
 
-/*
- * If we have versions of GCC or Clang that support an __attribute__
- * to say "if we're building with unsigned behavior sanitization,
- * don't complain about undefined behavior in this function", we
- * label these functions with that attribute - we *know* it's undefined
- * in the C standard, but we *also* know it does what we want with
- * the ISA we're targeting and the compiler we're using.
- *
- * For GCC 4.9.0 and later, we use __attribute__((no_sanitize_undefined));
- * pre-5.0 GCC doesn't have __has_attribute, and I'm not sure whether
- * GCC or Clang first had __attribute__((no_sanitize(XXX)).
- *
- * For Clang, we check for __attribute__((no_sanitize(XXX)) with
- * __has_attribute, as there are versions of Clang that support
- * __attribute__((no_sanitize("undefined")) but don't support
- * __attribute__((no_sanitize_undefined)).
- *
- * We define this here, rather than in funcattrs.h, because we
- * only want it used here, we don't want it to be broadly used.
- * (Any printer will get this defined, but this should at least
- * make it harder for people to find.)
- */
-#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 409)
-#define UNALIGNED_OK	__attribute__((no_sanitize_undefined))
-#elif __has_attribute(no_sanitize)
-#define UNALIGNED_OK	__attribute__((no_sanitize("undefined")))
-#else
-#define UNALIGNED_OK
-#endif
-
 #ifdef LBL_ALIGN
 /*
  * The processor doesn't natively handle unaligned loads.



CVS commit: src/external/bsd/tcpdump/dist

2020-02-16 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Feb 16 22:38:28 UTC 2020

Modified Files:
src/external/bsd/tcpdump/dist: tcpdump.1.in

Log Message:
Fix comments to not break formatting.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/tcpdump/dist/tcpdump.1.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/tcpdump.1.in
diff -u src/external/bsd/tcpdump/dist/tcpdump.1.in:1.15 src/external/bsd/tcpdump/dist/tcpdump.1.in:1.16
--- src/external/bsd/tcpdump/dist/tcpdump.1.in:1.15	Sun Feb 16 22:20:31 2020
+++ src/external/bsd/tcpdump/dist/tcpdump.1.in	Sun Feb 16 22:38:28 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: tcpdump.1.in,v 1.15 2020/02/16 22:20:31 gutteridge Exp $
+.\"	$NetBSD: tcpdump.1.in,v 1.16 2020/02/16 22:38:28 uwe Exp $
 .\"
 .\" Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997
 .\"	The Regents of the University of California.  All rights reserved.
@@ -207,13 +207,13 @@ On platforms that support the SIGINFO si
 (including Mac OS X) and Digital/Tru64 UNIX, it will report those counts
 when it receives a SIGINFO signal (generated, for example, by typing
 your ``status'' character, typically control-T)
-\" , although on some
-\" platforms, such as Mac OS X, the ``status'' character is not set by
-\" default, so you must set it with
-\" .BR stty (1)
-\" in order to use it) and will continue capturing packets. On platforms that
-\" do not support the SIGINFO signal, the same can be achieved by using the
-\" SIGUSR1 signal.
+.\" , although on some
+.\" platforms, such as Mac OS X, the ``status'' character is not set by
+.\" default, so you must set it with
+.\" .BR stty (1)
+.\" in order to use it) and will continue capturing packets. On platforms that
+.\" do not support the SIGINFO signal, the same can be achieved by using the
+.\" SIGUSR1 signal.
 and will continue capturing packets.
 .LP
 Reading packets from a network interface may require that you have



CVS commit: src/external/bsd/tcpdump/dist

2020-02-16 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Sun Feb 16 22:20:31 UTC 2020

Modified Files:
src/external/bsd/tcpdump/dist: tcpdump.1.in

Log Message:
tcpdump.1.in: fix stray line from merge botch


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/tcpdump/dist/tcpdump.1.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/tcpdump.1.in
diff -u src/external/bsd/tcpdump/dist/tcpdump.1.in:1.14 src/external/bsd/tcpdump/dist/tcpdump.1.in:1.15
--- src/external/bsd/tcpdump/dist/tcpdump.1.in:1.14	Tue Oct  1 16:06:16 2019
+++ src/external/bsd/tcpdump/dist/tcpdump.1.in	Sun Feb 16 22:20:31 2020
@@ -1,4 +1,4 @@
-.\"	NetBSD: tcpdump.8,v 1.9 2003/03/31 00:18:17 perry Exp 
+.\"	$NetBSD: tcpdump.1.in,v 1.15 2020/02/16 22:20:31 gutteridge Exp $
 .\"
 .\" Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997
 .\"	The Regents of the University of California.  All rights reserved.
@@ -20,7 +20,7 @@
 .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 .\"
-.TH TCPDUMP 8  "2 February 2017"
+.TH TCPDUMP 8  "16 February 2020"
 .SH NAME
 tcpdump \- dump traffic on a network
 .SH SYNOPSIS
@@ -213,7 +213,7 @@ your ``status'' character, typically con
 \" .BR stty (1)
 \" in order to use it) and will continue capturing packets. On platforms that
 \" do not support the SIGINFO signal, the same can be achieved by using the
-SIGUSR1 signal.
+\" SIGUSR1 signal.
 and will continue capturing packets.
 .LP
 Reading packets from a network interface may require that you have



CVS commit: src/external/bsd/tcpdump/dist

2019-02-04 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Feb  5 07:27:47 UTC 2019

Modified Files:
src/external/bsd/tcpdump/dist: print-hncp.c

Log Message:
- pass correct size of buffer to snprintf() to avoid potential truncation


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/tcpdump/dist/print-hncp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/print-hncp.c
diff -u src/external/bsd/tcpdump/dist/print-hncp.c:1.4 src/external/bsd/tcpdump/dist/print-hncp.c:1.5
--- src/external/bsd/tcpdump/dist/print-hncp.c:1.4	Fri Sep  8 14:01:13 2017
+++ src/external/bsd/tcpdump/dist/print-hncp.c	Tue Feb  5 07:27:46 2019
@@ -28,7 +28,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: print-hncp.c,v 1.4 2017/09/08 14:01:13 christos Exp $");
+__RCSID("$NetBSD: print-hncp.c,v 1.5 2019/02/05 07:27:46 mrg Exp $");
 #endif
 
 /* \summary: Home Networking Control Protocol (HNCP) printer */
@@ -177,7 +177,7 @@ format_256(const u_char *data)
 static char buf[4][64+5];
 static int i = 0;
 i = (i + 1) % 4;
-snprintf(buf[i], 28, "%016" PRIx64 "%016" PRIx64 "%016" PRIx64 "%016" PRIx64,
+snprintf(buf[i], sizeof buf[i], "%016" PRIx64 "%016" PRIx64 "%016" PRIx64 "%016" PRIx64,
  EXTRACT_64BITS(data),
  EXTRACT_64BITS(data + 8),
  EXTRACT_64BITS(data + 16),



CVS commit: src/external/bsd/tcpdump/dist

2018-12-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 24 02:39:12 UTC 2018

Modified Files:
src/external/bsd/tcpdump/dist: tcpdump.c

Log Message:
make pcap_debug weak.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/tcpdump/dist/tcpdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/tcpdump.c
diff -u src/external/bsd/tcpdump/dist/tcpdump.c:1.16 src/external/bsd/tcpdump/dist/tcpdump.c:1.17
--- src/external/bsd/tcpdump/dist/tcpdump.c:1.16	Fri Sep  8 10:01:13 2017
+++ src/external/bsd/tcpdump/dist/tcpdump.c	Sun Dec 23 21:39:12 2018
@@ -30,7 +30,7 @@
 static const char copyright[] _U_ =
 "@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000\n\
 The Regents of the University of California.  All rights reserved.\n";
-__RCSID("$NetBSD: tcpdump.c,v 1.16 2017/09/08 14:01:13 christos Exp $");
+__RCSID("$NetBSD: tcpdump.c,v 1.17 2018/12/24 02:39:12 christos Exp $");
 #endif
 
 /*
@@ -261,9 +261,10 @@ static void
 pcap_set_parser_debug(int value)
 {
 #ifdef HAVE_PCAP_DEBUG
-	extern int pcap_debug;
+	extern int pcap_debug __weak;
 
-	pcap_debug = value;
+	if (_debug)
+		pcap_debug = value;
 #else /* HAVE_PCAP_DEBUG */
 	extern int yydebug;
 



CVS commit: src/external/bsd/tcpdump/dist

2017-01-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 30 13:15:43 UTC 2017

Modified Files:
src/external/bsd/tcpdump/dist: tcpdump.c

Log Message:
protect variable with the macro that uses it.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/tcpdump/dist/tcpdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/tcpdump.c
diff -u src/external/bsd/tcpdump/dist/tcpdump.c:1.13 src/external/bsd/tcpdump/dist/tcpdump.c:1.14
--- src/external/bsd/tcpdump/dist/tcpdump.c:1.13	Tue Jan 24 18:29:14 2017
+++ src/external/bsd/tcpdump/dist/tcpdump.c	Mon Jan 30 08:15:43 2017
@@ -30,7 +30,7 @@
 static const char copyright[] _U_ =
 "@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000\n\
 The Regents of the University of California.  All rights reserved.\n";
-__RCSID("$NetBSD: tcpdump.c,v 1.13 2017/01/24 23:29:14 christos Exp $");
+__RCSID("$NetBSD: tcpdump.c,v 1.14 2017/01/30 13:15:43 christos Exp $");
 #endif
 
 /*
@@ -195,6 +195,7 @@ RETSIGTYPE requestinfo(int);
 static void info(int);
 static u_int packets_captured;
 
+#ifdef HAVE_PCAP_FINDALLDEVS
 static const struct tok status_flags[] = {
 #ifdef PCAP_IF_UP
 	{ PCAP_IF_UP,   "Up"   },
@@ -205,6 +206,7 @@ static const struct tok status_flags[] =
 	{ PCAP_IF_LOOPBACK, "Loopback" },
 	{ 0, NULL }
 };
+#endif
 
 static pcap_t *pd;
 



CVS commit: src/external/bsd/tcpdump/dist

2017-01-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 25 14:46:16 UTC 2017

Modified Files:
src/external/bsd/tcpdump/dist: netdissect-stdinc.h

Log Message:
- don't use their ntoh{l,s}/hton{l,s} implementation
- fix their ntohl/htonl implementations to use unsigned int instead of
  unsigned long so they work on _LP64.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/tcpdump/dist/netdissect-stdinc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/netdissect-stdinc.h
diff -u src/external/bsd/tcpdump/dist/netdissect-stdinc.h:1.1.1.1 src/external/bsd/tcpdump/dist/netdissect-stdinc.h:1.2
--- src/external/bsd/tcpdump/dist/netdissect-stdinc.h:1.1.1.1	Tue Jan 24 16:33:38 2017
+++ src/external/bsd/tcpdump/dist/netdissect-stdinc.h	Wed Jan 25 09:46:16 2017
@@ -279,13 +279,13 @@ typedef char* caddr_t;
  * avoid the bswap instruction, as OS X only supports machines that
  * have it.)
  */
-#if defined(__GNUC__) && defined(__i386__) && !defined(__APPLE__) && !defined(__ntohl)
+#if defined(__GNUC__) && defined(__i386__) && !defined(__APPLE__) && !defined(__ntohl) && !defined(ntohl)
   #undef ntohl
   #undef ntohs
   #undef htonl
   #undef htons
 
-  static __inline__ unsigned long __ntohl (unsigned long x);
+  static __inline__ unsigned int __ntohl (unsigned int x);
   static __inline__ unsigned short __ntohs (unsigned short x);
 
   #define ntohl(x)  __ntohl(x)
@@ -293,7 +293,7 @@ typedef char* caddr_t;
   #define htonl(x)  __ntohl(x)
   #define htons(x)  __ntohs(x)
 
-  static __inline__ unsigned long __ntohl (unsigned long x)
+  static __inline__ unsigned int __ntohl (unsigned int x)
   {
 __asm__ ("xchgb %b0, %h0\n\t"   /* swap lower bytes  */
  "rorl  $16, %0\n\t"/* swap words*/



CVS commit: src/external/bsd/tcpdump/dist

2017-01-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jan 25 08:20:15 UTC 2017

Modified Files:
src/external/bsd/tcpdump/dist: print-ip.c

Log Message:
Add missing argument


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/tcpdump/dist/print-ip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/print-ip.c
diff -u src/external/bsd/tcpdump/dist/print-ip.c:1.9 src/external/bsd/tcpdump/dist/print-ip.c:1.10
--- src/external/bsd/tcpdump/dist/print-ip.c:1.9	Tue Jan 24 23:29:14 2017
+++ src/external/bsd/tcpdump/dist/print-ip.c	Wed Jan 25 08:20:15 2017
@@ -21,7 +21,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: print-ip.c,v 1.9 2017/01/24 23:29:14 christos Exp $");
+__RCSID("$NetBSD: print-ip.c,v 1.10 2017/01/25 08:20:15 martin Exp $");
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -483,7 +483,7 @@ again:
 		break;
 
 	case IPPROTO_PFSYNC:
-		pfsync_ip_print(ipds->cp, ipds->len, (const u_char *)ipds->ip);
+		pfsync_ip_print(ndo, ipds->cp, ipds->len, (const u_char *)ipds->ip);
 		break;
 
 	default:



CVS commit: src/external/bsd/tcpdump/dist

2017-01-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jan 25 08:14:07 UTC 2017

Modified Files:
src/external/bsd/tcpdump/dist: util-print.c

Log Message:
toupper() takes an unsigned char.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/tcpdump/dist/util-print.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/util-print.c
diff -u src/external/bsd/tcpdump/dist/util-print.c:1.2 src/external/bsd/tcpdump/dist/util-print.c:1.3
--- src/external/bsd/tcpdump/dist/util-print.c:1.2	Tue Jan 24 23:29:14 2017
+++ src/external/bsd/tcpdump/dist/util-print.c	Wed Jan 25 08:14:07 2017
@@ -37,7 +37,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: util-print.c,v 1.2 2017/01/24 23:29:14 christos Exp $");
+__RCSID("$NetBSD: util-print.c,v 1.3 2017/01/25 08:14:07 martin Exp $");
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -788,7 +788,7 @@ txtproto_print(netdissect_options *ndo, 
 
 	/* Capitalize the protocol name */
 	for (pnp = protoname; *pnp != '\0'; pnp++)
-		ND_PRINT((ndo, "%c", toupper(*pnp)));
+		ND_PRINT((ndo, "%c", toupper((unsigned char)*pnp)));
 
 	if (is_reqresp) {
 		/*



CVS commit: src/external/bsd/tcpdump/dist

2016-01-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 23 19:08:02 UTC 2016

Modified Files:
src/external/bsd/tcpdump/dist: print-pfsync.c

Log Message:
don't include 


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/tcpdump/dist/print-pfsync.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/print-pfsync.c
diff -u src/external/bsd/tcpdump/dist/print-pfsync.c:1.2 src/external/bsd/tcpdump/dist/print-pfsync.c:1.3
--- src/external/bsd/tcpdump/dist/print-pfsync.c:1.2	Wed Nov 19 22:05:03 2014
+++ src/external/bsd/tcpdump/dist/print-pfsync.c	Sat Jan 23 14:08:02 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: print-pfsync.c,v 1.2 2014/11/20 03:05:03 christos Exp $	*/
+/*	$NetBSD: print-pfsync.c,v 1.3 2016/01/23 19:08:02 christos Exp $	*/
 /*	$OpenBSD: print-pfsync.c,v 1.30 2007/05/31 04:16:26 mcbride Exp $	*/
 
 /*
@@ -31,9 +31,9 @@
 #ifndef lint
 #if 0
 static const char rcsid[] =
-"@(#) $Header: /cvsroot/src/external/bsd/tcpdump/dist/print-pfsync.c,v 1.2 2014/11/20 03:05:03 christos Exp $";
+"@(#) $Header: /cvsroot/src/external/bsd/tcpdump/dist/print-pfsync.c,v 1.3 2016/01/23 19:08:02 christos Exp $";
 #else
-__RCSID("$NetBSD: print-pfsync.c,v 1.2 2014/11/20 03:05:03 christos Exp $");
+__RCSID("$NetBSD: print-pfsync.c,v 1.3 2016/01/23 19:08:02 christos Exp $");
 #endif
 #endif
 
@@ -49,7 +49,6 @@ __RCSID("$NetBSD: print-pfsync.c,v 1.2 2
 #include 
 #include 
 #include 
-#include 
 
 #ifdef __STDC__
 struct rtentry;



CVS commit: src/external/bsd/tcpdump/dist

2015-12-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 25 04:50:21 UTC 2015

Modified Files:
src/external/bsd/tcpdump/dist: parsenfsfh.c

Log Message:
We stuck the generation number eons ago before the inode, so we broke
inode printing in nfs file handles.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/tcpdump/dist/parsenfsfh.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/parsenfsfh.c
diff -u src/external/bsd/tcpdump/dist/parsenfsfh.c:1.5 src/external/bsd/tcpdump/dist/parsenfsfh.c:1.6
--- src/external/bsd/tcpdump/dist/parsenfsfh.c:1.5	Wed Nov 19 22:05:03 2014
+++ src/external/bsd/tcpdump/dist/parsenfsfh.c	Thu Dec 24 23:50:21 2015
@@ -42,7 +42,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: parsenfsfh.c,v 1.5 2014/11/20 03:05:03 christos Exp $");
+__RCSID("$NetBSD: parsenfsfh.c,v 1.6 2015/12/25 04:50:21 christos Exp $");
 #endif
 
 #define NETDISSECT_REWORKED
@@ -81,6 +81,7 @@ __RCSID("$NetBSD: parsenfsfh.c,v 1.5 201
 #define	FHT_AIX32	10
 #define	FHT_HPUX9	11
 #define	FHT_BSD44	12
+#define	FHT_NETBSD	13
 
 #ifdef	ultrix
 /* Nasty hack to keep the Ultrix C compiler from emitting bogus warnings */
@@ -145,10 +146,12 @@ Parse_fh(register const unsigned char *f
 #if	defined(__osf__)
 	fhtype = FHT_DECOSF;
 #endif
-#if	defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) \
- || defined(__OpenBSD__)
+#if	defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
 	fhtype = FHT_BSD44;
 #endif
+#if	defined(__NetBSD__)
+	fhtype = FHT_NETBSD;
+#endif
 	}
 	/*
 	 * This is basically a big decision tree
@@ -200,7 +203,12 @@ Parse_fh(register const unsigned char *f
 		 * might be HP-UX (depends on their values for minor devs)
 		 */
 		if ((fhp[6] == 0) && (fhp[7] == 0)) {
-		fhtype = FHT_BSD44;
+		/* for ffs sizeof(ufid) == 16 bytes */
+		if ((fhp[8] == 0x10 && fhp[9] == 0x0) ||
+			(fhp[9] == 0x0 && fhp[9] == 0x10))
+			fhtype = FHT_NETBSD;
+		else
+			fhtype = FHT_BSD44;
 		}
 		/*XXX we probably only need to test of these two bytes */
 		else if ((fhp[21] == 0) && (fhp[23] == 0)) {
@@ -269,11 +277,19 @@ Parse_fh(register const unsigned char *f
 	break;
 
 	case FHT_BSD44:
+	case FHT_NETBSD:
 	fsidp->Fsid_dev.Minor = fhp[0];
 	fsidp->Fsid_dev.Major = fhp[1];
 	fsidp->fsid_code = 0;
 
-	*inop = make_uint32(fhp[15], fhp[14], fhp[13], fhp[12]);
+	/*
+	 * NetBSD puts the generation number before the inode; inode
+	 * is 64 bits, but only 32 are typically used; XXX endian issues?
+	 */
+	if (fhtype == FHT_NETBSD)
+		*inop = make_uint32(fhp[19], fhp[18], fhp[17], fhp[16]);
+	else
+		*inop = make_uint32(fhp[15], fhp[14], fhp[13], fhp[12]);
 
 	if (osnamep)
 		*osnamep = "BSD 4.4";



CVS commit: src/external/bsd/tcpdump/dist

2015-09-17 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Thu Sep 17 14:03:10 UTC 2015

Modified Files:
src/external/bsd/tcpdump/dist: tcpdump.c

Log Message:
PR/50248: re-apply src/external/bsd/tcpdump/dist/tcpdump.c rev.1.8.

> When running as root and wanting to write a file and not having CAPNG, don't
> drop privs, because we cannot open the file if we drop privs.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/tcpdump/dist/tcpdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/tcpdump.c
diff -u src/external/bsd/tcpdump/dist/tcpdump.c:1.11 src/external/bsd/tcpdump/dist/tcpdump.c:1.12
--- src/external/bsd/tcpdump/dist/tcpdump.c:1.11	Tue Mar 31 21:59:35 2015
+++ src/external/bsd/tcpdump/dist/tcpdump.c	Thu Sep 17 14:03:10 2015
@@ -30,7 +30,7 @@
 static const char copyright[] _U_ =
 "@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000\n\
 The Regents of the University of California.  All rights reserved.\n";
-__RCSID("$NetBSD: tcpdump.c,v 1.11 2015/03/31 21:59:35 christos Exp $");
+__RCSID("$NetBSD: tcpdump.c,v 1.12 2015/09/17 14:03:10 nonaka Exp $");
 #endif
 
 /*
@@ -1856,8 +1856,12 @@ main(int argc, char **argv)
 		}
 		capng_apply(CAPNG_SELECT_BOTH);
 #endif /* HAVE_LIBCAP_NG */
-		if (username || chroot_dir)
+		if (username || chroot_dir) {
+#ifndef HAVE_LIBCAP_NG
+			if (!WFileName)
+#endif
 			droproot(username, chroot_dir);
+		}
 	}
 #endif /* WIN32 */
 



CVS commit: src/external/bsd/tcpdump/dist

2015-04-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  4 18:53:51 UTC 2015

Modified Files:
src/external/bsd/tcpdump/dist: print-rpki-rtr.c

Log Message:
Apply commit fb6e5377f392555b8c725f66b8b701f0061a3695:
-Fix/add ND_TCHECK2 tests,
-Fix a buffer overflow,
-Remove a debug printf


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/bsd/tcpdump/dist/print-rpki-rtr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/print-rpki-rtr.c
diff -u src/external/bsd/tcpdump/dist/print-rpki-rtr.c:1.1.1.4 src/external/bsd/tcpdump/dist/print-rpki-rtr.c:1.2
--- src/external/bsd/tcpdump/dist/print-rpki-rtr.c:1.1.1.4	Tue Mar 31 17:45:48 2015
+++ src/external/bsd/tcpdump/dist/print-rpki-rtr.c	Sat Apr  4 14:53:51 2015
@@ -178,7 +178,7 @@ rpki_rtr_pdu_print (netdissect_options *
 pdu_header = (rpki_rtr_pdu *)tptr;
 pdu_type = pdu_header-pdu_type;
 pdu_len = EXTRACT_32BITS(pdu_header-length);
-ND_TCHECK2(tptr, pdu_len);
+ND_TCHECK2(*tptr, pdu_len);
 hexdump = FALSE;
 
 ND_PRINT((ndo, %sRPKI-RTRv%u, %s PDU (%u), length: %u,
@@ -255,6 +255,7 @@ rpki_rtr_pdu_print (netdissect_options *
 
 	pdu = (rpki_rtr_pdu_error_report *)tptr;
 	encapsulated_pdu_length = EXTRACT_32BITS(pdu-encapsulated_pdu_length);
+	ND_TCHECK2(*tptr, encapsulated_pdu_length);
 	tlen = pdu_len;
 
 	error_code = EXTRACT_16BITS(pdu-pdu_header.u.error_code);
@@ -287,10 +288,10 @@ rpki_rtr_pdu_print (netdissect_options *
 		tptr += 4;
 		tlen -= 4;
 	}
-printf(text_length: %u tlen %u\n, text_length, tlen);
+	ND_TCHECK2(*tptr, text_length);
 	if (text_length  (text_length = tlen )) {
 		memcpy(buf, tptr, min(sizeof(buf)-1, text_length));
-		buf[text_length] = '\0';
+		buf[min(sizeof(buf) - 1, text_length)] = '\0';
 		ND_PRINT((ndo, %sError text: %s, indent_string(indent+2), buf));
 	}
 	}
@@ -337,13 +338,13 @@ rpki_rtr_print(netdissect_options *ndo, 
 	pdu_header = (rpki_rtr_pdu *)tptr;
 pdu_type = pdu_header-pdu_type;
 pdu_len = EXTRACT_32BITS(pdu_header-length);
+	ND_TCHECK2(*tptr, pdu_len);
 
 /* infinite loop check */
 if (!pdu_type || !pdu_len) {
 break;
 }
 
-ND_TCHECK2(*tptr, pdu_len);
 if (tlen  pdu_len) {
 goto trunc;
 }



CVS commit: src/external/bsd/tcpdump/dist

2014-11-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 21 13:31:19 UTC 2014

Modified Files:
src/external/bsd/tcpdump/dist: tcpdump.c

Log Message:
kill the dropped privs info message


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/tcpdump/dist/tcpdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/tcpdump.c
diff -u src/external/bsd/tcpdump/dist/tcpdump.c:1.9 src/external/bsd/tcpdump/dist/tcpdump.c:1.10
--- src/external/bsd/tcpdump/dist/tcpdump.c:1.9	Wed Nov 19 22:05:03 2014
+++ src/external/bsd/tcpdump/dist/tcpdump.c	Fri Nov 21 08:31:19 2014
@@ -30,7 +30,7 @@
 static const char copyright[] _U_ =
 @(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000\n\
 The Regents of the University of California.  All rights reserved.\n;
-__RCSID($NetBSD: tcpdump.c,v 1.9 2014/11/20 03:05:03 christos Exp $);
+__RCSID($NetBSD: tcpdump.c,v 1.10 2014/11/21 13:31:19 christos Exp $);
 #endif
 
 /*
@@ -742,7 +742,7 @@ droproot(const char *username, const cha
 			fprintf(stderr, error : ret %d\n, ret);
 		}
 		else {
-			printf(dropped privs to %s\n, username);
+//			printf(dropped privs to %s\n, username);
 		}
 		/* We don't need CAP_SETUID and CAP_SETGID */
 		capng_update(CAPNG_DROP, CAPNG_EFFECTIVE, CAP_SETUID);
@@ -762,7 +762,7 @@ droproot(const char *username, const cha
 			exit(1);
 		}
 		else {
-			printf(dropped privs to %s\n, username);
+//			printf(dropped privs to %s\n, username);
 		}
 #endif /* HAVE_CAP_NG_H */
 	}



CVS commit: src/external/bsd/tcpdump/dist

2014-11-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Nov 20 04:51:18 UTC 2014

Modified Files:
src/external/bsd/tcpdump/dist: tcpdump-stdinc.h

Log Message:
l in ntohl is not long!


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/bsd/tcpdump/dist/tcpdump-stdinc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/tcpdump-stdinc.h
diff -u src/external/bsd/tcpdump/dist/tcpdump-stdinc.h:1.1.1.4 src/external/bsd/tcpdump/dist/tcpdump-stdinc.h:1.2
--- src/external/bsd/tcpdump/dist/tcpdump-stdinc.h:1.1.1.4	Wed Nov 19 20:30:53 2014
+++ src/external/bsd/tcpdump/dist/tcpdump-stdinc.h	Wed Nov 19 23:51:18 2014
@@ -259,7 +259,7 @@ typedef char* caddr_t;
   #undef htonl
   #undef htons
 
-  static __inline__ unsigned long __ntohl (unsigned long x);
+  static __inline__ unsigned int __ntohl (unsigned int x);
   static __inline__ unsigned short __ntohs (unsigned short x);
 
   #define ntohl(x)  __ntohl(x)
@@ -267,7 +267,7 @@ typedef char* caddr_t;
   #define htonl(x)  __ntohl(x)
   #define htons(x)  __ntohs(x)
 
-  static __inline__ unsigned long __ntohl (unsigned long x)
+  static __inline__ unsigned int __ntohl (unsigned int x)
   {
 __asm__ (xchgb %b0, %h0\n\t   /* swap lower bytes  */
  rorl  $16, %0\n\t/* swap words*/



CVS commit: src/external/bsd/tcpdump/dist

2014-08-13 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Aug 13 13:53:14 UTC 2014

Modified Files:
src/external/bsd/tcpdump/dist: tcpdump.1.in

Log Message:
Add missing TP so that -a is not hidden in the -A description.
From Anon Ymous.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/tcpdump/dist/tcpdump.1.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/tcpdump.1.in
diff -u src/external/bsd/tcpdump/dist/tcpdump.1.in:1.7 src/external/bsd/tcpdump/dist/tcpdump.1.in:1.8
--- src/external/bsd/tcpdump/dist/tcpdump.1.in:1.7	Tue Dec 31 17:33:31 2013
+++ src/external/bsd/tcpdump/dist/tcpdump.1.in	Wed Aug 13 13:53:14 2014
@@ -207,6 +207,7 @@ special privileges.
 .B \-A
 Print each packet (minus its link level header) in ASCII.  Handy for
 capturing web pages.
+.TP
 .B \-a
 Attempt to convert network and broadcast addresses to names.
 .TP



CVS commit: src/external/bsd/tcpdump/dist

2014-05-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 13 20:29:59 UTC 2014

Modified Files:
src/external/bsd/tcpdump/dist: tcpdump.c

Log Message:
When running as root and wanting to write a file and not having CAPNG, don't
drop privs, because we cannot open the file if we drop privs.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/tcpdump/dist/tcpdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/tcpdump.c
diff -u src/external/bsd/tcpdump/dist/tcpdump.c:1.7 src/external/bsd/tcpdump/dist/tcpdump.c:1.8
--- src/external/bsd/tcpdump/dist/tcpdump.c:1.7	Tue Dec 31 12:33:31 2013
+++ src/external/bsd/tcpdump/dist/tcpdump.c	Tue May 13 16:29:59 2014
@@ -34,7 +34,7 @@ The Regents of the University of Califor
 static const char rcsid[] _U_ =
 @(#) Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.283 2008-09-25 21:45:50 guy Exp  (LBL);
 #else
-__RCSID($NetBSD: tcpdump.c,v 1.7 2013/12/31 17:33:31 christos Exp $);
+__RCSID($NetBSD: tcpdump.c,v 1.8 2014/05/13 20:29:59 christos Exp $);
 #endif
 #endif
 
@@ -1482,8 +1482,12 @@ main(int argc, char **argv)
 #endif /* HAVE_CAP_NG_H */
 
 	if (getuid() == 0 || geteuid() == 0) {
-		if (username || chroot_dir)
+		if (username || chroot_dir) {
+#ifndef HAVE_CAP_NG_H
+			if (!WFileName)
+#endif
 			droproot(username, chroot_dir);
+		}
 
 	}
 #endif /* WIN32 */



CVS commit: src/external/bsd/tcpdump/dist

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 02:58:24 UTC 2013

Modified Files:
src/external/bsd/tcpdump/dist: addrtoname.c

Log Message:
fix type punned issue


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/tcpdump/dist/addrtoname.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/addrtoname.c
diff -u src/external/bsd/tcpdump/dist/addrtoname.c:1.3 src/external/bsd/tcpdump/dist/addrtoname.c:1.4
--- src/external/bsd/tcpdump/dist/addrtoname.c:1.3	Sat Apr  6 15:33:07 2013
+++ src/external/bsd/tcpdump/dist/addrtoname.c	Sat Oct 19 22:58:24 2013
@@ -27,7 +27,7 @@
 static const char rcsid[] _U_ =
 @(#) Header: /tcpdump/master/tcpdump/addrtoname.c,v 1.119 2007-08-08 14:06:34 hannes Exp  (LBL);
 #endif
-__RCSID($NetBSD: addrtoname.c,v 1.3 2013/04/06 19:33:07 christos Exp $);
+__RCSID($NetBSD: addrtoname.c,v 1.4 2013/10/20 02:58:24 christos Exp $);
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -281,9 +281,11 @@ getname6(const u_char *ap)
 	static struct h6namemem *p;		/* static for longjmp() */
 	register const char *cp;
 	char ntop_buf[INET6_ADDRSTRLEN];
+	uint16_t h;
 
 	memcpy(addr, ap, sizeof(addr));
-	p = h6nametable[*(u_int16_t *)addr.s6_addr[14]  (HASHNAMESIZE-1)];
+	memcpy(h, addr.s6_addr[14], sizeof(h));
+	p = h6nametable[h  (HASHNAMESIZE-1)];
 	for (; p-nxt; p = p-nxt) {
 		if (memcmp(p-addr, addr, sizeof(addr)) == 0)
 			return (p-name);



CVS commit: src/external/bsd/tcpdump/dist

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 02:58:34 UTC 2013

Modified Files:
src/external/bsd/tcpdump/dist: print-esp.c print-icmp6.c print-isakmp.c
print-pgm.c print-pim.c print-sctp.c

Log Message:
remove unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/tcpdump/dist/print-esp.c \
src/external/bsd/tcpdump/dist/print-pgm.c \
src/external/bsd/tcpdump/dist/print-pim.c \
src/external/bsd/tcpdump/dist/print-sctp.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/tcpdump/dist/print-icmp6.c \
src/external/bsd/tcpdump/dist/print-isakmp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/print-esp.c
diff -u src/external/bsd/tcpdump/dist/print-esp.c:1.3 src/external/bsd/tcpdump/dist/print-esp.c:1.4
--- src/external/bsd/tcpdump/dist/print-esp.c:1.3	Sat Apr  6 15:33:08 2013
+++ src/external/bsd/tcpdump/dist/print-esp.c	Sat Oct 19 22:58:34 2013
@@ -27,7 +27,7 @@
 static const char rcsid[] _U_ =
 @(#) Header: /tcpdump/master/tcpdump/print-esp.c,v 1.58 2007-12-07 00:03:07 mcr Exp  (LBL);
 #else
-__RCSID($NetBSD: print-esp.c,v 1.3 2013/04/06 19:33:08 christos Exp $);
+__RCSID($NetBSD: print-esp.c,v 1.4 2013/10/20 02:58:34 christos Exp $);
 #endif
 #endif
 
@@ -221,7 +221,6 @@ static int
 espprint_decode_encalgo(netdissect_options *ndo,
 			char *decode, struct sa_list *sa)
 {
-	int len;
 	size_t i;
 	const EVP_CIPHER *evp;
 	int authlen = 0;
@@ -234,7 +233,6 @@ espprint_decode_encalgo(netdissect_optio
 	}
 	*colon = '\0';
 	
-	len = colon - decode;
 	if (strlen(decode)  strlen(-hmac96) 
 	!strcmp(decode + strlen(decode) - strlen(-hmac96),
 		-hmac96)) {
@@ -540,7 +538,6 @@ esp_print(netdissect_options *ndo,
 #ifdef HAVE_LIBCRYPTO
 	struct ip *ip;
 	struct sa_list *sa = NULL;
-	int espsecret_keylen;
 #ifdef INET6
 	struct ip6_hdr *ip6 = NULL;
 #endif
@@ -551,7 +548,6 @@ esp_print(netdissect_options *ndo,
 	u_char *ivoff;
 	u_char *p;
 	EVP_CIPHER_CTX ctx;
-	int blocksz;
 #endif
 
 	esp = (struct newesp *)bp;
@@ -655,7 +651,6 @@ esp_print(netdissect_options *ndo,
 	ivoff = (u_char *)(esp + 1) + 0;
 	ivlen = sa-ivlen;
 	secret = sa-secret;
-	espsecret_keylen = sa-secretlen;
 	ep = ep - sa-authlen;
 
 	if (sa-evp) {
@@ -663,7 +658,7 @@ esp_print(netdissect_options *ndo,
 		if (EVP_CipherInit(ctx, sa-evp, secret, NULL, 0)  0)
 			(*ndo-ndo_warning)(ndo, espkey init failed);
 
-		blocksz = EVP_CIPHER_CTX_block_size(ctx);
+		(void)EVP_CIPHER_CTX_block_size(ctx);
 
 		p = ivoff;
 		EVP_CipherInit(ctx, NULL, NULL, p, 0);
Index: src/external/bsd/tcpdump/dist/print-pgm.c
diff -u src/external/bsd/tcpdump/dist/print-pgm.c:1.3 src/external/bsd/tcpdump/dist/print-pgm.c:1.4
--- src/external/bsd/tcpdump/dist/print-pgm.c:1.3	Sat Apr  6 15:33:08 2013
+++ src/external/bsd/tcpdump/dist/print-pgm.c	Sat Oct 19 22:58:34 2013
@@ -19,7 +19,7 @@
 static const char rcsid[] _U_ =
 @(#) Header: /tcpdump/master/tcpdump/print-pgm.c,v 1.5 2005-06-07 22:05:58 guy Exp ;
 #else
-__RCSID($NetBSD: print-pgm.c,v 1.3 2013/04/06 19:33:08 christos Exp $);
+__RCSID($NetBSD: print-pgm.c,v 1.4 2013/10/20 02:58:34 christos Exp $);
 #endif
 #endif
 
@@ -176,7 +176,7 @@ pgm_print(register const u_char *bp, reg
 #else
 	char nla_buf[INET_ADDRSTRLEN];
 #endif
-	u_int8_t opt_type, opt_len, flags1, flags2;
+	u_int8_t opt_type, opt_len;
 	u_int32_t seq, opts_len, len, offset;
 
 	pgm = (struct pgm_header *)bp;
@@ -550,8 +550,7 @@ pgm_print(register const u_char *bp, reg
 			(void)printf([Bad OPT_FRAGMENT option, length %u != 16], opt_len);
 			return;
 		}
-		flags1 = *bp++;
-		flags2 = *bp++;
+		bp += 2;	/* skip flags */
 		seq = EXTRACT_32BITS(bp);
 		bp += sizeof(u_int32_t);
 		offset = EXTRACT_32BITS(bp);
@@ -563,8 +562,7 @@ pgm_print(register const u_char *bp, reg
 		break;
 
 		case PGM_OPT_NAK_LIST:
-		flags1 = *bp++;
-		flags2 = *bp++;
+		bp += 2;	/* skip flags */
 		opt_len -= sizeof(u_int32_t);	/* option header */
 		(void)printf( NAK LIST);
 		while (opt_len) {
@@ -585,8 +583,7 @@ pgm_print(register const u_char *bp, reg
 			(void)printf([Bad OPT_JOIN option, length %u != 8], opt_len);
 			return;
 		}
-		flags1 = *bp++;
-		flags2 = *bp++;
+		bp += 2;	/* skip flags */
 		seq = EXTRACT_32BITS(bp);
 		bp += sizeof(u_int32_t);
 		(void)printf( JOIN %u, seq);
@@ -598,8 +595,7 @@ pgm_print(register const u_char *bp, reg
 			(void)printf([Bad OPT_NAK_BO_IVL option, length %u != 12], opt_len);
 			return;
 		}
-		flags1 = *bp++;
-		flags2 = *bp++;
+		bp += 2;	/* skip flags */
 		offset = EXTRACT_32BITS(bp);
 		bp += sizeof(u_int32_t);
 		seq = EXTRACT_32BITS(bp);
@@ -613,8 +609,7 @@ pgm_print(register const u_char *bp, reg
 			(void)printf([Bad OPT_NAK_BO_RNG option, length %u != 12], opt_len);
 			return;
 		}
-		

CVS commit: src/external/bsd/tcpdump/dist

2013-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 12 23:51:51 UTC 2013

Modified Files:
src/external/bsd/tcpdump/dist: print-ip.c tcpdump.c

Log Message:
move droproot after we have dealt with input and output files.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/tcpdump/dist/print-ip.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/tcpdump/dist/tcpdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/print-ip.c
diff -u src/external/bsd/tcpdump/dist/print-ip.c:1.3 src/external/bsd/tcpdump/dist/print-ip.c:1.4
--- src/external/bsd/tcpdump/dist/print-ip.c:1.3	Sat Apr  6 15:33:08 2013
+++ src/external/bsd/tcpdump/dist/print-ip.c	Fri Apr 12 19:51:50 2013
@@ -25,7 +25,7 @@
 static const char rcsid[] _U_ =
 @(#) Header: /tcpdump/master/tcpdump/print-ip.c,v 1.159 2007-09-14 01:29:28 guy Exp  (LBL);
 #else
-__RCSID($NetBSD: print-ip.c,v 1.3 2013/04/06 19:33:08 christos Exp $);
+__RCSID($NetBSD: print-ip.c,v 1.4 2013/04/12 23:51:50 christos Exp $);
 #endif
 #endif
 
@@ -491,6 +491,7 @@ again:
 		break;
 
 	default:
+		fprintf(stderr, : %d %d\n, ndo-ndo_nflag, ipds-nh);
 		if (ndo-ndo_nflag==0  (proto = getprotobynumber(ipds-nh)) != NULL)
 			ND_PRINT((ndo,  %s, proto-p_name));
 		else

Index: src/external/bsd/tcpdump/dist/tcpdump.c
diff -u src/external/bsd/tcpdump/dist/tcpdump.c:1.5 src/external/bsd/tcpdump/dist/tcpdump.c:1.6
--- src/external/bsd/tcpdump/dist/tcpdump.c:1.5	Sun Apr  7 15:17:11 2013
+++ src/external/bsd/tcpdump/dist/tcpdump.c	Fri Apr 12 19:51:50 2013
@@ -34,7 +34,7 @@ The Regents of the University of Califor
 static const char rcsid[] _U_ =
 @(#) Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.283 2008-09-25 21:45:50 guy Exp  (LBL);
 #else
-__RCSID($NetBSD: tcpdump.c,v 1.5 2013/04/07 19:17:11 christos Exp $);
+__RCSID($NetBSD: tcpdump.c,v 1.6 2013/04/12 23:51:50 christos Exp $);
 #endif
 #endif
 
@@ -1295,29 +1295,6 @@ main(int argc, char **argv)
 		(void)setsignal(SIGHUP, oldhandler);
 #endif /* WIN32 */
 
-#ifndef WIN32
-	/*
-	 * If a user name was specified with -Z, attempt to switch to
-	 * that user's UID.  This would probably be used with sudo,
-	 * to allow tcpdump to be run in a special restricted
-	 * account (if you just want to allow users to open capture
-	 * devices, and can't just give users that permission,
-	 * you'd make tcpdump set-UID or set-GID).
-	 *
-	 * Tcpdump doesn't necessarily write only to one savefile;
-	 * the general only way to allow a -Z instance to write to
-	 * savefiles as the user under whose UID it's run, rather
-	 * than as the user specified with -Z, would thus be to switch
-	 * to the original user ID before opening a capture file and
-	 * then switch back to the -Z user ID after opening the savefile.
-	 * Switching to the -Z user ID only after opening the first
-	 * savefile doesn't handle the general case.
-	 */
-	if (getuid() == 0 || geteuid() == 0) {
-		if (username || chroot_dir)
-			droproot(username, chroot_dir);
-	}
-#endif /* WIN32 */
 
 	if (pcap_setfilter(pd, fcode)  0)
 		error(%s, pcap_geterr(pd));
@@ -1421,6 +1398,28 @@ main(int argc, char **argv)
 		}
 		(void)fflush(stderr);
 	}
+
+	/*
+	 * If a user name was specified with -Z, attempt to switch to
+	 * that user's UID.  This would probably be used with sudo,
+	 * to allow tcpdump to be run in a special restricted
+	 * account (if you just want to allow users to open capture
+	 * devices, and can't just give users that permission,
+	 * you'd make tcpdump set-UID or set-GID).
+	 *
+	 * Tcpdump doesn't necessarily write only to one savefile;
+	 * the general only way to allow a -Z instance to write to
+	 * savefiles as the user under whose UID it's run, rather
+	 * than as the user specified with -Z, would thus be to switch
+	 * to the original user ID before opening a capture file and
+	 * then switch back to the -Z user ID after opening the savefile.
+	 * Switching to the -Z user ID only after opening the first
+	 * savefile doesn't handle the general case.
+	 */
+	if (getuid() == 0 || geteuid() == 0) {
+		if (username || chroot_dir)
+			droproot(username, chroot_dir);
+	}
 #endif /* WIN32 */
 	status = pcap_loop(pd, cnt, callback, pcap_userdata);
 	if (WFileName == NULL) {



CVS commit: src/external/bsd/tcpdump/dist

2013-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 13 02:08:59 UTC 2013

Modified Files:
src/external/bsd/tcpdump/dist: print-ip.c

Log Message:
remove debugging accidentally committed.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/tcpdump/dist/print-ip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/print-ip.c
diff -u src/external/bsd/tcpdump/dist/print-ip.c:1.4 src/external/bsd/tcpdump/dist/print-ip.c:1.5
--- src/external/bsd/tcpdump/dist/print-ip.c:1.4	Fri Apr 12 19:51:50 2013
+++ src/external/bsd/tcpdump/dist/print-ip.c	Fri Apr 12 22:08:59 2013
@@ -25,7 +25,7 @@
 static const char rcsid[] _U_ =
 @(#) Header: /tcpdump/master/tcpdump/print-ip.c,v 1.159 2007-09-14 01:29:28 guy Exp  (LBL);
 #else
-__RCSID($NetBSD: print-ip.c,v 1.4 2013/04/12 23:51:50 christos Exp $);
+__RCSID($NetBSD: print-ip.c,v 1.5 2013/04/13 02:08:59 christos Exp $);
 #endif
 #endif
 
@@ -491,7 +491,6 @@ again:
 		break;
 
 	default:
-		fprintf(stderr, : %d %d\n, ndo-ndo_nflag, ipds-nh);
 		if (ndo-ndo_nflag==0  (proto = getprotobynumber(ipds-nh)) != NULL)
 			ND_PRINT((ndo,  %s, proto-p_name));
 		else



CVS commit: src/external/bsd/tcpdump/dist

2013-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr  7 19:17:11 UTC 2013

Modified Files:
src/external/bsd/tcpdump/dist: tcpdump.c

Log Message:
- the initgroups function needs to be able to do name to gid translations,
  so do it before the chroot, otherwise we lose /etc/nsswitch.conf and
  /etc/group
- run res_init() so that we prime and initialize the resolver before the
  chroot, since our chroot lacks /etc/{{nsswitch,resolve}.conf,hosts}
  this is not portable behavior, but it is a lot better than populating
  the chroot with crap.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/tcpdump/dist/tcpdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/tcpdump.c
diff -u src/external/bsd/tcpdump/dist/tcpdump.c:1.4 src/external/bsd/tcpdump/dist/tcpdump.c:1.5
--- src/external/bsd/tcpdump/dist/tcpdump.c:1.4	Sat Apr  6 15:33:09 2013
+++ src/external/bsd/tcpdump/dist/tcpdump.c	Sun Apr  7 15:17:11 2013
@@ -34,7 +34,7 @@ The Regents of the University of Califor
 static const char rcsid[] _U_ =
 @(#) Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.283 2008-09-25 21:45:50 guy Exp  (LBL);
 #else
-__RCSID($NetBSD: tcpdump.c,v 1.4 2013/04/06 19:33:09 christos Exp $);
+__RCSID($NetBSD: tcpdump.c,v 1.5 2013/04/07 19:17:11 christos Exp $);
 #endif
 #endif
 
@@ -71,6 +71,7 @@ extern int SIZE_BUF;
 #include stdlib.h
 #include string.h
 #include limits.h
+#include resolv.h
 #ifndef WIN32
 #include sys/wait.h
 #include sys/resource.h
@@ -533,17 +534,25 @@ droproot(const char *username, const cha
 	
 	pw = getpwnam(username);
 	if (pw) {
+		if (initgroups(pw-pw_name, pw-pw_gid) != 0) {
+			fprintf(stderr, tcpdump: Couldn't initgroups to 
+			'%.32s' gid=%lu: %s\n, pw-pw_name,
+			(unsigned long)pw-pw_gid,
+			pcap_strerror(errno));
+			exit(1);
+		}
 		if (chroot_dir) {
 			setprotoent(1);
+			res_init();
 			if (chroot(chroot_dir) != 0 || chdir (/) != 0) {
 fprintf(stderr, tcpdump: Couldn't chroot/chdir to '%.64s': %s\n,
 chroot_dir, pcap_strerror(errno));
 exit(1);
 			}
 		}
-		if (initgroups(pw-pw_name, pw-pw_gid) != 0 ||
-		setgid(pw-pw_gid) != 0 || setuid(pw-pw_uid) != 0) {
-			fprintf(stderr, tcpdump: Couldn't change to '%.32s' uid=%lu gid=%lu: %s\n,
+		if (setgid(pw-pw_gid) != 0 || setuid(pw-pw_uid) != 0) {
+			fprintf(stderr, tcpdump: Couldn't change to 
+			'%.32s' uid=%lu gid=%lu: %s\n,
 			username, 
 			(unsigned long)pw-pw_uid,
 			(unsigned long)pw-pw_gid,



CVS commit: src/external/bsd/tcpdump/dist

2011-12-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 27 15:12:45 UTC 2011

Modified Files:
src/external/bsd/tcpdump/dist: print-icmp6.c

Log Message:
PR/45747: Henning Petersen: Fix icmp6 verbose printing.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/tcpdump/dist/print-icmp6.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/print-icmp6.c
diff -u src/external/bsd/tcpdump/dist/print-icmp6.c:1.2 src/external/bsd/tcpdump/dist/print-icmp6.c:1.3
--- src/external/bsd/tcpdump/dist/print-icmp6.c:1.2	Sun Dec  5 00:11:30 2010
+++ src/external/bsd/tcpdump/dist/print-icmp6.c	Tue Dec 27 10:12:45 2011
@@ -25,7 +25,7 @@
 static const char rcsid[] _U_ =
 @(#) Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.86 2008-02-05 19:36:13 guy Exp;
 #else
-__RCSID($NetBSD: print-icmp6.c,v 1.2 2010/12/05 05:11:30 christos Exp $);
+__RCSID($NetBSD: print-icmp6.c,v 1.3 2011/12/27 15:12:45 christos Exp $);
 #endif
 #endif
 
@@ -355,15 +355,20 @@ icmp6_print(netdissect_options *ndo,
 printf(ICMP6, %s, tok2str(icmp6_type_values,unknown icmp6 type (%u),dp-icmp6_type));
 
 /* display cosmetics: print the packet length for printer that use the vflag now */
-if (vflag  (dp-icmp6_type ==
-  ND_ROUTER_SOLICIT ||
-  ND_ROUTER_ADVERT ||
-  ND_NEIGHBOR_ADVERT ||
-  ND_NEIGHBOR_SOLICIT ||
-  ND_REDIRECT ||
-  ICMP6_HADISCOV_REPLY ||
-  ICMP6_MOBILEPREFIX_ADVERT ))
-printf(, length %u, length);
+if (vflag)
+		switch (dp-icmp6_type) {
+		case ND_ROUTER_SOLICIT:
+		case ND_ROUTER_ADVERT:
+		case ND_NEIGHBOR_ADVERT:
+		case ND_NEIGHBOR_SOLICIT:
+		case ND_REDIRECT:
+		case ICMP6_HADISCOV_REPLY:
+		case ICMP6_MOBILEPREFIX_ADVERT:
+			printf(, length %u, length);
+			break;
+		default:
+			break;
+		}
   
 	switch (dp-icmp6_type) {
 	case ICMP6_DST_UNREACH:



CVS commit: src/external/bsd/tcpdump/dist

2011-11-16 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Nov 17 02:41:55 UTC 2011

Modified Files:
src/external/bsd/tcpdump/dist: tcpdump.1.in

Log Message:
Replace section number with actual one as we did in see also list.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/tcpdump/dist/tcpdump.1.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/tcpdump.1.in
diff -u src/external/bsd/tcpdump/dist/tcpdump.1.in:1.4 src/external/bsd/tcpdump/dist/tcpdump.1.in:1.5
--- src/external/bsd/tcpdump/dist/tcpdump.1.in:1.4	Fri Dec 17 10:35:10 2010
+++ src/external/bsd/tcpdump/dist/tcpdump.1.in	Thu Nov 17 02:41:55 2011
@@ -1,6 +1,6 @@
 .\ @(#) Header: /tcpdump/master/tcpdump/tcpdump.1.in,v 1.2 2008-11-09 23:35:03 mcr Exp (LBL)
 .\
-.\	$NetBSD: tcpdump.1.in,v 1.4 2010/12/17 10:35:10 wiz Exp $
+.\	$NetBSD: tcpdump.1.in,v 1.5 2011/11/17 02:41:55 enami Exp $
 .\
 .\ Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997
 .\	The Regents of the University of California.  All rights reserved.
@@ -184,7 +184,7 @@ and will continue capturing packets.
 .LP
 Reading packets from a network interface may require that you have
 special privileges; see the
-.B pcap (3PCAP)
+.B pcap (3)
 man page for details.  Reading a saved packet file doesn't require
 special privileges.
 .SH OPTIONS
@@ -539,7 +539,7 @@ them out.
 They can later be printed with the \-r option.
 Standard output is used if \fIfile\fR is ``-''.
 See
-.BR pcap-savefile (@MAN_FILE_FORMATS@)
+.BR pcap-savefile (5)
 for a description of the file format.
 .TP
 .B \-W
@@ -638,7 +638,7 @@ Otherwise,
 only packets for which \fIexpression\fP is `true' will be dumped.
 .LP
 For the \fIexpression\fP syntax, see
-.BR pcap-filter (@MAN_MISC_INFO@).
+.BR pcap-filter (7).
 .LP
 Expression arguments can be passed to \fItcpdump\fP as either a single
 argument or as multiple arguments, whichever is more convenient.



CVS commit: src/external/bsd/tcpdump/dist

2011-04-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr 17 11:45:40 UTC 2011

Modified Files:
src/external/bsd/tcpdump/dist: tcpdump.c

Log Message:
Hint from dsl: make sure to have the /etc/protocols file already open
before doing a chroot() if run as root. Easily done by a setprotoent(1)
call. This is a better (less intrusive) fix for PR bin/44721.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/tcpdump/dist/tcpdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/tcpdump.c
diff -u src/external/bsd/tcpdump/dist/tcpdump.c:1.2 src/external/bsd/tcpdump/dist/tcpdump.c:1.3
--- src/external/bsd/tcpdump/dist/tcpdump.c:1.2	Sun Dec  5 05:11:31 2010
+++ src/external/bsd/tcpdump/dist/tcpdump.c	Sun Apr 17 11:45:40 2011
@@ -34,7 +34,7 @@
 static const char rcsid[] _U_ =
 @(#) Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.283 2008-09-25 21:45:50 guy Exp (LBL);
 #else
-__RCSID($NetBSD: tcpdump.c,v 1.2 2010/12/05 05:11:31 christos Exp $);
+__RCSID($NetBSD: tcpdump.c,v 1.3 2011/04/17 11:45:40 martin Exp $);
 #endif
 #endif
 
@@ -469,6 +469,7 @@
 	pw = getpwnam(username);
 	if (pw) {
 		if (chroot_dir) {
+			setprotoent(1);
 			if (chroot(chroot_dir) != 0 || chdir (/) != 0) {
 fprintf(stderr, tcpdump: Couldn't chroot/chdir to '%.64s': %s\n,
 chroot_dir, pcap_strerror(errno));



CVS commit: src/external/bsd/tcpdump/dist

2010-12-17 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Dec 17 10:35:10 UTC 2010

Modified Files:
src/external/bsd/tcpdump/dist: tcpdump.1.in

Log Message:
Bump date for chroot default.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/tcpdump/dist/tcpdump.1.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/tcpdump/dist/tcpdump.1.in
diff -u src/external/bsd/tcpdump/dist/tcpdump.1.in:1.3 src/external/bsd/tcpdump/dist/tcpdump.1.in:1.4
--- src/external/bsd/tcpdump/dist/tcpdump.1.in:1.3	Fri Dec 17 09:54:28 2010
+++ src/external/bsd/tcpdump/dist/tcpdump.1.in	Fri Dec 17 10:35:10 2010
@@ -1,6 +1,6 @@
 .\ @(#) Header: /tcpdump/master/tcpdump/tcpdump.1.in,v 1.2 2008-11-09 23:35:03 mcr Exp (LBL)
 .\
-.\	$NetBSD: tcpdump.1.in,v 1.3 2010/12/17 09:54:28 jruoho Exp $
+.\	$NetBSD: tcpdump.1.in,v 1.4 2010/12/17 10:35:10 wiz Exp $
 .\
 .\ Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997
 .\	The Regents of the University of California.  All rights reserved.
@@ -22,7 +22,7 @@
 .\ WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 .\ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 .\
-.TH TCPDUMP 8  5 December 2010
+.TH TCPDUMP 8  17 December 2010
 .SH NAME
 tcpdump \- dump traffic on a network
 .SH SYNOPSIS



CVS commit: src/external/bsd/tcpdump/dist

2010-12-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  5 03:16:16 UTC 2010

Update of /cvsroot/src/external/bsd/tcpdump/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv7190

Log Message:
Import tcpdump-4.1.1

Status:

Vendor Tag: TCPDUMP
Release Tags:   tcpdump-4_1_1

N src/external/bsd/tcpdump/dist/INSTALL.txt
N src/external/bsd/tcpdump/dist/CHANGES
N src/external/bsd/tcpdump/dist/CREDITS
N src/external/bsd/tcpdump/dist/Makefile.in
N src/external/bsd/tcpdump/dist/LICENSE
N src/external/bsd/tcpdump/dist/aodv.h
N src/external/bsd/tcpdump/dist/af.c
N src/external/bsd/tcpdump/dist/Makefile-devel-adds
N src/external/bsd/tcpdump/dist/README
N src/external/bsd/tcpdump/dist/Readme.Win32
N src/external/bsd/tcpdump/dist/VERSION
N src/external/bsd/tcpdump/dist/acconfig.h
N src/external/bsd/tcpdump/dist/aclocal.m4
N src/external/bsd/tcpdump/dist/addrtoname.c
N src/external/bsd/tcpdump/dist/addrtoname.h
N src/external/bsd/tcpdump/dist/af.h
N src/external/bsd/tcpdump/dist/ah.h
N src/external/bsd/tcpdump/dist/bootp.h
N src/external/bsd/tcpdump/dist/appletalk.h
N src/external/bsd/tcpdump/dist/arcnet.h
N src/external/bsd/tcpdump/dist/atime.awk
N src/external/bsd/tcpdump/dist/atm.h
N src/external/bsd/tcpdump/dist/atmuni31.h
N src/external/bsd/tcpdump/dist/bgp.h
N src/external/bsd/tcpdump/dist/ip6.h
N src/external/bsd/tcpdump/dist/ip.h
N src/external/bsd/tcpdump/dist/bpf_dump.c
N src/external/bsd/tcpdump/dist/chdlc.h
N src/external/bsd/tcpdump/dist/checksum.c
N src/external/bsd/tcpdump/dist/config.guess
N src/external/bsd/tcpdump/dist/config.h.in
N src/external/bsd/tcpdump/dist/config.sub
N src/external/bsd/tcpdump/dist/configure
N src/external/bsd/tcpdump/dist/configure.in
N src/external/bsd/tcpdump/dist/cpack.c
N src/external/bsd/tcpdump/dist/cpack.h
N src/external/bsd/tcpdump/dist/dccp.h
N src/external/bsd/tcpdump/dist/decnet.h
N src/external/bsd/tcpdump/dist/decode_prefix.h
N src/external/bsd/tcpdump/dist/enc.h
N src/external/bsd/tcpdump/dist/esp.h
N src/external/bsd/tcpdump/dist/ether.h
N src/external/bsd/tcpdump/dist/ethertype.h
N src/external/bsd/tcpdump/dist/extract.h
N src/external/bsd/tcpdump/dist/fddi.h
N src/external/bsd/tcpdump/dist/forces.h
N src/external/bsd/tcpdump/dist/gmpls.c
N src/external/bsd/tcpdump/dist/gmpls.h
N src/external/bsd/tcpdump/dist/gmt2local.c
N src/external/bsd/tcpdump/dist/gmt2local.h
N src/external/bsd/tcpdump/dist/icmp6.h
N src/external/bsd/tcpdump/dist/ieee802_11.h
N src/external/bsd/tcpdump/dist/igrp.h
N src/external/bsd/tcpdump/dist/ieee802_11_radio.h
N src/external/bsd/tcpdump/dist/install-sh
N src/external/bsd/tcpdump/dist/interface.h
N src/external/bsd/tcpdump/dist/ipproto.c
N src/external/bsd/tcpdump/dist/ipfc.h
N src/external/bsd/tcpdump/dist/ipnet.h
N src/external/bsd/tcpdump/dist/llc.h
N src/external/bsd/tcpdump/dist/ipproto.h
N src/external/bsd/tcpdump/dist/ipsec_doi.h
N src/external/bsd/tcpdump/dist/ipx.h
N src/external/bsd/tcpdump/dist/isakmp.h
N src/external/bsd/tcpdump/dist/l2tp.h
N src/external/bsd/tcpdump/dist/l2vpn.c
N src/external/bsd/tcpdump/dist/l2vpn.h
N src/external/bsd/tcpdump/dist/lane.h
N src/external/bsd/tcpdump/dist/machdep.c
N src/external/bsd/tcpdump/dist/machdep.h
N src/external/bsd/tcpdump/dist/makemib
N src/external/bsd/tcpdump/dist/mib.h
N src/external/bsd/tcpdump/dist/nameser.h
N src/external/bsd/tcpdump/dist/mkdep
N src/external/bsd/tcpdump/dist/mpls.h
N src/external/bsd/tcpdump/dist/packetdat.awk
N src/external/bsd/tcpdump/dist/netbios.h
N src/external/bsd/tcpdump/dist/netdissect.h
N src/external/bsd/tcpdump/dist/nfs.h
N src/external/bsd/tcpdump/dist/nfsfh.h
N src/external/bsd/tcpdump/dist/nlpid.c
N src/external/bsd/tcpdump/dist/nlpid.h
N src/external/bsd/tcpdump/dist/ntp.h
N src/external/bsd/tcpdump/dist/oakley.h
N src/external/bsd/tcpdump/dist/ospf.h
N src/external/bsd/tcpdump/dist/ospf6.h
N src/external/bsd/tcpdump/dist/oui.c
N src/external/bsd/tcpdump/dist/oui.h
N src/external/bsd/tcpdump/dist/pcap-missing.h
N src/external/bsd/tcpdump/dist/parsenfsfh.c
N src/external/bsd/tcpdump/dist/print-lspping.c
N src/external/bsd/tcpdump/dist/pcap_dump_ftell.c
N src/external/bsd/tcpdump/dist/pmap_prot.h
N src/external/bsd/tcpdump/dist/ppp.h
N src/external/bsd/tcpdump/dist/print-802_11.c
N src/external/bsd/tcpdump/dist/print-ah.c
N src/external/bsd/tcpdump/dist/print-aodv.c
N src/external/bsd/tcpdump/dist/print-ap1394.c
N src/external/bsd/tcpdump/dist/print-arcnet.c
N src/external/bsd/tcpdump/dist/print-arp.c
N src/external/bsd/tcpdump/dist/print-ascii.c
N src/external/bsd/tcpdump/dist/print-atalk.c
N src/external/bsd/tcpdump/dist/print-atm.c
N src/external/bsd/tcpdump/dist/print-ldp.c
N src/external/bsd/tcpdump/dist/print-beep.c
N src/external/bsd/tcpdump/dist/print-bfd.c
N src/external/bsd/tcpdump/dist/print-bgp.c
N src/external/bsd/tcpdump/dist/print-bootp.c
N src/external/bsd/tcpdump/dist/print-bt.c
N src/external/bsd/tcpdump/dist/print-cdp.c
N src/external/bsd/tcpdump/dist/print-cfm.c
N