#include "netdissect-stdinc.h"
-#include <stdio.h>
-
#include "netdissect.h"
#include "extract.h"
#include "addrtoname.h"
u_int orig_length;
u_short ether_type;
- if (caplen < IPOIB_HDRLEN || length < IPOIB_HDRLEN) {
+ if (caplen < IPOIB_HDRLEN) {
+ nd_print_trunc(ndo);
+ ndo->ndo_ll_hdr_len += caplen;
+ return;
+ }
+
+ if (length < IPOIB_HDRLEN) {
nd_print_trunc(ndo);
+ ndo->ndo_ll_hdr_len += length;
return;
}
}
orig_length = length;
+ ndo->ndo_ll_hdr_len += IPOIB_HDRLEN;
length -= IPOIB_HDRLEN;
caplen -= IPOIB_HDRLEN;
ether_type = GET_BE_U_2(p + 40);
* 'h->len' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
-u_int
+void
ipoib_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
{
ndo->ndo_protocol = "ipoib";
ipoib_print(ndo, p, h->len, h->caplen, NULL, NULL);
-
- return (IPOIB_HDRLEN);
}