[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
(usagi-users 04082) mip6d portability issues
- To: usagi-users@xxxxxxxxxxxxxxxxx
- Subject: (usagi-users 04082) mip6d portability issues
- From: Jozsef Kovacs <jozsef.kovacs@xxxxxxxxx>
- Date: Fri, 07 Nov 2008 02:20:04 +0100
- Reply-to: usagi-users@xxxxxxxxxxxxxxxxx
- User-agent: Thunderbird 2.0.0.17 (Windows/20080914)
Dear all,
I have encountered some problems porting mip6d to a different
architecture. The daemon showed incorrect behavior in movement.c:
md_create_router()
<code>
if (olen < sizeof(struct nd_opt_hdr) + iface->hwalen)
goto free_rtr;
</code>
nd_opt_hdr is not a packed struct (defined in netinet/icmp6.h) and it's
not guaranteed that the length of the struct (two uint8_t fields) will
be 2 bytes on every architecture, thereby dropping a completely valid RA
packet. In my case on an arm device the size of the struct was 4bytes.
By fixing this the daemon worked correctly, but there still might be
some hidden bugs caused by sizeof(struct) checks.
Regards,
Jozsef