[U-Boot] [PATCH] [ARM] Change the UDP Checksum code to work with ARM data alignment.

Wolfgang Denk
2008-08-26T22:17:21Z

Dear Tom Evans,

In message <48B38020.4010204@ceos.com.au> you wrote:
>
> I followed Ben's instructions and here's the resulting patch.

I'm sorry, but this patch is corrupted and cannot be applied.

> --- a/net/net.c
> +++ b/net/net.c
> @@ -1494,10 +1494,12 @@ NetReceive(volatile uchar * inpkt, int len)
>
> xsum = ip->ip_p;
> xsum += (ntohs(ip->udp_len));
> - xsum += (ntohl(ip->ip_src) >> 16) & 0x0000ffff;
> - xsum += (ntohl(ip->ip_src) >> 0) & 0x0000ffff;
> - xsum += (ntohl(ip->ip_dst) >> 16) & 0x0000ffff;
> - xsum += (ntohl(ip->ip_dst) >> 0) & 0x0000ffff;

In the original code, there were no spaces but TAB characters used for
indentation. Someone (you?) must have changed this, and in a way that
was not even noticed when you created the patch. This is very
strange. Something is severely broken in your setup.

> + tmp = NetReadIP(&ip->ip_src);
> + xsum += (ntohl(tmp) >> 16) & 0x0000ffff;
> + xsum += (ntohl(tmp) >> 0) & 0x0000ffff;
> + tmp = NetReadIP(&ip->ip_dst);
> + xsum += (ntohl(tmp) >> 16) & 0x0000ffff;
> + xsum += (ntohl(tmp) >> 0) & 0x0000ffff;
>
> sumlen = ntohs(ip->udp_len);
> sumptr = (ushort *) &(ip->udp_src);
> @@ -1520,7 +1522,7 @@ NetReceive(volatile uchar * inpkt, int len)
> xsum = (xsum & 0x0000ffff) + ((xsum >>
> 16) & 0x0000ffff);
^^^^^^^^^^^^^^^^^^^^

Here your mailer wrapped long lines, which also makes the patch
useless.

Please fix and resubmit.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Fascinating, a totally parochial attitude.
-- Spock, "Metamorphosis", stardate 3219.8