aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-09-25 16:20:00 -0700
committerGuy Harris <guy@alum.mit.edu>2018-09-25 23:20:39 +0000
commitf9129721b2e504987484b8def3b56d9eae30b4db (patch)
treeac6b42de006c5b938fe0721d9f0d365832c8be6e /wiretap
parent4b9a4bcb740f15694fb82eac7cb1e31e8f7629ec (diff)
Get rid of unused flag argument.
We always tell pcap_process_pseudo_header() to check to make sure the pseudo-header isn't bigger than the captured data; no need for a flag argument to tell it to do so. Change-Id: I8310bb06a390a7f4a7a232ad140ae07955d52da1 Reviewed-on: https://code.wireshark.org/review/29833 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/libpcap.c2
-rw-r--r--wiretap/pcap-common.c35
-rw-r--r--wiretap/pcap-common.h3
-rw-r--r--wiretap/pcapng.c2
4 files changed, 16 insertions, 26 deletions
diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c
index 25d129f928..6051385c78 100644
--- a/wiretap/libpcap.c
+++ b/wiretap/libpcap.c
@@ -751,7 +751,7 @@ libpcap_read_packet(wtap *wth, FILE_T fh, wtap_rec *rec,
}
phdr_len = pcap_process_pseudo_header(fh, wth->file_type_subtype,
- wth->file_encap, packet_size, TRUE, rec, err, err_info);
+ wth->file_encap, packet_size, rec, err, err_info);
if (phdr_len < 0)
return FALSE; /* error */
diff --git a/wiretap/pcap-common.c b/wiretap/pcap-common.c
index 485427e679..95a31d462b 100644
--- a/wiretap/pcap-common.c
+++ b/wiretap/pcap-common.c
@@ -1648,8 +1648,7 @@ pcap_read_i2c_pseudoheader(FILE_T fh, union wtap_pseudo_header *pseudo_header, i
int
pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap,
- guint packet_size, gboolean check_packet_size,
- wtap_rec *rec, int *err, gchar **err_info)
+ guint packet_size, wtap_rec *rec, int *err, gchar **err_info)
{
int phdr_len = 0;
guint size;
@@ -1661,7 +1660,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap,
/*
* Nokia IPSO ATM.
*/
- if (check_packet_size && packet_size < NOKIAATM_LEN) {
+ if (packet_size < NOKIAATM_LEN) {
/*
* Uh-oh, the packet isn't big enough to even
* have a pseudo-header.
@@ -1680,7 +1679,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap,
/*
* SunATM.
*/
- if (check_packet_size && packet_size < SUNATM_LEN) {
+ if (packet_size < SUNATM_LEN) {
/*
* Uh-oh, the packet isn't big enough to even
* have a pseudo-header.
@@ -1733,7 +1732,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap,
break;
case WTAP_ENCAP_IRDA:
- if (check_packet_size && packet_size < IRDA_SLL_LEN) {
+ if (packet_size < IRDA_SLL_LEN) {
/*
* Uh-oh, the packet isn't big enough to even
* have a pseudo-header.
@@ -1751,7 +1750,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap,
break;
case WTAP_ENCAP_MTP2_WITH_PHDR:
- if (check_packet_size && packet_size < MTP2_HDR_LEN) {
+ if (packet_size < MTP2_HDR_LEN) {
/*
* Uh-oh, the packet isn't big enough to even
* have a pseudo-header.
@@ -1769,7 +1768,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap,
break;
case WTAP_ENCAP_LINUX_LAPD:
- if (check_packet_size && packet_size < LAPD_SLL_LEN) {
+ if (packet_size < LAPD_SLL_LEN) {
/*
* Uh-oh, the packet isn't big enough to even
* have a pseudo-header.
@@ -1787,7 +1786,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap,
break;
case WTAP_ENCAP_SITA:
- if (check_packet_size && packet_size < SITA_HDR_LEN) {
+ if (packet_size < SITA_HDR_LEN) {
/*
* Uh-oh, the packet isn't big enough to even
* have a pseudo-header.
@@ -1810,8 +1809,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap,
break;
case WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR:
- if (check_packet_size &&
- packet_size < sizeof (struct libpcap_bt_phdr)) {
+ if (packet_size < sizeof (struct libpcap_bt_phdr)) {
/*
* Uh-oh, the packet isn't big enough to even
* have a pseudo-header.
@@ -1829,8 +1827,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap,
break;
case WTAP_ENCAP_BLUETOOTH_LINUX_MONITOR:
- if (check_packet_size &&
- packet_size < sizeof (struct libpcap_bt_monitor_phdr)) {
+ if (packet_size < sizeof (struct libpcap_bt_monitor_phdr)) {
/*
* Uh-oh, the packet isn't big enough to even
* have a pseudo-header.
@@ -1848,7 +1845,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap,
break;
case WTAP_ENCAP_NFC_LLCP:
- if (check_packet_size && packet_size < LLCP_HEADER_LEN) {
+ if (packet_size < LLCP_HEADER_LEN) {
*err = WTAP_ERR_BAD_FILE;
*err_info = g_strdup("pcap: libpcap llcp file too short");
return -1;
@@ -1859,8 +1856,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap,
break;
case WTAP_ENCAP_PPP_WITH_PHDR:
- if (check_packet_size &&
- packet_size < sizeof (struct libpcap_ppp_phdr)) {
+ if (packet_size < sizeof (struct libpcap_ppp_phdr)) {
/*
* Uh-oh, the packet isn't big enough to even
* have a pseudo-header.
@@ -1878,8 +1874,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap,
break;
case WTAP_ENCAP_ERF:
- if (check_packet_size &&
- packet_size < sizeof(struct erf_phdr) ) {
+ if (packet_size < sizeof(struct erf_phdr) ) {
/*
* Uh-oh, the packet isn't big enough to even
* have a pseudo-header.
@@ -1910,8 +1905,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap,
phdr_len += size;
- if (check_packet_size &&
- packet_size < (guint)phdr_len) {
+ if (packet_size < (guint)phdr_len) {
/*
* Uh-oh, the packet isn't big enough for the pseudo-
* header.
@@ -1924,8 +1918,7 @@ pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap,
break;
case WTAP_ENCAP_I2C:
- if (check_packet_size &&
- packet_size < sizeof (struct i2c_file_hdr)) {
+ if (packet_size < sizeof (struct i2c_file_hdr)) {
/*
* Uh-oh, the packet isn't big enough to even
* have a pseudo-header.
diff --git a/wiretap/pcap-common.h b/wiretap/pcap-common.h
index df36bb68d6..fc79cacae8 100644
--- a/wiretap/pcap-common.h
+++ b/wiretap/pcap-common.h
@@ -20,8 +20,7 @@
extern guint wtap_max_snaplen_for_encap(int wtap_encap);
extern int pcap_process_pseudo_header(FILE_T fh, int file_type, int wtap_encap,
- guint packet_size, gboolean check_packet_size,
- wtap_rec *rec, int *err, gchar **err_info);
+ guint packet_size, wtap_rec *rec, int *err, gchar **err_info);
extern void pcap_read_post_process(int file_type, int wtap_encap,
wtap_rec *rec, guint8 *pd, gboolean bytes_swapped, int fcs_len);
diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c
index 248c83f211..52b8475a0d 100644
--- a/wiretap/pcapng.c
+++ b/wiretap/pcapng.c
@@ -1223,7 +1223,6 @@ pcapng_read_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *pn, wta
WTAP_FILE_TYPE_SUBTYPE_PCAPNG,
iface_info.wtap_encap,
packet.cap_len,
- TRUE,
wblock->rec,
err,
err_info);
@@ -1511,7 +1510,6 @@ pcapng_read_simple_packet_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *
WTAP_FILE_TYPE_SUBTYPE_PCAPNG,
iface_info.wtap_encap,
simple_packet.cap_len,
- TRUE,
wblock->rec,
err,
err_info);