NetServices maintenance and which one to use?

03 Apr 2012

Hello,

I have been using Donatien Garniers NetServicesSource for quite some time and have found a few bugs here and there that I have corrected in my own project source only, but overall the library has proven to be very useful and fairly complete. However, recently I ran into some RAM issues and noticed that there was another NetServices, actually several in the Code repository. I am very confused as to which one is the de-facto maintained version. I see these versions:

Segundo Equipo NetServices http://mbed.org/users/segundo/libraries/NetServices/ljhqix

Daniel Peter NetServices http://mbed.org/users/mbed714/libraries/NetServices/lfhvuw

Donatien Garnier NetServicesSource http://mbed.org/users/donatien/programs/NetServicesSource/5znqn

Donatien Garnier's name is all over the NetServices library, I believe he is the originator but maybe not the current maintainer..?

Who is actually maintaining this library? I think we need ONE maintainer, not several. If someone wants to fork the source, then they need to be very explicit as to why they are forking it and describe the differences in the summary page. Right now, its very hard to tell which NetServices library someone should use.

Case in point. I found a bug in the NetServicesSource (Donatien Garnier) code and corrected it in my source, the bug was related to incorrect checksums on IGMP packets. When I switched to the Segundo Equipo NetServices, I found that the same bug was in that code as well, as would be expected, so I corrected it there too. I prefer the Segundo Equipo library as he has done a great job of reducing the RAM footprint of the library.

Anyway. I would like to post the checksum bug I found so someone can update the library to correct it, or the actual maintainer can find a better fix...

My fix applies to the singe file "/drv/eth/eth_drv.cpp", this fixes my problem where the IGMP UDP packets had incorrect checksums so some network switches would ignore them.

In Segundo's code I will list the line numbers and the code I added:

// fix IGMP packet checksums in file: /drv/eth/eth_drv.cpp
40: #include "lwip/inet_chksum.h" 
58:
  do {

    // eeb:start 20111121
    // recalculate the ip header checksum again, for some reason it got 
    // mangled on the way here, only for IGMP type messages
    static u16_t new_chksum = 0;
    new_chksum = 0;
    static u8_t ip_header_len;
    ip_header_len = 24; // always 24?  let's assume so for now
    // determine if this is an IGMP message
    if (*((u8_t *)p->payload+23) == 0x02) {
        // clear bytes 24 and 25 (these are the old incorrect ip header checksum values)
        *((u8_t *)p->payload+24) = 0x00;
        *((u8_t *)p->payload+25) = 0x00;
        // claculate new checksum for ip header section
        new_chksum = inet_chksum( ((u8_t *)p->payload+14), ip_header_len);
        // insert the checksum
        *((u8_t *)p->payload+24) = (u8_t)(new_chksum);
        *((u8_t *)p->payload+25) = (u8_t)(new_chksum >> 8);
    }
    // eeb:end
  
    pEth->write((const char *)p->payload, p->len);
  } while((p = p->next)!=NULL);
09 Apr 2012

I too have had the same trouble. There's a minefield of versions out there with very little difference. Normally, I'd use commit/change activity as an indicator of life, but with both 'major' versions (the Segundo and Donatien) idle for over 18 months, there's no real winner.

For now, I'll likely try the Segundo version, if only, as you note, for the RAM size, but we really do need someone to either step up and maintain, or, if there's little to no maintenance to be done, some sort of message on the library indicating that "This is good enough for 95% of uses, use this one".

28 May 2012

what became of this discussion?