Page MenuHomeFreeBSD

D62117.1795884228.diff
No OneTemporary

Authored By
Unknown
Size
4 KB
Referenced Files
None
Subscribers
None

D62117.1795884228.diff

diff --git a/contrib/tcpdump/ipproto.c b/contrib/tcpdump/ipproto.c
--- a/contrib/tcpdump/ipproto.c
+++ b/contrib/tcpdump/ipproto.c
@@ -49,6 +49,7 @@
{ IPPROTO_PGM, "PGM" },
{ IPPROTO_SCTP, "SCTP" },
{ IPPROTO_MOBILITY, "Mobility" },
+ { IPPROTO_PFSYNC, "pfsync" },
{ IPPROTO_ETHERNET, "Ethernet" },
{ 0, NULL }
};
diff --git a/contrib/tcpdump/netdissect.h b/contrib/tcpdump/netdissect.h
--- a/contrib/tcpdump/netdissect.h
+++ b/contrib/tcpdump/netdissect.h
@@ -719,6 +719,8 @@
extern void ospf_print(netdissect_options *, const u_char *, u_int, const u_char *);
extern int ospf_grace_lsa_print(netdissect_options *, const u_char *, u_int);
extern int ospf_te_lsa_print(netdissect_options *, const u_char *, u_int);
+extern void pfsync_ip_print(netdissect_options *, const u_char *, u_int);
+extern void pfsync_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern void pgm_print(netdissect_options *, const u_char *, u_int, const u_char *);
extern void pim_print(netdissect_options *, const u_char *, u_int, const u_char *);
extern void pimv1_print(netdissect_options *, const u_char *, u_int);
diff --git a/contrib/tcpdump/print-ip-demux.c b/contrib/tcpdump/print-ip-demux.c
--- a/contrib/tcpdump/print-ip-demux.c
+++ b/contrib/tcpdump/print-ip-demux.c
@@ -214,6 +214,12 @@
}
break;
+#ifdef HAVE_NET_IF_PFLOG_H
+ case IPPROTO_PFSYNC:
+ pfsync_ip_print(ndo, bp, length);
+ break;
+#endif
+
case IPPROTO_NONE:
ND_PRINT("no next header");
break;
diff --git a/contrib/tcpdump/print-pflog.c b/contrib/tcpdump/print-pflog.c
--- a/contrib/tcpdump/print-pflog.c
+++ b/contrib/tcpdump/print-pflog.c
@@ -103,11 +103,12 @@
static void
pflog_print(netdissect_options *ndo, const struct pfloghdr *hdr)
{
- uint32_t rulenr, subrulenr;
+ uint32_t rulenr, subrulenr, ridentifier;
ndo->ndo_protocol = "pflog";
rulenr = GET_BE_U_4(hdr->rulenr);
subrulenr = GET_BE_U_4(hdr->subrulenr);
+ ridentifier = GET_BE_U_4(hdr->ridentifier);
if (subrulenr == (uint32_t)-1)
ND_PRINT("rule %u/", rulenr);
else {
@@ -116,8 +117,15 @@
ND_PRINT(".%u/", subrulenr);
}
- ND_PRINT("%s: %s %s on ",
- tok2str(pf_reasons, "unkn(%u)", GET_U_1(hdr->reason)),
+ ND_PRINT("%s", tok2str(pf_reasons, "unkn(%u)", GET_U_1(hdr->reason)));
+
+ if (GET_HE_U_4(hdr->uid) != UID_MAX)
+ ND_PRINT(" [uid %u]", GET_HE_U_4(hdr->uid));
+
+ if (ridentifier != 0)
+ ND_PRINT(" [ridentifier %u]", ridentifier);
+
+ ND_PRINT(": %s %s on ",
tok2str(pf_actions, "unkn(%u)", GET_U_1(hdr->action)),
tok2str(pf_directions, "unkn(%u)", GET_U_1(hdr->dir)));
nd_printjnp(ndo, (const u_char*)hdr->ifname, PFLOG_IFNAMSIZ);
diff --git a/contrib/tcpdump/print.c b/contrib/tcpdump/print.c
--- a/contrib/tcpdump/print.c
+++ b/contrib/tcpdump/print.c
@@ -183,9 +183,12 @@
#ifdef DLT_LOOP
{ null_if_print, DLT_LOOP },
#endif
-#ifdef DLT_PFLOG
+#if defined(DLT_PFLOG) && defined(HAVE_NET_IF_PFLOG_H)
{ pflog_if_print, DLT_PFLOG },
#endif
+#if defined(DLT_PFSYNC) && defined(HAVE_NET_PFVAR_H)
+ { pfsync_if_print, DLT_PFSYNC},
+#endif
#ifdef DLT_PKTAP
{ pktap_if_print, DLT_PKTAP },
#endif
diff --git a/contrib/tcpdump/tcpdump.c b/contrib/tcpdump/tcpdump.c
--- a/contrib/tcpdump/tcpdump.c
+++ b/contrib/tcpdump/tcpdump.c
@@ -253,6 +253,12 @@
char *program_name;
+/*
+ * #ifdef HAVE_CASPER
+ * cap_channel_t *capdns;
+ * #endif
+ */
+
/* Forwards */
static NORETURN void error(FORMAT_STRING(const char *), ...) PRINTFLIKE(1, 2);
static void warning(FORMAT_STRING(const char *), ...) PRINTFLIKE(1, 2);
@@ -957,7 +963,7 @@
if (capdnsloc == NULL)
error("unable to open system.dns service");
/* Limit system.dns to reverse DNS lookups. */
- types[0] = "ADDR";
+ types[0] = "ADDR2NAME";
if (cap_dns_type_limit(capdnsloc, types, 1) < 0)
error("unable to limit access to system.dns service");
families[0] = AF_INET;
@@ -2884,7 +2890,8 @@
}
#ifdef HAVE_CAPSICUM
- cansandbox = (VFileName == NULL && zflag == NULL);
+ cansandbox = (VFileName == NULL && zflag == NULL &&
+ ndo->ndo_espsecret == NULL);
#ifdef HAVE_CASPER
cansandbox = (cansandbox && (ndo->ndo_nflag || capdns != NULL));
#else

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 28, 4:43 PM (4 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42049013
Default Alt Text
D62117.1795884228.diff (4 KB)

Event Timeline