+ /*
+ * 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);