Changeset 539 for trunk/src/ocatroute.c
- Timestamp:
- 02/05/10 11:59:17 (2 years ago)
- File:
-
- 1 edited
-
trunk/src/ocatroute.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ocatroute.c
r535 r539 265 265 266 266 267 void set_tunheader(char *buf, uint32_t tunhdr) 268 { 269 uint32_t *ibuf = (uint32_t*) buf; 270 *ibuf = tunhdr; 271 } 272 273 274 uint32_t get_tunheader(char *buf) 275 { 276 uint32_t *ibuf = (uint32_t*) buf; 277 return *ibuf; 278 } 279 280 267 281 void *socket_receiver(void *p) 268 282 { … … 512 526 else 513 527 { 514 *((uint32_t*) buf) = *peer->tunhdr;528 set_tunheader(buf, *peer->tunhdr); 515 529 memcpy(buf + 4 + sizeof(struct ether_header), peer->fragbuf, len); 516 530 memcpy(eh->ether_shost, CNF(ocat_hwaddr), ETHER_ADDR_LEN); … … 864 878 } 865 879 866 if ( *((uint32_t*)buf) == CNF(fhd_key[IPV6_KEY]))880 if (get_tunheader(buf) == CNF(fhd_key[IPV6_KEY])) 867 881 { 868 882 if (((rlen - 4) < IP6HLEN)) … … 883 897 dest = &((struct ip6_hdr*) &buf[4])->ip6_dst; 884 898 } 885 else if ( *((uint32_t*)buf) == CNF(fhd_key[IPV4_KEY]))899 else if (get_tunheader(buf) == CNF(fhd_key[IPV4_KEY])) 886 900 { 887 901 if (((rlen - 4) < IPHDLEN)) … … 904 918 else 905 919 { 906 log_msg(LOG_ERR, "protocol 0x%08x not supported. dropping frame.", ntohl( *((uint32_t*)buf)));920 log_msg(LOG_ERR, "protocol 0x%08x not supported. dropping frame.", ntohl(get_tunheader(buf))); 907 921 continue; 908 922 }
Note: See TracChangeset
for help on using the changeset viewer.
