<div dir="ltr"><div>Hi, </div><div><br></div><div><span>I have </span>done changes on "xfrm_userpolicy_info" struct too<span> and I </span></div><div><span>have sucessfully started 32 bit Strongswan on 64 bit kernel </span>at the end. </div><div><br></div><div>The patch below:</div><div><br></div>--- xfrm.h.orig 2014-10-31 14:58:55.026839122 +0200<br>+++ xfrm.h      2014-10-31 15:00:33.946839099 +0200<br>@@ -355,6 +355,7 @@<br>        __u8                            mode;           /* XFRM_MODE_xxx */<br>        __u8                            replay_window;<br>        __u8                            flags;<br>+       __u32                           dummy_alligner;<br> #define XFRM_STATE_NOECN       1<br> #define XFRM_STATE_DECAP_DSCP  2<br> #define XFRM_STATE_NOPMTUDISC  4<br>@@ -400,6 +401,7 @@<br>        /* Automatically expand selector to include matching ICMP payloads. */                                                        <br> #define XFRM_POLICY_ICMP       2                                                                                                     <br>        __u8                            share;                                                                                        <br>+       __u32                           dummy_alligner;                                                                               <br> };                                                                                                                                   <br>                                                                                                                                      <br> struct xfrm_userpolicy_id {<div><br></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br><span style="font-family:arial,sans-serif;font-size:13px">Alternatively you could detect a 64-bit kernel in 32-bit strongSwan<br></span><span style="font-family:arial,sans-serif;font-size:13px">builds, and then add four extra bytes to the xfrm_usersa_info struct.</span></blockquote><div><br></div><div>To keep compatibility of the patched binaries at the 32bit kernel too I have tried </div><div>duplicating "xfrm_usersa_info" and  "xfrm_userpolicy_info" struct</div><div>definitions with "_64" endings to be able to swap at runtime by </div><div>"if" statetements before each instance of this structs . But this change affects </div><div>further struct definitions which includes that duplicated structs as an </div><div>element and causes need to duplicate them too. </div><div><br></div><div><div>Now I want to take your opinions about how can I change struct definitions </div><div> at runtime in the stongswan build.</div></div><div><br></div><div>Best regards,</div><div>Tugrul.</div><div><br></div><div><br></div><div><br></div><div><br></div><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 26, 2014 at 1:11 PM, Tugrul Erdogan <span dir="ltr"><<a href="mailto:h.tugrul.erdogan@gmail.com" target="_blank">h.tugrul.erdogan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Thanks for your reply. <div><br></div><div>I have applied the changes to the strangswan package. I will check compilation time of libhydra and highten the log level.</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 26, 2014 at 11:54 AM, Thomas Egerer <span dir="ltr"><<a href="mailto:hakke_007@gmx.de" target="_blank">hakke_007@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
just a couple of thoughts:<br>
<span>On 10/25/2014 04:41 PM, Tugrul Erdogan wrote:<br>
><br>
> Hi,<br>
><br>
> I have patched the xframe.h and I am taking the errors below:<br>
</span>In what place did you patch xfrm.h, strongswan<br>
or linux-kernel?<br>
<span><br>
><br>
> Oct 25 14:38:33 01[IKE] <vpntest_localne-host34_uzaknetwork|1> activating new tasks<br>
> Oct 25 14:38:33 01[IKE] <vpntest_localne-host34_uzaknetwork|1>   activating QUICK_MODE task<br>
> Oct 25 14:38:33 01[CFG] <vpntest_localne-host34_uzaknetwork|1> configured proposals: ESP:3DES_CBC/HMAC_MD5_96/MODP_1024/NO_EXT_SEQ,<br>
> ESP:AES_CBC_128/AES_CBC_192/AES_CBC_256/3DES_CBC/BLOWFISH_CBC_256/HMAC_SHA1_96/AES_XCBC_96/HMAC_MD5_96/NO_EXT_SEQ<br>
> Oct 25 14:38:33 01[KNL] <vpntest_localne-host34_uzaknetwork|1> getting SPI for reqid {1}<br>
> Oct 25 14:38:33 01[KNL] <vpntest_localne-host34_uzaknetwork|1> allocating SPI failed: Invalid argument (22)<br>
> Oct 25 14:38:33 01[KNL] <vpntest_localne-host34_uzaknetwork|1> unable to get SPI for reqid {1}<br>
> Oct 25 14:38:33 01[IKE] <vpntest_localne-host34_uzaknetwork|1> allocating SPI from kernel failed<br>
> Oct 25 14:38:33 01[MGR] <vpntest_localne-host34_uzaknetwork|1> checkin and destroy IKE_SA vpntest_localne-host34_uzaknetwork[1]<br>
> Oct 25 14:38:33 01[IKE] <vpntest_localne-host34_uzaknetwork|1> IKE_SA vpntest_localne-host34_uzaknetwork[1] state change: ESTABLISHED => DESTROYING<br>
> Oct 25 14:38:33 01[MGR] check-in and destroy of IKE_SA successful<br>
><br>
> and the patch which I had done below:<br>
><br>
> --- ~/src/include/linux/xfrm.h 2014-10-25 16:27:11.000000000 +0300<br>
> +++ ~/src/include/linux/xfrm.h.mod     2014-10-25 16:26:56.000000000 +0300<br>
> @@ -355,6 +355,7 @@<br>
>         __u8                            mode;           /* XFRM_MODE_xxx */<br>
>         __u8                            replay_window;<br>
>         __u8                            flags;<br>
> +        __u32                           dummy_alligner;<br>
>  #define XFRM_STATE_NOECN       1<br>
>  #define XFRM_STATE_DECAP_DSCP  2<br>
>  #define XFRM_STATE_NOPMTUDISC  4<br>
><br>
> what should be missing?<br>
</span>You surely did recompile libhydra and restart charon?<br>
Also: try 'stroke loglevel knl 4' to see what's being sent<br>
via netlink to the kernel.<br>
<br>
Cheers,<br>
Thomas<br>
_______________________________________________<br>
Dev mailing list<br>
<a href="mailto:Dev@lists.strongswan.org" target="_blank">Dev@lists.strongswan.org</a><br>
<a href="https://lists.strongswan.org/mailman/listinfo/dev" target="_blank">https://lists.strongswan.org/mailman/listinfo/dev</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>