Changeset 17dc71c


Ignore:
Timestamp:
11/28/12 15:49:05 (9 years ago)
Author:
Richard Sanger <rjs51@…>
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:
1935565
Parents:
d500159
Message:

Fix silly mistake that was breaking get_link_type and get_link_direction. Changed data sizes in these functions to match those in the sockaddr_ll header

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_linux.c

    rd500159 r17dc71c  
    10941094}
    10951095
    1096 static inline libtrace_linktype_t get_libtrace_link_type(int linktype){
     1096static inline libtrace_linktype_t get_libtrace_link_type(uint16_t linktype){
    10971097        /* Convert the ARPHRD type into an appropriate libtrace link type */
    10981098        switch (linktype) {
     
    11151115}
    11161116static libtrace_linktype_t linuxnative_get_link_type(const struct libtrace_packet_t *packet) {
    1117         int linktype=(((struct libtrace_linuxnative_header*)(packet->buffer))
     1117        uint16_t linktype=(((struct libtrace_linuxnative_header*)(packet->buffer))
    11181118                                ->hdr.sll_hatype);
    11191119        return get_libtrace_link_type(linktype);
    11201120}
    11211121static libtrace_linktype_t linuxring_get_link_type(const struct libtrace_packet_t *packet) {
    1122         int linktype= GET_SOCKADDR_HDR(packet->buffer)->sll_hatype;
     1122        uint16_t linktype= GET_SOCKADDR_HDR(packet->buffer)->sll_hatype;
    11231123        return get_libtrace_link_type(linktype);
    11241124}
    11251125
    1126 static inline libtrace_direction_t get_libtrace_direction(int pkttype){
     1126static inline libtrace_direction_t get_libtrace_direction(uint8_t pkttype){
    11271127        switch (pkttype) {
    11281128                case PACKET_OUTGOING:
     
    11341134}
    11351135static libtrace_direction_t linuxnative_get_direction(const struct libtrace_packet_t *packet) {
    1136         return get_libtrace_link_type(((struct libtrace_linuxnative_header*)(packet->buffer))->hdr.sll_pkttype);
     1136        return get_libtrace_direction(((struct libtrace_linuxnative_header*)(packet->buffer))->hdr.sll_pkttype);
    11371137}
    11381138static libtrace_direction_t linuxring_get_direction(const struct libtrace_packet_t *packet) {
    1139         return get_libtrace_link_type(GET_SOCKADDR_HDR(packet->buffer)->sll_pkttype);
     1139        return get_libtrace_direction(GET_SOCKADDR_HDR(packet->buffer)->sll_pkttype);
    11401140}
    11411141
Note: See TracChangeset for help on using the changeset viewer.