[ofw] [bug] QueryAddressList doesn't increment counter

Leonid Keller leonid at mellanox.co.il
Tue Oct 11 05:19:56 PDT 2011


While merging our repositories I came across something that looks like a bug.

// Nd_provider.cpp:QueryAddressList()

                for (cnt = 0, ai = res; ai; ai = ai->ai_next) {
                                if (SUCCEEDED(ai->ai_flags)) {
                                                pAddressList->Address[cnt].iSockaddrLength = ai->ai_addrlen;
                                                pAddressList->Address[cnt].lpSockaddr = (LPSOCKADDR) offset;
                                                RtlCopyMemory(offset, ai->ai_addr, ai->ai_addrlen);
                                                offset += ai->ai_addrlen;
                                }
                }

Shouldn't it be
                                                pAddressList->Address[cnt++].lpSockaddr = (LPSOCKADDR) offset;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20111011/819535eb/attachment.html>


More information about the ofw mailing list