diff options
-rw-r--r-- | source/namedbname.c | 27 | ||||
-rw-r--r-- | source/namedbsubnet.c | 5 |
2 files changed, 23 insertions, 9 deletions
diff --git a/source/namedbname.c b/source/namedbname.c index 5eb03bc6370..7d91b6e0451 100644 --- a/source/namedbname.c +++ b/source/namedbname.c @@ -249,7 +249,7 @@ void dump_names(void) } DEBUG(4,("\n")); - if (f && n->source == REGISTER) + if (f && ((n->source == REGISTER) || (n->source == SELF))) { /* XXXX i have little imagination as to how to output nb_flags as anything other than as a hexadecimal number :-) */ @@ -260,11 +260,11 @@ void dump_names(void) for (i = 0; i < n->num_ips; i++) { - fprintf(f, "%s %2x ", - inet_ntoa(n->ip_flgs[i].ip), - n->ip_flgs[i].nb_flags); + fprintf(f, "%s %2x%c ", + inet_ntoa(n->ip_flgs[i].ip), + n->ip_flgs[i].nb_flags, (n->source == REGISTER ? 'R' : 'S')); } - fprintf(f, "\n"); + fprintf(f, "\n"); } } @@ -341,6 +341,17 @@ void load_netbios_names(void) continue; } + /* Deal with SELF or REGISTER name encoding. Default is REGISTER + for compatibility with old nmbds. */ + if(nb_flags_str[strlen(nb_flags_str)-1] == 'S') + { + DEBUG(5,("Ignoring SELF name %s\n", line)); + continue; + } + + if(nb_flags_str[strlen(nb_flags_str)-1] == 'R') + nb_flags_str[strlen(nb_flags_str)-1] = '\0'; + /* netbios name. # divides the name from the type (hex): netbios#xx */ strcpy(name,name_str); @@ -449,6 +460,12 @@ struct name_record *add_netbios_entry(struct subnet_record *d, } } + if(type == 0x1e) + { + /* Add all 1e names as address 255.255.255.255 */ + ip = *interpret_addr2("255.255.255.255"); + } + n = (struct name_record *)malloc(sizeof(*n)); if (!n) return(NULL); diff --git a/source/namedbsubnet.c b/source/namedbsubnet.c index ab1f133dd4b..7e800930a53 100644 --- a/source/namedbsubnet.c +++ b/source/namedbsubnet.c @@ -211,14 +211,11 @@ void add_workgroup_to_subnet( struct subnet_record *d, char *group) /* add WORKGROUP(00) entries into name database or register with WINS server, if it's our workgroup. - Don't register WORKGROUP(0x1e) on the WINS subnet - this is a broadcast - only name. */ if (strequal(myworkgroup, group)) { add_my_name_entry(d,group,0x0 ,nb_type|NB_ACTIVE|NB_GROUP,False); - if((d != wins_subnet)) - add_my_name_entry(d,group,0x1e,nb_type|NB_ACTIVE|NB_GROUP,False); + add_my_name_entry(d,group,0x1e,nb_type|NB_ACTIVE|NB_GROUP,False); /* add samba server name to workgroup list. */ add_server_entry(d,w,myname,w->ServerType,0,lp_serverstring(),True); DEBUG(3,("add_workgroup_to_subnet: Added server name entry %s to subnet %s\n", |