diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-05-14 00:46:26 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-05-14 07:47:17 +0000 |
commit | 0db5490f2697eff72208f9d2273e14af20fc22c5 (patch) | |
tree | b134c47654ddeba1b1ece31b2d0edac4e58d5b7f /epan | |
parent | 2ddf0e6db31b97ac8dbc0f43d87a114b6be100f9 (diff) |
Register the IPv4 and IPv6 dissectors directly with WTAP_ENCAP_RAW_IP{4,6}.
No need to run them through the "raw IP" dissector.
Change-Id: I63639651873f00326a20b88a08ecb4ab3b9a83b3
Reviewed-on: https://code.wireshark.org/review/8459
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-ip.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-ipv6.c | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-raw.c | 10 |
3 files changed, 2 insertions, 11 deletions
diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index 80743175c6..5a785207ad 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -3136,6 +3136,7 @@ proto_reg_handoff_ip(void) dissector_add_uint("pwach.channel_type", 0x21, ip_handle); /* IPv4, RFC4385 clause 6. */ dissector_add_uint("sflow_245.header_protocol", SFLOW_245_HEADER_IPv4, ip_handle); dissector_add_for_decode_as("udp.port", ip_handle); + dissector_add_uint("wtap_encap", WTAP_ENCAP_RAW_IP4, ip_handle); heur_dissector_add("tipc", dissect_ip_heur, proto_ip); } @@ -3152,4 +3153,3 @@ proto_reg_handoff_ip(void) * vi: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */ - diff --git a/epan/dissectors/packet-ipv6.c b/epan/dissectors/packet-ipv6.c index 0f858a034c..8c5012216b 100644 --- a/epan/dissectors/packet-ipv6.c +++ b/epan/dissectors/packet-ipv6.c @@ -3066,6 +3066,7 @@ proto_reg_handoff_ipv6(void) dissector_add_uint("juniper.proto", JUNIPER_PROTO_MPLS_IP6, ipv6_handle); dissector_add_uint("pwach.channel_type", 0x57, ipv6_handle); /* IPv6, RFC4385 clause 6. */ dissector_add_uint("sflow_245.header_protocol", SFLOW_245_HEADER_IPv6, ipv6_handle); + dissector_add_uint("wtap_encap", WTAP_ENCAP_RAW_IP6, ipv6_handle); ipv6_hopopts_handle = new_create_dissector_handle(dissect_hopopts, proto_ipv6_hopopts ); dissector_add_uint("ipv6.nxt", IP_PROTO_HOPOPTS, ipv6_hopopts_handle); diff --git a/epan/dissectors/packet-raw.c b/epan/dissectors/packet-raw.c index 54b716aea0..e907363ddc 100644 --- a/epan/dissectors/packet-raw.c +++ b/epan/dissectors/packet-raw.c @@ -110,14 +110,6 @@ dissect_raw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) layer (ie none) */ proto_tree_add_item(tree, proto_raw, tvb, 0, tvb_captured_length(tvb), ENC_NA); - if (pinfo->fd->lnk_t == WTAP_ENCAP_RAW_IP4) { - call_dissector(ip_handle, tvb, pinfo, tree); - } - else if (pinfo->fd->lnk_t == WTAP_ENCAP_RAW_IP6) { - call_dissector(ipv6_handle, tvb, pinfo, tree); - } - else - /* So far, the only time we get raw connection types are with Linux and * Irix PPP connections. We can't tell what type of data is coming down * the line, so our safest bet is IP. - GCC @@ -196,8 +188,6 @@ proto_reg_handoff_raw(void) ppp_hdlc_handle = find_dissector("ppp_hdlc"); raw_handle = create_dissector_handle(dissect_raw, proto_raw); dissector_add_uint("wtap_encap", WTAP_ENCAP_RAW_IP, raw_handle); - dissector_add_uint("wtap_encap", WTAP_ENCAP_RAW_IP4, raw_handle); - dissector_add_uint("wtap_encap", WTAP_ENCAP_RAW_IP6, raw_handle); } /* |