Changeset 787


Ignore:
Timestamp:
05/06/06 02:24:13 (7 years ago)
Author:
perry
Message:

Make sure we set ->protocol correctly
->type is an rt type, not a libtrace type

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/linktypes.c

    r786 r787  
    102102                                return; /* Unnecessary */ 
    103103 
     104                        case TRACE_TYPE_NONE: 
    104105                        case TRACE_TYPE_ETH: 
    105106                                /* This should be easy, just prepend the header */ 
     
    113114 
    114115                                hdr->pkttype=0; /* "outgoing" */ 
    115                                 hdr->hatype = ARPHRD_ETHER; 
     116                                if (pcap_dlt_to_libtrace(rt_to_pcap_dlt(packet->type))==TRACE_TYPE_ETH) 
     117                                        hdr->hatype = ARPHRD_ETHER; 
     118                                else 
     119                                        hdr->hatype = ARPHRD_PPP; 
     120                                trace_get_payload_from_link( 
     121                                        trace_get_link(packet), 
     122                                        trace_get_link_type(packet), 
     123                                        &hdr->protocol, 
     124                                        NULL); 
    116125                                break; 
    117126                        default: 
     
    135144                packet->header=tmpbuffer; 
    136145                packet->payload=tmpbuffer+trace_get_framing_length(packet); 
    137                 packet->type=TRACE_TYPE_LINUX_SLL; 
     146                packet->type=pcap_dlt_to_rt(TRACE_DLT_LINUX_SLL); 
    138147                return; 
    139148        } 
Note: See TracChangeset for help on using the changeset viewer.