Changeset 1577
- Timestamp:
- 05/04/10 16:08:24 (3 years ago)
- File:
-
- 1 edited
-
trunk/lib/format_tsh.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/format_tsh.c
r1519 r1577 153 153 if ((numbytes=wandio_read(libtrace->io, 154 154 buffer2, 155 (size_t)sizeof(libtrace_ip_t) ))156 != sizeof(libtrace_ip_t) ) {155 (size_t)sizeof(libtrace_ip_t)+16)) /* 16 bytes of transport header */ 156 != sizeof(libtrace_ip_t)+16) { 157 157 trace_set_err(libtrace,errno,"read(%s)", 158 158 libtrace->uridata); … … 160 160 } 161 161 162 #if 0 162 163 /* IP Options aren't captured in the trace, so leave room 163 164 * for them, and put the transport header where it "should" be … … 173 174 return -1; 174 175 } 176 #endif 175 177 176 178 if (tsh_prepare_packet(libtrace, packet, packet->buffer, packet->type, … … 204 206 * IP options, but we'll pretend we have them 205 207 */ 208 #if 0 206 209 return 16+((libtrace_ip_t*)packet->payload)->ip_hl*4; 210 #else 211 return 16+sizeof(libtrace_ip_t); 212 #endif 207 213 } 208 214 209 215 static int tsh_get_wire_length(const libtrace_packet_t *packet) { 210 return ((libtrace_ip_t*)packet->payload)->ip_len;216 return ntohs(((libtrace_ip_t*)packet->payload)->ip_len); 211 217 } 212 218
Note: See TracChangeset
for help on using the changeset viewer.
