aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-nflog.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2016-08-20 13:22:30 +0200
committerMichael Mann <mmann78@netscape.net>2016-08-21 14:53:34 +0000
commitc0ab12b23e5ca3a48d5f42600d1162a57dfdeca2 (patch)
tree468d113eac3b8cbbe49238475c2127ad388f7044 /epan/dissectors/packet-nflog.c
parent9902117f1a2eb47bb5bd1a0323a3d3891ef17d5b (diff)
netlink-netfilter,nflog: use NFPROTO_xxx instead of AF_xxx
These constants are mostly overlapping, except for NFPROTO_ARP. A manual study of the Linux v4.7 code shows which fields to use and also reveal that nflog.family can never be NFPROTO_ARP because (1) bridge traffic use NFPROTO_BRIDGE and (2) arptables has no ULOG/NFLOG target. This patch affects how some family fields are displayed but do not affect subdissector calls. Change-Id: I7cc73a8dcf73fe68c7ccaaa0f3b329fe484c8bfe Reviewed-on: https://code.wireshark.org/review/17190 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-nflog.c')
-rw-r--r--epan/dissectors/packet-nflog.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/epan/dissectors/packet-nflog.c b/epan/dissectors/packet-nflog.c
index 046667e537..381ddada16 100644
--- a/epan/dissectors/packet-nflog.c
+++ b/epan/dissectors/packet-nflog.c
@@ -25,9 +25,10 @@
#include "config.h"
#include <epan/packet.h>
-#include <epan/aftypes.h>
#include <wiretap/wtap.h>
+#include "packet-netlink.h"
+
void proto_register_nflog(void);
void proto_reg_handoff_nflog(void);
@@ -84,7 +85,7 @@ static header_field_info *hfi_nflog = NULL;
/* Header */
static header_field_info hfi_nflog_family NFLOG_HFI_INIT =
- { "Family", "nflog.family", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &linux_af_vals_ext, 0x00, NULL, HFILL };
+ { "Family", "nflog.family", FT_UINT8, BASE_DEC, VALS(nfproto_family_vals), 0x00, NULL, HFILL };
static header_field_info hfi_nflog_version NFLOG_HFI_INIT =
{ "Version", "nflog.version", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL };
@@ -132,12 +133,12 @@ dissect_nflog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U
int offset = 0;
tvbuff_t *next_tvb = NULL;
- int aftype;
+ int pf;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "NFLOG");
col_clear(pinfo->cinfo, COL_INFO);
- aftype = tvb_get_guint8(tvb, 0);
+ pf = tvb_get_guint8(tvb, 0);
/* Header */
if (proto_field_is_referenced(tree, hfi_nflog->id)) {
@@ -237,11 +238,13 @@ dissect_nflog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U
}
if (next_tvb) {
- switch (aftype) {
- case LINUX_AF_INET:
+ switch (pf) {
+ /* Note: NFPROTO_INET is not supposed to appear here, it is mapped
+ * to NFPROTO_IPV4 or NFPROTO_IPV6 */
+ case WS_NFPROTO_IPV4:
call_dissector(ip_handle, next_tvb, pinfo, tree);
break;
- case LINUX_AF_INET6:
+ case WS_NFPROTO_IPV6:
call_dissector(ip6_handle, next_tvb, pinfo, tree);
break;
default: