r1104: get_called_name is used in the printing subsystem. In case of multi-homed
[jra/samba/.git] / source3 / param / loadparm.c
index 2c65ac67d9686095e6d017397edd928c66f922a4..03b86a9c1831400756ffdec2ea1e00174c215844 100644 (file)
@@ -4262,7 +4262,10 @@ const char *get_called_name(void)
        extern fstring local_machine;
        static fstring called_name;
 
-       if (!*local_machine) {
+       if ( (!*local_machine) ||
+            (client_socket_port() == 445) ) {
+               /* Everybody coming in on 445 should be able to live with the
+                * IP address */
                fstrcpy(called_name, client_socket_addr());
                DEBUG(8,("get_called_name: assuming that client used IP address [%s] as called name.\n",
                         called_name));