Hi,

We found a bug in IPv6 code. Issue was realized when TFTP
download stopped while chsum value was being rolled over.

Problem is in IPv6/UDP cksum calculation logic.
Made it compliant to RFC2460 fixed the issue.


Signed-off-by: TAKENAGA Yoshinobu <[email protected]>
---
src/net/ipv6.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/src/net/ipv6.c b/src/net/ipv6.c
index c5bead1..5fc61df 100644
--- a/src/net/ipv6.c
+++ b/src/net/ipv6.c
@@ -523,6 +523,9 @@ static int ipv6_tx ( struct io_buffer *iobuf,
                *trans_csum = ipv6_pshdr_chksum ( iphdr, len,
                                                  tcpip_protocol->tcpip_proto,
                                                  *trans_csum );
+               /* RFC 2460 8.1: IPV6/UDP csum can't be zero */
+               if ( *trans_csum == 0 && tcpip_protocol->tcpip_proto == IP_UDP )
+                       *trans_csum = 0xFFFF;
        }

        /* Print IPv6 header for debugging */
--
1.9.1



// Thanks,
// Takenaga


_______________________________________________
ipxe-devel mailing list
[email protected]
https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel

Reply via email to