[strongSwan-dev] IPv4/IPv6 peers with same identity

Martin Willi martin at strongswan.org
Fri Nov 12 16:32:50 CET 2010

Hi Thomas,

Thanks for your patch, I've applied a slightly modified version [1] to

>  static bool connected_peers_match(connected_peers_t *connected_peers,
> -		identification_t *my_id, identification_t *other_id)
> +		identification_t *my_id, identification_t *other_id,
> +		sa_family_t family)

>  	if (list->find_first(list, (linked_list_match_t)connected_peers_match,
> -		(void**)&current, entry->my_id, entry->other_id) == SUCCESS)
> +		(void**)&current, entry->my_id, entry->other_id,
> +		entry->other->get_family(entry->other)) == SUCCESS)

find_first and the like take a variable list of arguments, but these
should be pointers. Passing sa_familiy_t works only if
sizeof(sa_family_t) == sizeof(void*). I've changed the signature of the
callback to uintptr_t and added a cast to the same for find_first. This
should work on any platform.

>         other = ike_sa->get_other_id(ike_sa);
> +       {
> +               host_t *other = ike_sa->get_other_host(ike_sa);

I personally don't like variable name "overloading", might get
confusing. I slightly changed this hunk, too.



More information about the Dev mailing list