[ipxe-devel] [PATCH] Fix uninitialized variable in tftp_process_multicast

Luca Versari veluca93 at gmail.com
Wed Sep 14 11:53:55 UTC 2016


Hi,
I've had some problem with making TFTP multicast (RFC 2090) on my
network. After some debugging, I managed to find out that the socket
variable in the tftp_process_multicast function had not been
initialized, making the udp receiver fail to receive the packet.

I'll write the diff in this email.

diff --git a/src/net/udp/tftp.c b/src/net/udp/tftp.c
index 4255472..7e72e00 100644
--- a/src/net/udp/tftp.c
+++ b/src/net/udp/tftp.c
@@ -601,6 +601,8 @@ static int tftp_process_multicast ( struct
tftp_request *tftp,
        char *mc_end;
        int rc;

+       /* Initialize the socket variable */
+       memset ( &socket, 0, sizeof ( socket ) );
        /* Split value into "addr,port,mc" fields */
        memcpy ( buf, value, sizeof ( buf ) );
        addr = buf;



More information about the ipxe-devel mailing list