sharing port with nmdb

Laurent.Boulard at Laurent.Boulard at
Sun Oct 17 14:32:02 GMT 1999


I'm a french student from Ecole des Mines of Nantes. Students of my
engineering school live in a residence with its own local network,
access to sun workstation at school for working and a Internet access
througth a firewall.
In each room of the residence, we have a RJ25 plug. We just need a
network card and a computer to go on this network. As you can expected,
our network is a jungle with computers running W95 first generation, W95
OSR 2.x, W98, WT workstation and server, W2ky beta, Linux, BeOS and
MacOS (about 350 people).
And we use Winpopup and compatible to join each other.

Since two years now, I was looking inside samba to understand how things
work (and don't work !!). Once I understood well the netbios and smb
protocol, I started to program a winpop server to handle messages send
via \\.\MAILSLOT\MESSNGR because I couldn't find a server for mailslots
and doesn't want to hack each new version of samba to have a way of
getting ans sending mailslots transactions. Messages send with Netbios
session could be received with help of smbd ('message command = ...').
Also I needed to make netbios name resolution for sending mailslots
transaction packets.

So, I needed to listen to broadcast and unicast udp packet on port 137
and 138. I had to listen to port 137 because W95 send answer to name
resolution always on this port (it's s..k a lot).
With the help of option SOCK_REUSEADDR, every thing was fine (I stayed
near nmbd whitout disturbing it) but came the new version of the kernel

Try as root to do 'nmblookup -r -A IpOfWindows95Computer'. It works with
2.0 kernel but not with new 2.2 serie (2.2.12 for me actually). Why ?
The developpers of the kernel made the (security) choice of not allowing
a process to listen to socket of other. I think it's a good idea but
there are programs that use the ability of shared socket between

Does someone can give me a clue on how I can continue to work on my
server ? I don't want to patch samba :((

samba is a good server but a poor client ...

   ("`-''-/").___..--''"`-._          |\      _,,,---,,_
   `6_ 6  )   `-.  (     ).`-.__.`)   /,`.-'`'    -.  ;-;;,_
   (_Y_.)'  ._   )  `._ `. ``-..-'   |,4-  ) )-,_..;\ (  `'-'
 _..`--'_..-_/  /--'_.' ,'          '---''(_/--'  `-'\_)
(il),-''  (li),'  ((!.-'        Laurent.Boulard at

More information about the samba-technical mailing list