[Swan-dev] heads up, the great spd scramble

Paul Wouters paul at nohats.ca
Mon Oct 31 03:08:31 EET 2022

On Fri, 28 Oct 2022, Andrew Cagney wrote:

> I'm about to change "spd" in struct connection to a pointer; that is from:
>   struct spd_route spd;
> to:
>  struct spd_route *spd;

thanks for the heads up.

> My motivation is to make the code generating a list of SPDs from
> subnets simpler (I'm guessing the first spd was embedded in the
> connection as a memory optimization).

I wish your guess was right. It seems more that it was a hack to get
XAUTH working with multiple subnets as client and/or preparing for
IKEv2 multiple subnets per single Child SA.

> Since i'm there, and since this is going to make a mess, I'm going to
> piggy pack two other changes:
> - struct end -> struct spd_end
> because struct end pretty much only contains SPD stuff


> - spd.this -> spd.local + spd.that -> spd.remote
> because this and that get used to refer to either end

The idea of this/that was that it was not always already clear
which end we were. As in, we do not know yet whether "this" will
become us or them. This might have changed now based on newer
addconn and resolve_defaultroute stuff. But I think that's where
the origin of this is. Maybe Hugh knows more :)


More information about the Swan-dev mailing list