When allocating an Id for proxying, the code previously did not
pay attention to address families. So if you have two home servers,
on V4 only and one V6 only, it could use a local V4 proxy socket to
connect to a V6 server, This doesn't work.
int fr_packet_list_id_alloc(fr_packet_list_t *pl,
RADIUS_PACKET *request)
{
- int i, id, start, fd;
+ int i, id, start;
int src_any = 0;
uint32_t free_mask;
fr_packet_dst2id_t my_pd, *pd;
id = start = (int) fr_rand() & 0xff;
while (pd->id[id] == pl->mask) { /* all sockets are using this ID */
- redo:
id++;
id &= 0xff;
if (id == start) {
ps = &(pl->sockets[i]);
+ /*
+ * Address families don't match, skip it.
+ */
+ if (ps->ipaddr.af != request->dst_ipaddr.af) continue;
+
/*
* We're sourcing from *, and they asked for a
* specific source address: ignore it.