Bug 5836 - WINS: Dual IP host registration problem in samba4wins-1.0.6, works in samba3
Summary: WINS: Dual IP host registration problem in samba4wins-1.0.6, works in samba3
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.0
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: ---
Assignee: Stefan Metzmacher
QA Contact: Andrew Bartlett
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-19 09:24 UTC by Krzysztof Olędzki
Modified: 2009-06-02 04:08 UTC (History)
1 user (show)

See Also:


Attachments
network capture: samba3 multi-homed registration (2.29 KB, application/octet-stream)
2009-04-01 13:43 UTC, Krzysztof Olędzki
no flags Details
network capture: samba4wins multi-homed registration (1.46 KB, application/octet-stream)
2009-04-01 13:46 UTC, Krzysztof Olędzki
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Krzysztof Olędzki 2008-10-19 09:24:05 UTC
Dual IP host running samba 3.0/3.2 (olemx, 192.168.0.33/19 192.168.0.44/19)
is able to register both IP addresses to a wins server running samba3 (192.168.0.137) but is not able to do this with samba4 (samba4wins-1.0.6 - 192.168.148.11).

root@olemx:~# egrep "interfaces|netbios" /etc/samba/smb.conf
netbios name = OleMX
interfaces = 192.168.0.33/19 192.168.0.44/19

Registered to samba3 wins server:
root@olemx:~# nmblookup -U 192.168.0.137 -R 'olemx'
querying olemx on 192.168.0.137
192.168.0.33 olemx<00>
192.168.0.44 olemx<00>

Registered to samba4 wins server:
root@olemx:~# nmblookup -U 192.168.148.11 -R 'olemx'
querying olemx on 192.168.148.11
192.168.0.44 olemx<00>

Log from winshook:

Oct 19 16:06:33 xdns1 winshook[90764]: delete OLEMX 20 1224943525
Oct 19 16:06:33 xdns1 winshook[90768]: add OLEMX 20 1224684393 192.168.0.33
Oct 19 16:06:33 xdns1 winshook[90772]: delete OLEMX 03 1224943525
Oct 19 16:06:33 xdns1 winshook[90776]: add OLEMX 03 1224684393 192.168.0.33
Oct 19 16:06:33 xdns1 winshook[90780]: delete OLEMX 00 1224943524
Oct 19 16:06:33 xdns1 winshook[90784]: add OLEMX 00 1224684393 192.168.0.33
Oct 19 16:06:37 xdns1 winshook[90801]: delete OLEMX 20 1224684393 192.168.0.33
Oct 19 16:06:37 xdns1 winshook[90805]: add OLEMX 20 1224684397 192.168.0.44
Oct 19 16:06:37 xdns1 winshook[90809]: delete OLEMX 03 1224684393 192.168.0.33
Oct 19 16:06:37 xdns1 winshook[90813]: add OLEMX 03 1224684397 192.168.0.44
Oct 19 16:06:37 xdns1 winshook[90817]: delete OLEMX 00 1224684393 192.168.0.33
Oct 19 16:06:37 xdns1 winshook[90821]: add OLEMX 00 1224684397 192.168.0.44

---- /usr/local/sbin/winshook: begin ---
#!/bin/sh

echo $* | logger -t "winshook" -i
---- /usr/local/sbin/winshook:  end  ---

# grep hook /usr/local/etc/samba4wins.conf
        wins hook = /usr/local/sbin/winshook

It seems that samba4 first registers 192.168.0.33 but then removes this IP address and registers 192.168.0.44.

There are 4 samba4wins servers: 192.168.148.11, 192.168.148.12, 192.168.148.13, 192.168.148.14 working as wreplPartners but the problem exists even when I disable communication between wreplPartners.
Comment 1 Matthias Dieter Wallnöfer 2008-12-16 16:55:18 UTC
Metze is responsible for this.
Comment 2 Stefan Metzmacher 2009-03-30 05:25:27 UTC
Should be fixed with commit a5b3975cf71f0bf114832c958ba855646c69832c in master
Comment 3 Stefan Metzmacher 2009-03-30 05:27:28 UTC
It's also fixed in samba4wins-1.0.7
Comment 4 Krzysztof Olędzki 2009-04-01 12:30:52 UTC
Unfortunately, it is not fixed in samba4wins-1.0.7.

# /usr/local/sbin/smbd4wins --version
Version 1.0.7-SerNet-Debian-2

The bug is still here and the mentioned commit looks bogus as it fixed
rather totally different problem:

commit a5b3975cf71f0bf114832c958ba855646c69832c
Author: Stefan Metzmacher <me...@sernet.de>
Date:   Wed Jan 16 13:57:50 2008 +0100

    nbt_server: redirect incoming response packets to the correct interface
    
    We may send requests packets (WACK challenges or similar things)
    via a different udp socket than the socket we receive the
    matching response. We need to setup an unexpected handler
    on the nbt sockets and redirect responses to the correct
    nbt_socket. (By redirect I mean we use the correct
    nbt_socket structure, we're *not* resending the packet
    with sendto() via the kernel...)
    
    metze
    (from samba4wins tree 7ce8e705e5a9aabb787d17fbec7a078d9d6780dc)
Comment 5 Stefan Metzmacher 2009-04-01 13:15:15 UTC
Can you please provide the wins hook output that a samba3 wins server generates
and also a network capture that shows the multi-homed registration and
the nmblookup which shows the result (both against samba3 and samba4).

The above commit fixes multi-homed registrations from windows hosts.
The problems was that the WACK challenge timeout because the response
arrived on the wrong socket.

Comment 6 Krzysztof Olędzki 2009-04-01 13:35:25 UTC
samba4wins:
Apr  1 20:30:39 xdns1 winshook[44489]: delete OLEMX 20 1239129033
Apr  1 20:30:39 xdns1 winshook[44493]: add OLEMX 20 1238869839 192.168.0.33
Apr  1 20:30:39 xdns1 winshook[44497]: delete OLEMX 03 1239129032
Apr  1 20:30:39 xdns1 winshook[44501]: add OLEMX 03 1238869839 192.168.0.33
Apr  1 20:30:39 xdns1 winshook[44505]: delete OLEMX 00 1239129032
Apr  1 20:30:39 xdns1 winshook[44509]: add OLEMX 00 1238869839 192.168.0.33
Apr  1 20:30:43 xdns1 winshook[44521]: delete OLEMX 20 1238869839 192.168.0.33
Apr  1 20:30:43 xdns1 winshook[44525]: add OLEMX 20 1238869843 192.168.0.44
Apr  1 20:30:43 xdns1 winshook[44529]: delete OLEMX 03 1238869839 192.168.0.33
Apr  1 20:30:43 xdns1 winshook[44533]: add OLEMX 03 1238869843 192.168.0.44
Apr  1 20:30:43 xdns1 winshook[44537]: delete OLEMX 00 1238869839 192.168.0.33
Apr  1 20:30:44 xdns1 winshook[44541]: add OLEMX 00 1238869843 192.168.0.44

samba3:
Apr  1 20:33:33 dsrv winshook[16391]: add OLEMX 20 259200 192.168.0.33
Apr  1 20:33:33 dsrv winshook[16394]: add OLEMX 03 259200 192.168.0.33
Apr  1 20:33:33 dsrv winshook[16397]: add OLEMX 00 259200 192.168.0.33
Apr  1 20:33:33 dsrv winshook[16406]: add OLEMX 20 259200 192.168.0.33 192.168.0.44
Apr  1 20:33:33 dsrv winshook[16409]: add OLEMX 03 259200 192.168.0.33 192.168.0.44
Apr  1 20:33:33 dsrv winshook[16412]: add OLEMX 00 259200 192.168.0.33 192.168.0.44
Comment 7 Krzysztof Olędzki 2009-04-01 13:37:59 UTC
samba4wins:
# nmblookup -U 192.168.148.11 -R 'olemx'
querying olemx on 192.168.148.11
192.168.0.44 olemx<00>

samba3:
# nmblookup -U 192.168.0.137 -R 'olemx'
querying olemx on 192.168.0.137
192.168.0.33 olemx<00>
192.168.0.44 olemx<00>
Comment 8 Krzysztof Olędzki 2009-04-01 13:43:36 UTC
Created attachment 4043 [details]
network capture: samba3 multi-homed registration
Comment 9 Krzysztof Olędzki 2009-04-01 13:46:37 UTC
Created attachment 4044 [details]
network capture: samba4wins multi-homed registration
Comment 10 Krzysztof Olędzki 2009-04-01 13:49:02 UTC
Done, please let me know if you need more information.

BTW: thank you for looking at this problem. ;)
Comment 11 Stefan Metzmacher 2009-04-30 08:08:41 UTC
I don't see the name requests from the server to the client which should be followed after the WACK response. Please make sure they get captured too.

With this name requests the server checks if all addresses of a multi-homed
server really belong to the same machine.

Note: It could be that the server uses a different source ip address to contact the client, depnding on the server configuration. Maybe you filtered too much.
Comment 12 Krzysztof Olędzki 2009-06-02 04:08:06 UTC
Yep, it was indeed a filtering issue.

Sorry for wasting your time and thank you for the help.