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

Hefty, Sean sean.hefty at intel.com
Tue Oct 11 08:08:45 PDT 2011


>                 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;

This is a bug.  Only a single address would be returned.  I will commit a fix.



More information about the ofw mailing list