]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: libsmb: Cleanup - Remove the last use of a struct sockaddr_storage variable in...
authorJeremy Allison <jra@samba.org>
Wed, 5 Aug 2020 18:37:03 +0000 (11:37 -0700)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 7 Aug 2020 07:58:13 +0000 (07:58 +0000)
Remove from process_dc_netbios().

This is a logic change, but as all the logic did was force a round-trip
through converting an already guaranteed numeric hostname printed by
print_sockaddr() inside discover_dc_netbios() to a struct
sockaddr_storage and then discard the result (!) I think it's harmless.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Aug  7 07:58:14 UTC 2020 on sn-devel-184

source3/libsmb/dsgetdcname.c

index 6566f97899661b695412998256768819697744b0..128004a0f6a885eaf7338654348a4720593fbbc3 100644 (file)
@@ -1054,7 +1054,6 @@ static NTSTATUS process_dc_netbios(TALLOC_CTX *mem_ctx,
                                   int num_dcs,
                                   struct netr_DsRGetDCNameInfo **info)
 {
-       struct sockaddr_storage ss;
        struct ip_service ip_list;
        enum nbt_name_type name_type = NBT_NAME_LOGON;
        NTSTATUS status;
@@ -1094,10 +1093,6 @@ static NTSTATUS process_dc_netbios(TALLOC_CTX *mem_ctx,
                ip_list.ss = dclist[i].sa.u.ss;
                ip_list.port = 0;
 
-               if (!interpret_string_addr_prefer_ipv4(&ss, dclist[i].hostname, AI_NUMERICHOST)) {
-                       return NT_STATUS_UNSUCCESSFUL;
-               }
-
                status = nbt_getdc(msg_ctx, 10, &dclist[i].sa.u.ss, domain_name,
                                   NULL, my_acct_name, ACB_WSTRUST, nt_version,
                                   mem_ctx, &nt_version, &dc_name, &r);