Skip to content

Commit

Permalink
Merge pull request #19271 from jakesmith/HPCC-32664-group-gettext-bug
Browse files Browse the repository at this point in the history
HPCC-32664 Fix bug creating DFS Group text causing DNS failures

Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Nov 5, 2024
2 parents 3aedb96 + 5d8344c commit a095dc9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions system/jlib/jsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6380,15 +6380,19 @@ StringBuffer &SocketEndpointArray::getText(StringBuffer &text) const
return item(0).getEndpointHostText(text);
byte lastip[4];
const SocketEndpoint &first = item(0);
bool lastis4 = first.getNetAddress(sizeof(lastip),&lastip)==sizeof(lastip);
unsigned short lastport = first.port;
first.getHostText(text);
bool lastis4 = false;
if (!first.queryHostname())
lastis4 = first.getNetAddress(sizeof(lastip),&lastip)==sizeof(lastip);
unsigned short lastport = first.port;
unsigned rep=0;
unsigned range=0;
for (unsigned i=1;i<count;i++) {
byte ip[4];
const SocketEndpoint &ep = item(i);
bool is4 = ep.getNetAddress(sizeof(ip),&ip)==sizeof(ip);
bool is4 = false;
if (!ep.queryHostname())
is4 = ep.getNetAddress(sizeof(ip),&ip)==sizeof(ip);
if (!lastis4||!is4) {
flushText(text,lastport,rep,range);
text.append(',');
Expand Down

0 comments on commit a095dc9

Please sign in to comment.