[strongSwan] Setting the source address on outgoing packets does not work (patch)

Andreas Hofmeister andi at collax.com
Fri Nov 6 14:00:38 CET 2015


Hi all,

Setting the source address on outgoing  packets does not work, which in 
my case broke connection establishment with multi path routing.

A buffer to hold the ancillary data (the source address) for the packet 
is defined within the scope of an 'if' block and the address of that 
buffer is stored  in  the message structure defined outside the block. 
But variable defined in an inner scope are only accessible within that 
scope, thus what happens to the storage space allocated for the buffer 
is undefined.

When compiling with GCC and without optimization, setting the address 
does work (by accident, I assume), but with any optimization enabled, 
GCC will happily eliminate most of the 'if' block.

Defining the data buffer in the same scope as the message structure does 
fix the problem.

Ciao
   Andi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 001-fix-setting-source-address.patch
Type: text/x-patch
Size: 1760 bytes
Desc: not available
URL: <http://lists.strongswan.org/pipermail/users/attachments/20151106/9cbb0626/attachment.bin>


More information about the Users mailing list