]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ipfc.c
Handle very large -f files by rejecting them.
[tcpdump] / print-ipfc.c
index 6907ba3ed10e222ddca3f91d0b57747590776529..b8a08e9626e733225888c388f37825b290e42cf6 100644 (file)
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
+/* \summary: IP over Fibre Channel printer */
+
+/* specification: RFC 2625 */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
 #include "ether.h"
 
-/*
- * RFC 2625 IP-over-Fibre Channel.
- */
-
 struct ipfc_header {
        u_char  ipfc_dhost[8];
        u_char  ipfc_shost[8];
@@ -93,6 +93,7 @@ ipfc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
 {
        const struct ipfc_header *ipfcp = (const struct ipfc_header *)p;
        struct ether_header ehdr;
+       struct lladdr_info src, dst;
        int llc_hdrlen;
 
        if (caplen < IPFC_HDRLEN) {
@@ -107,13 +108,18 @@ ipfc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
        if (ndo->ndo_eflag)
                ipfc_hdr_print(ndo, ipfcp, length, ESRC(&ehdr), EDST(&ehdr));
 
+       src.addr = ESRC(&ehdr);
+       src.addr_string = etheraddr_string;
+       dst.addr = EDST(&ehdr);
+       dst.addr_string = etheraddr_string;
+
        /* Skip over Network_Header */
        length -= IPFC_HDRLEN;
        p += IPFC_HDRLEN;
        caplen -= IPFC_HDRLEN;
 
        /* Try to print the LLC-layer header & higher layers */
-       llc_hdrlen = llc_print(ndo, p, length, caplen, ESRC(&ehdr), EDST(&ehdr));
+       llc_hdrlen = llc_print(ndo, p, length, caplen, &src, &dst);
        if (llc_hdrlen < 0) {
                /*
                 * Some kinds of LLC packet we cannot