Hi Alex,

At 23:02 22/01/2008, Alex Rousskov wrote:
in_addr is a C structure without a constructor so you cannot cast an
integer to it. The structure has a single member of uint32_t type. If
that type is the same as DWORD, then you can do C tricks with pointers,
converting DWORD address into in_addr address and then dereferencing it
for comparison with the "c" object. I do not know whether those tricks
are kosher alignment-wise.

Alternatively, you can decompose the structure to initialize it, like
the following code does. There is probably a cleaner way to do it.

--- ACLARP.cc   20 Jan 2008 17:23:19 -0000      1.27
+++ ACLARP.cc   22 Jan 2008 21:52:40 -0000
@@ -568,7 +568,9 @@

     /* Find MAC address from net table */
     for (i = 0 ; i < NetTable->dwNumEntries ; i++) {
- if ((c == (struct in_addr)NetTable->table[i].dwAddr) && (NetTable->table[i].dwType > 2)) {
+        in_addr a;
+        a.s_addr = NetTable->table[i].dwAddr;
+        if (c == a && (NetTable->table[i].dwType > 2)) {
             arpReq.arp_ha.sa_family = AF_UNSPEC;
memcpy(arpReq.arp_ha.sa_data, NetTable->table[i].bPhysAddr, NetTable->table[i].dwPhysAddrLen);
         }

HTH,

Yes, it works,
Thanks :-)

But after the commit for bug #1923 there is a new entry ....

ESIInclude.cc
..\..\..\src\ESIInclude.cc(323) : error C2248: 'HttpHeader::removeConnectionHeaderEntries' : cannot access protected member declared in class 'HttpHeader' c:\work\nt-3.0\src\HttpHeader.h(257) : see declaration of 'HttpHeader::removeConnectionHeaderEntries'
        c:\work\nt-3.0\src\HttpHeader.h(195) : see declaration of 'HttpHeader'

Regards

Guido



-
========================================================
Guido Serassio
Acme Consulting S.r.l. - Microsoft Certified Partner
Via Lucia Savarino, 1           10098 - Rivoli (TO) - ITALY
Tel. : +39.011.9530135  Fax. : +39.011.9781115
Email: [EMAIL PROTECTED]
WWW: http://www.acmeconsulting.it/

Reply via email to