s3: libsmb: Use namecache_store_sa() instead of namecache_store().
authorJeremy Allison <jra@samba.org>
Thu, 27 Aug 2020 18:49:07 +0000 (11:49 -0700)
committerNoel Power <npower@samba.org>
Mon, 7 Sep 2020 13:23:44 +0000 (13:23 +0000)
Removes one more struct ip_service usage.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
source3/libsmb/dsgetdcname.c

index b7720fd50ff92a0561251d481c13645ed41b92be..ffe07e089a4fde73c0a7a887dc983e6d7a6967dd 100644 (file)
@@ -1064,7 +1064,6 @@ static NTSTATUS process_dc_netbios(TALLOC_CTX *mem_ctx,
                                   int num_dcs,
                                   struct netr_DsRGetDCNameInfo **info)
 {
-       struct ip_service ip_list;
        enum nbt_name_type name_type = NBT_NAME_LOGON;
        NTSTATUS status;
        int i;
@@ -1100,15 +1099,15 @@ static NTSTATUS process_dc_netbios(TALLOC_CTX *mem_ctx,
 
                generate_random_buffer((uint8_t *)&val, 2);
 
-               ip_list.ss = dclist[i].sa.u.ss;
-               ip_list.port = 0;
-
                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);
                if (NT_STATUS_IS_OK(status)) {
                        store_cache = true;
-                       namecache_store(dc_name, NBT_NAME_SERVER, 1, &ip_list);
+                       namecache_store_sa(dc_name,
+                                       NBT_NAME_SERVER,
+                                       1,
+                                       &dclist[i].sa);
                        goto make_reply;
                }
 
@@ -1137,7 +1136,10 @@ static NTSTATUS process_dc_netbios(TALLOC_CTX *mem_ctx,
 
                        map_netlogon_samlogon_response(r);
 
-                       namecache_store(tmp_dc_name, NBT_NAME_SERVER, 1, &ip_list);
+                       namecache_store_sa(tmp_dc_name,
+                                       NBT_NAME_SERVER,
+                                       1,
+                                       &dclist[i].sa);
 
                        goto make_reply;
                }