Hi all,
What is the purpose of the padding in this function?

static struct udp_connection * udp_demux ( struct sockaddr_tcpip *local ) {
                static const struct sockaddr_tcpip empty_sockaddr = { .pad = { 
0, } };
                struct udp_connection *udp;

                list_for_each_entry ( udp, &udp_conns, list ) {
                                if ( ( ( udp->local.st_family == 
local->st_family ) ||
                                       ( udp->local.st_family == 0 ) ) &&
                                     ( ( udp->local.st_port == local->st_port ) 
||
                                       ( udp->local.st_port == 0 ) ) &&
                                     ( ( memcmp ( udp->local.pad, local->pad,
                                                                  sizeof ( 
udp->local.pad ) ) == 0 ) ||
                                       ( memcmp ( udp->local.pad, 
empty_sockaddr.pad,
                                                                  sizeof ( 
udp->local.pad ) ) == 0 ) ) ) {
                                                return udp;
                                }
                }
                return NULL;
}

What is the purpose of these checks in the expression?
     ( ( memcmp ( udp->local.pad, local->pad,
                                 sizeof ( udp->local.pad ) ) == 0 ) ||
       ( memcmp ( udp->local.pad, empty_sockaddr.pad,
                                  sizeof ( udp->local.pad ) ) == 0 ) ) ) {



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

Reply via email to