hifiberry / hifiberry-os

Linux distribution optimized for audio playback
MIT License
1.01k stars 128 forks source link

Nameresolution in SMB is broken // resolves to 192.168.56.1 after adding a SMB source. #341

Closed pl4hh closed 2 years ago

pl4hh commented 2 years ago

Describe the bug When i add a SMBSERVER via the name it finds in the NAS browser it resolves it afterwards to 192.168.56.1 and not the IP it has in the network. Verified it with a fresh install, if i add the SERVER via manual IP entry it works as supposed. Also checked what nmblookup is seeing. somehow somewhere there is something broken/leftover. i checked every config for that ipaddress. Problem seems not to be in MPD, but rather in SMBD or in some implementation of yours. This worked fine half a year ago, i think it might be only in the current firmware. IP Address of SMBShare needs to be added manually to have SMBshares working at the moment. Raspi 4 is only connected via WIFI. ifconfig is looking ok, hifiberry has the right address for the wlan0 device. also my network is not in that IP range.

HiFiBerryOS version 20211105

HiFiBerry sound card DAC2 Pro

To Reproduce Steps to reproduce the behavior: using webinterface to add a source to mpd. behavior is seen in logs/console/nmblookup.

  1. Go to 'General'
  2. Click on 'Music Player Daemon'
  3. Click on the found Servername 'ADD' .. SMBshares are viewable and selectable at this moment, but afterwards it resolves to the wrong IP.
  4. Error is not seen in GUI, GUI just says not available after adding the SHARE via name and Saving.

Expected behavior It should resolve to the right address, see the logs i gathered below via console.

LOG ENTRIES FROM ADDING THE SOURCE


Feb 20 11:02:36 hifi beocreate2[704]: Looking for NAS devices with SMB protocol...
Feb 20 11:02:36 hifi beocreate2[704]: Checking MPD database update status...
Feb 20 11:02:36 hifi beocreate2[704]: NAS configuration line 0 was not recognised:
Feb 20 11:02:36 hifi beocreate2[704]: Checking MPD database update status...
Feb 20 11:03:14 hifi beocreate2[704]: Added 'PATH/PATH/PATH' from NAS 'NASNAME'.
Feb 20 11:03:14 hifi kernel: FS-Cache: Netfs 'cifs' registered for caching
Feb 20 11:03:14 hifi kernel: Key type cifs.spnego registered
Feb 20 11:03:14 hifi kernel: Key type cifs.idmap registered
**Feb 20 11:03:14 hifi kernel: CIFS: Attempting to mount //192.168.56.1/PATH/PATH/PATH**
Feb 20 11:03:14 hifi kernel: CIFS: No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3.1.1), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3.1.1 (or even SMB3 or SMB2.1) specify vers=1.0 on mount.
Feb 20 11:03:15 hifi beocreate2[704]: NAS storage mount finished.
Feb 20 11:03:15 hifi beocreate2[704]: NAS configuration line 0 was not recognised:
Feb 20 11:03:15 hifi beocreate2[704]: NAS 'NASNAME-PATH-6GCBa' does not appear to be mounted.
Feb 20 11:03:15 hifi beocreate2[704]: Looking for NAS devices with SMB protocol...

DEBUG VIA NMBLOOKUP

# nmblookup -S WORKGROUP
Can't load /etc/samba/smb.conf - run testparm to debug it
192.168.XX.XXX WORKGROUP<00>
Looking up status of 192.168.XX.XXX
        NASNAME               <00> -         M <ACTIVE>
        WORKGROUP       <00> - <GROUP> M <ACTIVE>
        NASNAME               <20> -         M <ACTIVE>
        WORKGROUP       <1e> - <GROUP> M <ACTIVE>

        MAC Address = XX-XX-XX-XX-XX-XX

192.168.56.1 WORKGROUP<00>
Looking up status of 192.168.56.1
No reply from 192.168.56.1

name_query failed to find name WORKGROUP

#
pl4hh commented 2 years ago

I dug a little bit deeper, turns out i had a virtualbox adapter with hardcoded IP also on the NAS server running. disabled that interface and now it CIFS connects to the right IP. still not sure why and how it would get the other IP. maybe from avahi network discovery?