]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-openflow-1.0.c
Add support for IPv6 agent in sFlow.
[tcpdump] / print-openflow-1.0.c
index df57a09a38aa401fc4724c17837e0a5ff029efae..82a4f0ba0c82d8b660356b4f3d29faa13498265a 100644 (file)
@@ -1017,7 +1017,18 @@ of10_packet_data_print(netdissect_options *ndo,
        }
        ndo->ndo_vflag -= 3;
        ND_PRINT(", frame decoding below\n");
+       /*
+        * The encapsulated Ethernet frame is not necessarily the last
+        * data of this packet (i.e. there may be more OpenFlow messages
+        * after the current OFPT_PACKET_IN/OFPT_PACKET_OUT message, in
+        * which case the current (outer) packet's snapshot end is not
+        * what ether_print() needs to decode an Ethernet frame nested in
+        * the middle of a TCP payload.
+        */
+       const u_char *snapend_save = ndo->ndo_snapend;
+       ndo->ndo_snapend = ND_MIN(cp + len, ndo->ndo_snapend);
        ether_print(ndo, cp, len, ND_BYTES_AVAILABLE_AFTER(cp), NULL, NULL);
+       ndo->ndo_snapend = snapend_save;
        ndo->ndo_vflag += 3;
 }