@@ -434,7 +434,7 @@ probe_ip(HostDBHash const &hash)
434434 Dbg (dbg_ctl_hostdb, " DNS %.*s" , int (hash.host_name .size ()), hash.host_name .data ());
435435 IpAddr tip;
436436 if (0 == tip.load (hash.host_name )) {
437- result = HostDBRecord::Handle{HostDBRecord::alloc (hash.host_name , 1 )};
437+ result = HostDBRecord::Handle{HostDBRecord::alloc (hash.host_name , 1 , 0 , hash. port )};
438438 result->af_family = tip.family ();
439439 auto &info = result->rr_info ()[0 ];
440440 info.assign (tip);
@@ -919,7 +919,7 @@ HostDBContinuation::dnsEvent(int event, HostEnt *e)
919919
920920 // In the event that the lookup failed (SOA response-- for example) we want to use hash.host_name, since it'll be ""
921921 TextView query_name = (failed || !hash.host_name .empty ()) ? hash.host_name : TextView{e->ent .h_name , strlen (e->ent .h_name )};
922- HostDBRecord::Handle r{HostDBRecord::alloc (query_name, valid_records, failed ? 0 : e->srv_hosts .srv_hosts_length )};
922+ HostDBRecord::Handle r{HostDBRecord::alloc (query_name, valid_records, failed ? 0 : e->srv_hosts .srv_hosts_length , hash. port )};
923923 r->key = hash.hash .fold (); // always set the key
924924 r->af_family = af;
925925 r->flags .f .failed_p = failed;
@@ -1542,7 +1542,7 @@ HostDBRecord::free()
15421542}
15431543
15441544HostDBRecord *
1545- HostDBRecord::alloc (TextView query_name, unsigned int rr_count, size_t srv_name_size)
1545+ HostDBRecord::alloc (TextView query_name, unsigned int rr_count, size_t srv_name_size, in_port_t port )
15461546{
15471547 const swoc::Scalar<8 , ssize_t > qn_size = round_up (query_name.size () + 1 );
15481548 const swoc::Scalar<8 , ssize_t > r_size = round_up (sizeof (self_type) + qn_size + rr_count * sizeof (HostDBInfo) + srv_name_size);
@@ -1554,6 +1554,7 @@ HostDBRecord::alloc(TextView query_name, unsigned int rr_count, size_t srv_name_
15541554 new (self) self_type ();
15551555 self->_iobuffer_index = iobuffer_index;
15561556 self->_record_size = r_size;
1557+ self->_port = port;
15571558
15581559 Dbg (dbg_ctl_hostdb, " allocating %ld bytes for %.*s with %d RR records at [%p]" , r_size.value (), int (query_name.size ()),
15591560 query_name.data (), rr_count, self);
0 commit comments