aboutsummaryrefslogtreecommitdiff
path: root/contrib/tcpdump/print-wb.c
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2017-02-01 20:26:42 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2017-02-01 20:26:42 +0000
commit3340d77368116708ab5b5b95acf6c9c710528300 (patch)
tree811e83fd724dc565485db80039bf234ece065b10 /contrib/tcpdump/print-wb.c
parent151139ad9e119116ae3692d0b8dd13baf691d55e (diff)
parentd79b843cb78484ea27f877f1541055e1a6a5a4d3 (diff)
downloadsrc-3340d77368116708ab5b5b95acf6c9c710528300.tar.gz
src-3340d77368116708ab5b5b95acf6c9c710528300.zip
Update tcpdump to 4.9.0.
It fixes many buffer overflow in different protocol parsers, but none of them are critical, even in absense of Capsicum. Security: CVE-2016-7922, CVE-2016-7923, CVE-2016-7924, CVE-2016-7925 Security: CVE-2016-7926, CVE-2016-7927, CVE-2016-7928, CVE-2016-7929 Security: CVE-2016-7930, CVE-2016-7931, CVE-2016-7932, CVE-2016-7933 Security: CVE-2016-7934, CVE-2016-7935, CVE-2016-7936, CVE-2016-7937 Security: CVE-2016-7938, CVE-2016-7939, CVE-2016-7940, CVE-2016-7973 Security: CVE-2016-7974, CVE-2016-7975, CVE-2016-7983, CVE-2016-7984 Security: CVE-2016-7985, CVE-2016-7986, CVE-2016-7992, CVE-2016-7993 Security: CVE-2016-8574, CVE-2016-8575, CVE-2017-5202, CVE-2017-5203 Security: CVE-2017-5204, CVE-2017-5205, CVE-2017-5341, CVE-2017-5342 Security: CVE-2017-5482, CVE-2017-5483, CVE-2017-5484, CVE-2017-5485 Security: CVE-2017-5486
Notes
Notes: svn path=/head/; revision=313048
Diffstat (limited to 'contrib/tcpdump/print-wb.c')
-rw-r--r--contrib/tcpdump/print-wb.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/contrib/tcpdump/print-wb.c b/contrib/tcpdump/print-wb.c
index e10d532864cb..88857d9618d7 100644
--- a/contrib/tcpdump/print-wb.c
+++ b/contrib/tcpdump/print-wb.c
@@ -19,14 +19,15 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#define NETDISSECT_REWORKED
+/* \summary: White Board printer */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
-#include "interface.h"
+#include "netdissect.h"
#include "addrtoname.h"
#include "extract.h"
@@ -48,8 +49,8 @@ static const char tstr[] = "[|wb]";
#define DOP_ALIGN 4
#define DOP_ROUNDUP(x) ((((int)(x)) + (DOP_ALIGN - 1)) & ~(DOP_ALIGN - 1))
#define DOP_NEXT(d)\
- ((struct dophdr *)((u_char *)(d) + \
- DOP_ROUNDUP(EXTRACT_16BITS(&(d)->dh_len) + sizeof(*(d)))))
+ ((const struct dophdr *)((const u_char *)(d) + \
+ DOP_ROUNDUP(EXTRACT_16BITS(&(d)->dh_len) + sizeof(*(d)))))
/*
* Format of the whiteboard packet header.
@@ -200,11 +201,11 @@ wb_id(netdissect_options *ndo,
nid = EXTRACT_16BITS(&id->pi_ps.nid);
len -= sizeof(*io) * nid;
- io = (struct id_off *)(id + 1);
- cp = (char *)(io + nid);
+ io = (const struct id_off *)(id + 1);
+ cp = (const char *)(io + nid);
if (ND_TTEST2(cp, len)) {
ND_PRINT((ndo, "\""));
- fn_print(ndo, (u_char *)cp, (u_char *)cp + len);
+ fn_print(ndo, (const u_char *)cp, (const u_char *)cp + len);
ND_PRINT((ndo, "\""));
}
@@ -275,16 +276,16 @@ wb_prep(netdissect_options *ndo,
EXTRACT_32BITS(&ps->slot),
ipaddr_string(ndo, &ps->page.p_sid),
EXTRACT_32BITS(&ps->page.p_uid)));
- io = (struct id_off *)(ps + 1);
+ io = (const struct id_off *)(ps + 1);
for (ie = io + ps->nid; io < ie && ND_TTEST(*io); ++io) {
ND_PRINT((ndo, "%c%s:%u", c, ipaddr_string(ndo, &io->id),
EXTRACT_32BITS(&io->off)));
c = ',';
}
ND_PRINT((ndo, ">"));
- ps = (struct pgstate *)io;
+ ps = (const struct pgstate *)io;
}
- return ((u_char *)ps <= ep? 0 : -1);
+ return ((const u_char *)ps <= ep? 0 : -1);
}
@@ -416,32 +417,32 @@ wb_print(netdissect_options *ndo,
return;
case PT_ID:
- if (wb_id(ndo, (struct pkt_id *)(ph + 1), len) >= 0)
+ if (wb_id(ndo, (const struct pkt_id *)(ph + 1), len) >= 0)
return;
break;
case PT_RREQ:
- if (wb_rreq(ndo, (struct pkt_rreq *)(ph + 1), len) >= 0)
+ if (wb_rreq(ndo, (const struct pkt_rreq *)(ph + 1), len) >= 0)
return;
break;
case PT_RREP:
- if (wb_rrep(ndo, (struct pkt_rrep *)(ph + 1), len) >= 0)
+ if (wb_rrep(ndo, (const struct pkt_rrep *)(ph + 1), len) >= 0)
return;
break;
case PT_DRAWOP:
- if (wb_drawop(ndo, (struct pkt_dop *)(ph + 1), len) >= 0)
+ if (wb_drawop(ndo, (const struct pkt_dop *)(ph + 1), len) >= 0)
return;
break;
case PT_PREQ:
- if (wb_preq(ndo, (struct pkt_preq *)(ph + 1), len) >= 0)
+ if (wb_preq(ndo, (const struct pkt_preq *)(ph + 1), len) >= 0)
return;
break;
case PT_PREP:
- if (wb_prep(ndo, (struct pkt_prep *)(ph + 1), len) >= 0)
+ if (wb_prep(ndo, (const struct pkt_prep *)(ph + 1), len) >= 0)
return;
break;