------------------------------------------------------------ revno: 5206 committer: Diego Biurrun <diego@xxxxxxxxxx> branch nick: trunk timestamp: Mon 2010-11-29 17:16:47 +0100 message: Drop pointless (and harmful) typedef from pseudo_v6 struct. modified: lib/tool/checksum.c -- lp:hipl https://code.launchpad.net/~hipl-core/hipl/trunk Your team HIPL core team is subscribed to branch lp:hipl. To unsubscribe from this branch go to https://code.launchpad.net/~hipl-core/hipl/trunk/+edit-subscription
=== modified file 'lib/tool/checksum.c' --- lib/tool/checksum.c 2010-11-29 16:13:31 +0000 +++ lib/tool/checksum.c 2010-11-29 16:16:47 +0000 @@ -29,16 +29,17 @@ uint8_t protocol; uint16_t packet_length; }; -typedef struct pseudo_v6 { - struct in6_addr src; + +struct pseudo_v6 { + struct in6_addr src; struct in6_addr dst; uint16_t length; uint16_t zero1; uint8_t zero2; uint8_t next; -} pseudo_v6; +}; -/** @todo this is redundant with pseudo_v6 */ +/** @todo this is redundant with struct pseudo_v6 */ struct pseudo_header6 { unsigned char src_addr[16]; unsigned char dst_addr[16]; @@ -117,15 +118,15 @@ void *data, uint16_t len) { uint32_t chksum = 0; - pseudo_v6 pseudo; - memset(&pseudo, 0, sizeof(pseudo_v6)); + struct pseudo_v6 pseudo; + memset(&pseudo, 0, sizeof(struct pseudo_v6)); pseudo.src = *src; pseudo.dst = *dst; pseudo.length = htons(len); pseudo.next = protocol; - chksum = inchksum(&pseudo, sizeof(pseudo_v6)); + chksum = inchksum(&pseudo, sizeof(struct pseudo_v6)); chksum += inchksum(data, len); chksum = (chksum >> 16) + (chksum & 0xffff);