From: Jeremy Allison Date: Wed, 5 Aug 2020 18:37:03 +0000 (-0700) Subject: s3: libsmb: Cleanup - Remove the last use of a struct sockaddr_storage variable in... X-Git-Tag: talloc-2.3.2~887 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a9c78592814543e69e39f4451c8d0ef7e4dcf6b;p=thirdparty%2Fsamba.git s3: libsmb: Cleanup - Remove the last use of a struct sockaddr_storage variable in dsgetdcname.c 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 Reviewed-by: Andreas Schneider Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Fri Aug 7 07:58:14 UTC 2020 on sn-devel-184 --- diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c index 6566f978996..128004a0f6a 100644 --- a/source3/libsmb/dsgetdcname.c +++ b/source3/libsmb/dsgetdcname.c @@ -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);