Changeset e4e94c38


Ignore:
Timestamp:
02/22/11 10:01:55 (10 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
cd4e06c
Parents:
9cc1266
Message:
  • Fixed libpacketdump to process SLL packets correctly
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpacketdump/link_6.c

    ref07202 re4e94c38  
    44 */
    55
     6#include "config.h"
    67#include "libtrace_int.h"
    78#include <sys/types.h>
     
    1011#include "libpacketdump.h"
    1112#include "libtrace.h"
     13
     14#include "arphrd.h"
    1215
    1316DLLEXPORT void decode(int link_type ,const char *pkt,unsigned len)
     
    4245        /* Do we recognise the hardware address type? */
    4346        ret=trace_get_payload_from_meta(pkt, &linktype, &len);
    44         /*type = arphrd_type_to_libtrace(ntohs(sll->hatype)); */
    45         if (linktype != 65535) {
    46                 decode_next(ret, len, "link", linktype);
    47                 /*decode_next(pkt + sizeof(*sll), len - sizeof(*sll), "link", type);*/
    48                 return;
    49         }
     47       
     48        if (ntohs(sll->hatype) == ARPHRD_ETHER ||
     49                                ntohs(sll->hatype) == ARPHRD_LOOPBACK)
     50                decode_next(pkt + sizeof(*sll), len - sizeof(*sll), "eth", ntohs(sll->protocol));
     51       
     52        else
     53                decode_next(ret, len, "link", ntohs(sll->hatype));
    5054
    51         /* Meh.. pass it off to eth decoder */
    52         decode_next(pkt + sizeof(*sll), len - sizeof(*sll), "eth", ntohs(sll->protocol));
    53 
     55        return;
     56       
    5457}
    5558
Note: See TracChangeset for help on using the changeset viewer.