Bug 9085 - NMB registration for a duplicate workstation fails with registration refuse
Summary: NMB registration for a duplicate workstation fails with registration refuse
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Nmbd (show other bugs)
Version: 3.6.3
Hardware: All All
: P5 major
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-08 13:12 UTC by hargagan
Modified: 2012-08-28 10:42 UTC (History)
1 user (show)

See Also:


Attachments
AD packet trace during duplicate workstation join which fails properly (507.90 KB, application/vnd.tcpdump.pcap)
2012-08-08 13:12 UTC, hargagan
no flags Details
Packet traces with NMBD acting as WINS (596.16 KB, application/vnd.tcpdump.pcap)
2012-08-08 13:17 UTC, hargagan
no flags Details
NMBD log capturing the "Request Refused" error from nmbd acting as WINS (1.92 MB, application/octet-stream)
2012-08-08 13:19 UTC, hargagan
no flags Details
Probable fix for the issue for duplicate registration when NMBD acts as WINS (658 bytes, patch)
2012-08-08 13:21 UTC, hargagan
jra: review+
ddiss: review+
asn: review+
jra: review? (gd)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hargagan 2012-08-08 13:12:57 UTC
Created attachment 7748 [details]
AD packet trace during duplicate workstation join which fails properly

The name registration request for a new workstation to the nmbd acting as a wins server checks for various things. One of the check is for the presence of the same name. 

There is a difference in the behavior of nmbd and the active directory. The nmbd fails with following error :

[2012/07/05 14:07:51,  3] nmbd/nmbd_winsserver.c:2046(wins_process_name_release_request)
  wins_process_name_release_request: Unique name release for name XPMG<00> IP 172.16.43.96
[2012/07/05 14:07:51,  3] nmbd/nmbd_winsserver.c:2089(wins_process_name_release_request)
  wins_process_name_release_request: Refusing request to release name XPMG<00> as IP 172.16.43.96 is not one of the known IP's for this name.
[2012/07/05 14:07:51,  4] nmbd/nmbd_packets.c:945(reply_netbios_packet)
  reply_netbios_packet: sending a reply of packet type: nmb_rel XPMG<00> to ip 172.16.43.96 for id 33953
[2012/07/05 14:07:51,  4] libsmb/nmblib.c:106(debug_nmb_packet)

This is different from the way active directory acting as a WINS. By capturing the packet traces in for nmbd and AD, we see the difference. 

Attaching the wins_ad_duplicate_wks_join.pcap, where the packet 2273,2274 has the response for the nbns query.

I will attach the nmbd.log and the packet traces for nmbd acting as WINS shortly.
Comment 1 hargagan 2012-08-08 13:17:12 UTC
Created attachment 7749 [details]
Packet traces with NMBD acting as WINS

The packet traces are captured with nmbd acting as wins. During that for duplicate workstation registration, the error returned is "Request refused".
Comment 2 hargagan 2012-08-08 13:19:10 UTC
Created attachment 7750 [details]
NMBD log capturing the "Request Refused" error from nmbd acting as WINS

The nmbd log giving the error for duplicate registration as "Request Refused". This is not matching with the active directory acting as WINS. So the workstation join to the samba domain doesn't fail.
Comment 3 hargagan 2012-08-08 13:21:23 UTC
Created attachment 7751 [details]
Probable fix for the issue for duplicate registration when NMBD acts as WINS

Proposing the fix for the duplicate workstation registration issue.
Comment 4 hargagan 2012-08-08 13:22:22 UTC
Similar issue is seen with samba 3.4.3 too.
Comment 5 Jeremy Allison 2012-08-16 23:27:04 UTC
Comment on attachment 7751 [details]
Probable fix for the issue for duplicate registration when NMBD acts as WINS

Looks completely correct to me. Requesting Additional review to add to 3.5.next and 3.6.next.
Comment 6 Jeremy Allison 2012-08-17 19:03:20 UTC
Comment on attachment 7751 [details]
Probable fix for the issue for duplicate registration when NMBD acts as WINS

Trying to get some review :-).
Comment 7 Andreas Schneider 2012-08-20 09:22:25 UTC
Comment on attachment 7751 [details]
Probable fix for the issue for duplicate registration when NMBD acts as WINS

Looks fine for me.
Comment 8 David Disseldorp 2012-08-20 10:43:09 UTC
Comment on attachment 7751 [details]
Probable fix for the issue for duplicate registration when NMBD acts as WINS

Looks good.
Comment 9 Jeremy Allison 2012-08-20 15:21:30 UTC
Re-assigning to Karolin for inclusion in 3.5.x and 3.6.x.

Jeremy.
Comment 10 Karolin Seeger 2012-08-28 07:36:29 UTC
Pushed to v3-5-test and v3-6-test (and verified that it's fixed in master).
Closing out bug report.

Thanks!
Comment 11 hargagan 2012-08-28 10:42:39 UTC
I really appreciate the response on the bug. Thanks everybody !