buglwIP - A Lightweight TCP/IP stack - Bugs: bug #53325, NetBIOS Responder should respond...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #53325: NetBIOS Responder should respond to "*" names for lwIP 2.0.3

Submitter:  Ray Abram <rambooka>
Submitted:  Mon 12 Mar 2018 02:44:59 AM UTC
   
 
Category:  apps Severity:  3 - Normal
Item Group:  Feature Request Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  2.0.3

Jump to the original submission

Tue 03 Apr 2018 08:20:57 PM UTC, comment #8: 

Pushed with another slight modification.

Thanks for the patch.

Simon Goldschmidt <goldsimon>
Group administrator
Thu 15 Mar 2018 07:51:38 AM UTC, comment #7: 

Next iteration including Jens' comments

(file #43553)

Dirk Ziegelmeier <dziegel>
Group administrator
Wed 14 Mar 2018 08:46:36 PM UTC, comment #6: 

Some notes:

  • First part of struct netbios_answer is afaik same as struct netbios_name_hdr, reuse (like struct netbios_resp does) or use the same member names or at least the same code style
  • The pbuf_free(p); at end of netbiosns_recv() is now inside if (netif_default != NULL) so it leaks if netif_default == NULL
  • One memcpy should be MEMCPY
  • Move size_t i; declaration to beginning of netbiosns_set_name()
  • When doing the upper case conversion you might as well skip the memcpy before and do toupper directly from 'hostname'
  • The upper case enforcement doesn't apply if NETBIOS_LWIP_NAME is defined (if that's desired)
Jens Nielsen <deft>
Wed 14 Mar 2018 07:22:12 PM UTC, comment #5: 

If we start checking the name, maybe we should check for valid characters, too.

Regarding toupper(), fortunately this is simple to implement :-)

Simon Goldschmidt <goldsimon>
Group administrator
Wed 14 Mar 2018 07:11:31 PM UTC, comment #4: 

I created a patch against git head.

TODO: the code uses toupper() - needs to be abstracted in arch.h

(file #43546)

Dirk Ziegelmeier <dziegel>
Group administrator
Tue 13 Mar 2018 11:33:12 PM UTC, comment #3: 

the author of the code i used has given his permission for it to be used

here is his reponce to me asking (the comment at the bottom of the page)
http://www.xpablo.cz/?p=751#more-751



Ray Abram <rambooka>
Mon 12 Mar 2018 07:21:25 PM UTC, comment #2: 

An alternative could be to ask ALL authors of the code you copied for permission to relicense under lwIP's BSD license.

Dirk Ziegelmeier <dziegel>
Group administrator
Mon 12 Mar 2018 07:02:45 PM UTC, comment #1: 

The linked code you said you derived your work from seems to be LGPL licensed. As such, we can't take this, I'm afraid.

I'm open to an implementation for this that respects licenses.

Simon Goldschmidt <goldsimon>
Group administrator
Mon 12 Mar 2018 02:44:59 AM UTC, original submission:  

If you want to ask a PC what it's NetBIOS name is then you send that PC a query with the name * and then that pc sends back it's NetBIOS name

When you use Angry IP to scan all PC's on a network, Angry IP sends a NetBIOS request to each PC with the NetBIOS name as *
the file "netbiosns.c" does NOT know how to handle a * name

The Arduino NetBIOS code base for the ESP8266 has an implementation that does respond to * names. the code is here: https://github.com/esp8266/Arduino/commit/1f7989b31d26d7df9776a08f36d685eae7ac8f99

I have taken the concepts from it and merged them into lwIP V2.0.3's "lwip\apps\netbiosns\netbiosns.c" so that it can respond to NetBIOS commands addressed to *

maybe my modifications can be merged into the lwIP next release ?

I have also changed the api "netbiosns_set_name()" to make the incoming name into upper case as per NetBIOS spec's

Ray Abram <rambooka>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #43553:  netbios.patch added by dziegel (6KiB - text/x-patch)
file #43546:  netbios.patch added by dziegel (6KiB - text/x-patch)
file #43521:  netbiosns.c added by rambooka (16KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by deft (Posted a comment)
  • -email is unavailable- added by dziegel (Posted a comment)
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by rambooka (Submitted the item)
  • -email is unavailable- added by rambooka
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-04-03 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2018-03-15 dziegel Attached File- Added netbios.patch, #43553
    2018-03-14 dziegel Attached File- Added netbios.patch, #43546
    2018-03-14 dziegel StatusInvalid None
        Open/ClosedClosed Open
    2018-03-12 goldsimon StatusNone Invalid
        Open/ClosedOpen Closed
    2018-03-12 rambooka Attached File- Added netbiosns.c, #43521
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code