Changeset 6654714
- Timestamp:
- 11/15/17 11:59:35 (3 years ago)
- Branches:
- cachetimestamps, develop, dpdk-ndag, etsilive, master, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance
- Children:
- 9993cde
- Parents:
- e844ff2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/protocols_l3.c
r5732e9b r6654714 682 682 uint16_t ethertype; 683 683 uint32_t remaining; 684 uint16_t*csum_ptr;684 char *csum_ptr; 685 685 686 686 uint8_t safety[65536]; … … 699 699 return NULL; 700 700 701 csum_ptr = &ip->ip_sum;701 csum_ptr = (char *)(&ip->ip_sum); 702 702 703 703 /* I hate memcpys, but this is the only truly safe way to … … 716 716 *csum = ntohs(*csum); 717 717 718 return csum_ptr;718 return (uint16_t *)csum_ptr; 719 719 } 720 720 -
lib/protocols_transport.c
r317e903 r6654714 448 448 uint32_t sum = 0; 449 449 uint8_t proto = 0; 450 uint16_t*csum_ptr = NULL;450 char *csum_ptr = NULL; 451 451 int plen = 0; 452 452 … … 483 483 header = trace_get_payload_from_tcp(tcp, &remaining); 484 484 485 csum_ptr = &tcp->check;485 csum_ptr = (char *)(&tcp->check); 486 486 487 487 memcpy(ptr, tcp, tcp->doff * 4); … … 498 498 header = trace_get_payload_from_udp(udp, &remaining); 499 499 500 csum_ptr = &udp->check;500 csum_ptr = (char *)(&udp->check); 501 501 memcpy(ptr, udp, sizeof(libtrace_udp_t)); 502 502 … … 514 514 header = trace_get_payload_from_icmp(icmp, &remaining); 515 515 516 csum_ptr = &icmp->checksum;516 csum_ptr = (char *)(&icmp->checksum); 517 517 memcpy(ptr, icmp, sizeof(libtrace_icmp_t)); 518 518 … … 543 543 //assert(0); 544 544 545 return csum_ptr;545 return (uint16_t *)csum_ptr; 546 546 } 547 547 -
libpacketdump/libpacketdump.h
ree6e802 r6654714 47 47 #define DISPLAYS(hdr,x,fmt) DISPLAY_EXP(hdr,x,fmt,htons(hdr->x)) 48 48 #define DISPLAYL(hdr,x,fmt) DISPLAY_EXP(hdr,x,fmt,htonl(hdr->x)) 49 #define DISPLAYIP(hdr,x,fmt) DISPLAY_EXP(hdr,x,fmt,inet_ntoa(*(struct in_addr*) &hdr->x))49 #define DISPLAYIP(hdr,x,fmt) DISPLAY_EXP(hdr,x,fmt,inet_ntoa(*(struct in_addr*)(void *)(&hdr->x))) 50 50 51 51 -
libpacketdump/link_15.c
ree6e802 r6654714 69 69 70 70 /* Check for extended bitmasks */ 71 ptr = (uint32_t *) &(rtap->it_present);71 ptr = (uint32_t *) (char *)(&(rtap->it_present)); 72 72 73 73 if ( (rtap_pres) & (1 << TRACE_RADIOTAP_EXT) )
Note: See TracChangeset
for help on using the changeset viewer.