X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/f39bd6851f0e4150377ce8a1f0136b8aad821ce8..24f217998d866e9199de829efa2bae432402bcd7:/print-openflow-1.0.c diff --git a/print-openflow-1.0.c b/print-openflow-1.0.c index 7751f2d9..82a4f0ba 100644 --- a/print-openflow-1.0.c +++ b/print-openflow-1.0.c @@ -1025,11 +1025,10 @@ of10_packet_data_print(netdissect_options *ndo, * what ether_print() needs to decode an Ethernet frame nested in * the middle of a TCP payload. */ - if (!nd_push_snapend(ndo, cp + len)) - (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC, - "%s: failed to adjust snapend", __func__); + 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); - nd_pop_packet_info(ndo); + ndo->ndo_snapend = snapend_save; ndo->ndo_vflag += 3; }