[En-Nut-Discussion] UdoOutput bug?

Michał 'Khorne' Rzechonek rzechonek at xylab.com
Wed Feb 22 15:55:11 CET 2006


Hello, it's me again.

I noticed the following comment in net/ipout.c, function
NutIpOutput:

/*
 * Broadcasts are sent on all network interfaces.
 */

Then there is an iteration through IFTYP_NET interfaces. Hovewer,
this loop does NOT check whether particular interface is actually
configured. So, if you happen to merely register the device with
NutRegisterDevice, the device is added to device list with dev_icb
set to 0.

Sending UDP broadcast before calling IfConfig on this interface
for example to send udp packet through completely different one,
which is configured of course) causes execution of following code:

for (dev = nutDeviceList, rc = 0; dev && rc == 0; dev = dev->dev_next)
{
  if (dev->dev_type == IFTYP_NET)
  {
    //...
    nif = dev->dev_icb;
    //...
    rc = (*nif->if_output) (dev, ETHERTYPE_IP, ha, nb); /* !!! */
  }
};

Marked line is wrong if "nif" is NULL, which is true for registered,
but not cofigured network devices.

Can anyone confirm this please, or just slap me in the face and
correct? ;-)

regards
-- 
Michał 'Khorne' Rzechonek, research & development
Xylab Sp.z o.o, Karmelicka 45/8 Kraków, Poland
tel: +48 12 423 45 55 url: http://www.xylab.com






More information about the En-Nut-Discussion mailing list