Will do. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Ivan Delamer Sent: Wednesday, January 23, 2013 10:17 AM To: [email protected] Subject: Re: [lwip-users] nd6.c byte order issues
Hey Zach, Can you submit this issue, as well as the netif up/down issue, as bugs in Savannah? That way I won't forget to look into it, and we can discuss it if necessary. Cheers Ivan > Date: Tue, 22 Jan 2013 22:47:59 +0000 > From: Zach Smith <[email protected]> > To: "[email protected]" <[email protected]> > Subject: [lwip-users] nd6.c byte order issues > Message-ID: > > <14baf4371e9f044d84f56727d2d325111d292...@ch1prd0410mb368.namprd04.pro > d.outlook.com> > > Content-Type: text/plain; charset="us-ascii" > > It seems to me that the current master version of nd6_input function > has some byte ordering problems. > > For example, in nd6_input() > > Line 439: > case ND6_OPTION_TYPE_MTU: > { > struct mtu_option * mtu_opt; > mtu_opt = (struct mtu_option *)buffer; > if (mtu_opt->mtu >= 1280) { > #if LWIP_ND6_ALLOW_RA_UPDATES > inp->mtu = mtu_opt->mtu; > #endif /* LWIP_ND6_ALLOW_RA_UPDATES */ > } > break; > } > > As mtu_opt->mtu is a u32_t, it seems to me like it should be this: > > case ND6_OPTION_TYPE_MTU: > { > struct mtu_option * mtu_opt; > mtu_opt = (struct mtu_option *)buffer; > if (ntohl(mtu_opt->mtu) >= 1280) { /* zs: added > ntohl() */ > #if LWIP_ND6_ALLOW_RA_UPDATES > inp->mtu = ntohl(mtu_opt->mtu); /* zs: added > ntohl() */ > #endif /* LWIP_ND6_ALLOW_RA_UPDATES */ > } > break; > } > > Am I correct that this is a bug? > There are a few other accesses in nd6_input() like this that I think > should be done using ntohl() or ntohs(). > > -Zach _______________________________________________ lwip-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lwip-users _______________________________________________ lwip-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lwip-users
