kernel-netlink: Update family in SA selector if addresses change

This commit is contained in:
Tobias Brunner
2026-04-16 15:33:25 +02:00
parent e1a11e2c1c
commit cb27593ce0
@@ -2723,6 +2723,9 @@ METHOD(kernel_ipsec_t, update_sa, status_t,
{
ts->set_address(ts, data->new_dst);
ts2subnet(ts, &sa->sel.daddr, &sa->sel.prefixlen_d);
/* can't set this for src, otherwise selector2ts() will fail, but
* if the family changes, both addresses need updating anyway */
sa->sel.family = data->new_dst->get_family(data->new_dst);
}
DESTROY_IF(ts);
}