Home My Page Projects Code Snippets Project Openings DPWS Core
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files Mediawiki

[#397] bug when calling al_get_netif_info on specific platforms

Date:
2013-04-15 16:17
Priority:
3
State:
Open
Submitted by:
Antoine Hincelin (ahincelin)
Assigned to:
Stéphane ROUGES (srouges)
Target Fix Version:
Unassigned
Product:
DPWS Core
Operating System:
BSDI
Component:
AL
Version:
none
Severity:
normal
Resolution:
Fixed
Hardware:
none
URL:
Summary:
bug when calling al_get_netif_info on specific platforms

Detailed description
BSD versions (alNET_Ios.c, alNET_Bsd_4_3.c, etc.)

in al_register_interface() function,
nifs[ nb_nifs ].addr_nb is not initalized


proposed fix:

/* add following line */
nifs[ nb_nifs ].addr_nb = 0;

if( ipv4_address != NULL )
{
memcpy( addresses, ipv4_address, sizeof ( al_sockaddr_t ) );
addresses++;
nifs[ nb_nifs ].addr_nb++;
}
if( ipv6_address != NULL )
{
memcpy( addresses, ipv6_address, sizeof ( al_sockaddr_t ) );
nifs[ nb_nifs ].addr_nb++;
}

Message  ↓
Date: 2014-02-12 13:51
Sender: Stéphane ROUGES

Blind fix accepted (platforms are not part of official DPWSCore supported platforms).

Date: 2013-06-28 07:57
Sender: Antoine Hincelin

Date: 2013-06-28 07:52
Sender: Antoine Hincelin

There's also a memory leak in al_register_interface() on BSD platform.
Call to getifaddrs() should be followed by freeifaddrs().
A patch is attached.

Attachments:
Size Name Date By Download
727 bytesalNet_Bsd_4_3.c.patch2013-06-28 07:57ahincelinalNet_Bsd_4_3.c.patch
Field Old Value Date By
ResolutionNone2014-02-12 13:51srouges
assigned_tonone2014-02-11 17:00srouges
File Added60: alNet_Bsd_4_3.c.patch2013-06-28 07:57ahincelin