Skip to contentSkip to conversation

Problem with alloc_buf_gc function

Openvpn-devel Tiran Kaskas 7 participants 21 messages Dec 11, 2011 – Dec 29, 2011

lore
Share & tools
lore
#0 lore raw

Looking into the function alloc_buf_gc() in file buffer.c, it returns a struct buffer, which seems to me is allocated on the stack, which is causing an issue, I believe, since the function calling alloc_buf_gc() will work on a buffer which becomes garbage.

Please confirm I am not missing something.

Thanks,
Tiran

#1 lore raw

Hi Tiran,

Am 11.12.2011 21:57, schrieb Tiran Kaskas:

Quoted 4 lines

Looking into the function alloc_buf_gc() in file buffer.c, it returns a struct buffer, which seems to me is allocated on the stack, which is causing an issue, I believe, since the function calling alloc_buf_gc() will work on a buffer which becomes garbage.

'alloc_buf_gc()' is returning 'buf' (of type 'struct buffer') by value, not by pointer, so there is no problem here. If it were returning 'buf' by pointer your observation would be correct. (In C++ a typical mistake would be to return 'buf' by reference.)

The function calling 'alloc_buf_gc()' will copy the contents of 'buf' to its local instance of 'struct buffer' before continuing. (An optimised build might even eliminate the copy.)

Are you observing a specific problem with buffers or did you just happen to stumble over this piece of code?

Cheers
Fabian

#2 lore raw

You are right, I somehow mixed the data ptr with the struct copy by value.
I do have a problem with returning structures with my 16 bit machine, seems some of the data not being copied (probably need to define far segment).

-----Original Message-----
From: Fabian Knittel [mailto:[email protected]...]
Sent: Monday, December 12, 2011 12:11 AM
To: Tiran Kaskas
Cc: [email protected]
Subject: Re: [Openvpn-devel] Problem with alloc_buf_gc function

Hi Tiran,

Am 11.12.2011 21:57, schrieb Tiran Kaskas:

Quoted 4 lines

Looking into the function alloc_buf_gc() in file buffer.c, it returns a struct buffer, which seems to me is allocated on the stack, which is causing an issue, I believe, since the function calling alloc_buf_gc() will work on a buffer which becomes garbage.

'alloc_buf_gc()' is returning 'buf' (of type 'struct buffer') by value, not by pointer, so there is no problem here. If it were returning 'buf' by pointer your observation would be correct. (In C++ a typical mistake would be to return 'buf' by reference.)

The function calling 'alloc_buf_gc()' will copy the contents of 'buf' to its local instance of 'struct buffer' before continuing. (An optimised build might even eliminate the copy.)

Are you observing a specific problem with buffers or did you just happen to stumble over this piece of code?

Cheers
Fabian

#3 lore raw

Is there a problem connecting a client running 2.1.4 (the one with polarssl) to a server running 2.0.9?

How would the flow typically be?
I see client sending P_CONTROL_HARD_RESET_CLIENT_V2, and then immediately starts the ssl session (which writes the client hello, but fails to read the server hello). Shouldn't it be that after sending the P_CONTROL_HARD_RESET_CLIENT_V2 the client will need to wait for P_CONTROL_HARD_RESET_SERVER_V2?
I do see the P_CONTROL_HARD_RESET_SERVER_V2 comes after some time, but there is always an attempt to start the ssl session from the client side.

Thanks

-----Original Message-----
From: Tiran Kaskas [mailto:[email protected]...]
Sent: Monday, December 12, 2011 9:42 AM
To: Fabian Knittel
Cc: [email protected]
Subject: Re: [Openvpn-devel] Problem with alloc_buf_gc function

You are right, I somehow mixed the data ptr with the struct copy by value.
I do have a problem with returning structures with my 16 bit machine, seems some of the data not being copied (probably need to define far segment).

-----Original Message-----
From: Fabian Knittel [mailto:[email protected]...]
Sent: Monday, December 12, 2011 12:11 AM
To: Tiran Kaskas
Cc: [email protected]
Subject: Re: [Openvpn-devel] Problem with alloc_buf_gc function

Hi Tiran,

Am 11.12.2011 21:57, schrieb Tiran Kaskas:

Quoted 4 lines

Looking into the function alloc_buf_gc() in file buffer.c, it returns a struct buffer, which seems to me is allocated on the stack, which is causing an issue, I believe, since the function calling alloc_buf_gc() will work on a buffer which becomes garbage.

'alloc_buf_gc()' is returning 'buf' (of type 'struct buffer') by value, not by pointer, so there is no problem here. If it were returning 'buf' by pointer your observation would be correct. (In C++ a typical mistake would be to return 'buf' by reference.)

The function calling 'alloc_buf_gc()' will copy the contents of 'buf' to its local instance of 'struct buffer' before continuing. (An optimised build might even eliminate the copy.)

Are you observing a specific problem with buffers or did you just happen to stumble over this piece of code?

Cheers
Fabian

------------------------------------------------------------------------------
Learn Windows Azure Live! Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for developers. It will provide a great way to learn Windows Azure and what it provides. You can attend the event by watching it streamed LIVE online. Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#4 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 11 lines · Tiran Kaskas

Is there a problem connecting a client running 2.1.4 (the one with polarssl) to a server running 2.0.9?

How would the flow typically be? I see client sending P_CONTROL_HARD_RESET_CLIENT_V2, and then immediately starts the ssl session (which writes the client hello, but fails to read the server hello). Shouldn't it be that after sending the P_CONTROL_HARD_RESET_CLIENT_V2 the client will need to wait for P_CONTROL_HARD_RESET_SERVER_V2? I do see the P_CONTROL_HARD_RESET_SERVER_V2 comes after some time, but there is always an attempt to start the ssl session from the client side.

Please, don't use 2.0.9. That versions was released in 2006. We're soon ending 2011. During those years, a lot has happened - including bug and security fixes. I would even recommend you to move up to the 2.2 releases.

But yes, there are some configurations which are not 2.0/2.1 compatible.
But we don't pay attention to that any more. We rather encourage
everyone to move up to the 2.2 release.

<http://openvpn.net/index.php/open-source/downloads.html>

kind regards,

David Sommerseth

(PS! Also, please don't top-post)

Quoted 32 lines

-----Original Message----- From: Tiran Kaskas [mailto:[email protected]...] Sent: Monday, December 12, 2011 9:42 AM To: Fabian Knittel Cc: [email protected] Subject:
Re: [Openvpn-devel] Problem with alloc_buf_gc function

You are right, I somehow mixed the data ptr with the struct copy by value. I do have a problem with returning structures with my 16 bit machine, seems some of the data not being copied (probably need to define far segment).

-----Original Message----- From: Fabian Knittel [mailto:[email protected]...] Sent: Monday, December 12, 2011 12:11 AM To: Tiran Kaskas Cc: [email protected]
Subject: Re: [Openvpn-devel] Problem with alloc_buf_gc function

Hi Tiran,

Am 11.12.2011 21:57, schrieb Tiran Kaskas:

Quoted 4 lines

Looking into the function alloc_buf_gc() in file buffer.c, it returns a struct buffer, which seems to me is allocated on the stack, which is causing an issue, I believe, since the function calling alloc_buf_gc() will work on a buffer which becomes garbage.

'alloc_buf_gc()' is returning 'buf' (of type 'struct buffer') by value, not by pointer, so there is no problem here. If it were returning 'buf' by pointer your observation would be correct. (In C++ a typical mistake would be to return 'buf' by reference.)

The function calling 'alloc_buf_gc()' will copy the contents of 'buf' to its local instance of 'struct buffer' before continuing. (An optimised build might even eliminate the copy.)

Quoted 8 lines

Are you observing a specific problem with buffers or did you just happen to stumble over this piece of code?

Cheers Fabian

------------------------------------------------------------------------------

Learn Windows Azure Live! Tuesday, Dec 13, 2011

Quoted 11 lines

Microsoft is holding a special Learn Windows Azure training event for
developers. It will provide a great way to learn Windows Azure and
what it provides. You can attend the event by watching it streamed LIVE online. Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________ Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

------------------------------------------------------------------------------

Learn Windows Azure Live! Tuesday, Dec 13, 2011

Quoted 7 lines

Microsoft is holding a special Learn Windows Azure training event for
developers. It will provide a great way to learn Windows Azure and
what it provides. You can attend the event by watching it streamed LIVE online. Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________ Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7l2p4ACgkQDC186MBRfrrQIACfTfRrSO/W5z7fa1GqB+iiiefG kHwAn2fXdh7ltOoC8tLxKp3niQqLFkwv
=6q+g
-----END PGP SIGNATURE-----

#5 lore raw
In reply to Tiran Kaskas

Hi,

Quoted 1 line · Tiran Kaskas

Is there a problem connecting a client running 2.1.4 (the one with polarssl) to a server running 2.0.9?

Well, the default crypto algorithms are not compatible between polarssl and openssl-using openvpn. So you'd need to change the crypto settings on the openssl-openvpn [--cipher] - and upgrade to 2.2, while at it.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#6 lore raw
Quoted 10 lines

-----Original Message-----
From: Gert Doering [mailto:[email protected]...]

Quoted 1 line · Tiran Kaskas

Is there a problem connecting a client running 2.1.4 (the one with

polarssl) to a server running 2.0.9?

Well, the default crypto algorithms are not compatible between polarssl and openssl-using openvpn. So you'd need to change the crypto settings on the openssl-openvpn [--cipher] - and upgrade to 2.2, while at it.

To be a little more specific: PolarSSL doesn't support blowfish (BF-CBC), a good option would be AES (AES-xxx-CBC). You can see the supported ciphers using --list-ciphers.

Adriaan

#7 lore raw

The problem is that the nl package was built with 2.1 version, and I have used this.

On a different topic: I found an issue, you probably want to fix that:
In reliable_pid_in_range1() function, the third parameter(extent) is an unsigned int.
However, this function is being called by reliable_pid_min(), passing 0x80000000u as the value to extent. On a 16 bit machine (int is 16 bit) this will never work. The type of extent need to change to unsigned long and not int.

Tiran

-----Original Message-----
From: Adriaan de Jong [mailto:[email protected]...]
Sent: Tuesday, December 13, 2011 11:31 AM
To: Gert Doering; Tiran Kaskas
Cc: [email protected]
Subject: RE: [Openvpn-devel] Problem with alloc_buf_gc function

Quoted 10 lines

-----Original Message-----
From: Gert Doering [mailto:[email protected]...]

Quoted 1 line · Tiran Kaskas

Is there a problem connecting a client running 2.1.4 (the one with

polarssl) to a server running 2.0.9?

Well, the default crypto algorithms are not compatible between polarssl and openssl-using openvpn. So you'd need to change the crypto settings on the openssl-openvpn [--cipher] - and upgrade to 2.2, while at it.

To be a little more specific: PolarSSL doesn't support blowfish (BF-CBC), a good option would be AES (AES-xxx-CBC). You can see the supported ciphers using --list-ciphers.

Adriaan

#8 lore raw

Hi

Quoted 1 line · Tiran Kaskas

The problem is that the nl package was built with 2.1 version, and I have used this.

2.1+nl patches is fine. 2.0 is not what you want.

Quoted 4 lines

On a different topic: I found an issue, you probably want to fix that:
In reliable_pid_in_range1() function, the third parameter(extent) is an unsigned int.
However, this function is being called by reliable_pid_min(), passing 0x80000000u as the value to extent. On a 16 bit machine (int is 16 bit) this will never work. The type of extent need to change to unsigned long and not int.

I don't think we currently support any 16bit machines.

What platform and operating system is this?

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#9 lore raw

The OS I am using is OSE166, running on Infineon c166.
I am almost done, seems that openvpn works fine on 16 bit machine, with some fixes I made. I will send all changes once I am done.
Anyway, if you pass such large value, it would be a good practice to set the argument type to long.

-----Original Message-----
From: Gert Doering [mailto:[email protected]...]
Sent: Tuesday, December 13, 2011 11:19 PM
To: Tiran Kaskas
Cc: Adriaan de Jong; Gert Doering; [email protected]
Subject: Re: [Openvpn-devel] Problem with alloc_buf_gc function

Hi

Quoted 1 line · Tiran Kaskas

The problem is that the nl package was built with 2.1 version, and I have used this.

2.1+nl patches is fine. 2.0 is not what you want.

Quoted 4 lines

On a different topic: I found an issue, you probably want to fix that:
In reliable_pid_in_range1() function, the third parameter(extent) is an unsigned int.
However, this function is being called by reliable_pid_min(), passing 0x80000000u as the value to extent. On a 16 bit machine (int is 16 bit) this will never work. The type of extent need to change to unsigned long and not int.

I don't think we currently support any 16bit machines.

What platform and operating system is this?

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#10 lore raw
In reply to Tiran Kaskas

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 9 lines · Tiran Kaskas

The problem is that the nl package was built with 2.1 version, and I have used this.

On a different topic: I found an issue, you probably want to fix
that: In reliable_pid_in_range1() function, the third parameter(extent) is an unsigned int. However, this function is being called by reliable_pid_min(), passing 0x80000000u as the value to extent. On a 16 bit machine (int is 16 bit) this will never work. The type of extent need to change to unsigned long and not int.

As Gert already said, OpenVPN is written for minimum 32bit architectures.
The first OpenVPN release was in 2002, long after 16bit computers were
quite irrelevant for most consumer users. So at the moment I'm sceptical if we should also support 16bit. As the int and also long integers will be a rats nest to review. You probably got more data types which needs to be reviewed as well.

On the 32bit platform both int and long are 4 bytes (32bit), while on 64bit int is 4 bytes and long is 8 bytes. And I'm not sure how long's are tackled on 16bit platforms, and if this is consistent the whole way through.

If we manage to fix OpenVPN to be 16bit safe as well, there are no guarantee that the SSL libraries will be 16bit safe. You also got potentially the LZO library as well - which may be skipped. The PKCS#11 support I guess is out of question on this kind of hardware. I would say it's better to get started "in the other end", with the SSL libraries first, to be sure the SSL layer is fine and 16bit safe before starting modifying OpenVPN.

kind regards,

David Sommerseth

Quoted 19 lines

-----Original Message----- From: Adriaan de Jong [mailto:[email protected]...] Sent: Tuesday, December 13, 2011 11:31 AM
To: Gert Doering; Tiran Kaskas Cc:
[email protected] Subject: RE: [Openvpn-devel] Problem with alloc_buf_gc function

Quoted 4 lines

-----Original Message----- From: Gert Doering
[mailto:[email protected]...]

On Mon, Dec 12, 2011 at 09:32:51AM +0000, Tiran Kaskas wrote:

Quoted 8 lines
Quoted 2 lines

Is there a problem connecting a client running 2.1.4 (the one with

polarssl) to a server running 2.0.9?

Well, the default crypto algorithms are not compatible between polarssl and openssl-using openvpn. So you'd need to change the crypto settings on the openssl-openvpn [--cipher] - and upgrade to 2.2, while at it.

Quoted 9 lines

To be a little more specific: PolarSSL doesn't support blowfish (BF-CBC), a good option would be AES (AES-xxx-CBC). You can see the supported ciphers using --list-ciphers.

Adriaan

------------------------------------------------------------------------------

Systems Optimization Self Assessment

Quoted 7 lines

Improve efficiency and utilization of IT resources. Drive out cost and
improve service delivery. Take 5 minutes to use this Systems
Optimization Self Assessment.
http://www.accelacomm.com/jaw/sdnl/114/51450054/
_______________________________________________ Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7oY6AACgkQDC186MBRfrouQwCgklEb0qpSEvD/edsRAqWP6Jni BHcAmwWP1qIVzttpJco+N+P63DC8qi4i
=v09z
-----END PGP SIGNATURE-----

#11 lore raw

Thanks.
Already done the ssl part, only polarssl. It is working perfect and does support 16bit with no change.

-----Original Message-----
From: David Sommerseth [mailto:[email protected]...]
Sent: Wednesday, December 14, 2011 10:52 AM
To: Tiran Kaskas
Cc: Adriaan de Jong; Gert Doering; [email protected]
Subject: Re: [Openvpn-devel] Problem with alloc_buf_gc function

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 9 lines · Tiran Kaskas

The problem is that the nl package was built with 2.1 version, and I have used this.

On a different topic: I found an issue, you probably want to fix
that: In reliable_pid_in_range1() function, the third parameter(extent) is an unsigned int. However, this function is being called by reliable_pid_min(), passing 0x80000000u as the value to extent. On a 16 bit machine (int is 16 bit) this will never work. The type of extent need to change to unsigned long and not int.

As Gert already said, OpenVPN is written for minimum 32bit architectures.
The first OpenVPN release was in 2002, long after 16bit computers were quite irrelevant for most consumer users. So at the moment I'm sceptical if we should also support 16bit. As the int and also long integers will be a rats nest to review. You probably got more data types which needs to be reviewed as well.

On the 32bit platform both int and long are 4 bytes (32bit), while on 64bit int is 4 bytes and long is 8 bytes. And I'm not sure how long's are tackled on 16bit platforms, and if this is consistent the whole way through.

If we manage to fix OpenVPN to be 16bit safe as well, there are no guarantee that the SSL libraries will be 16bit safe. You also got potentially the LZO library as well - which may be skipped. The PKCS#11 support I guess is out of question on this kind of hardware. I would say it's better to get started "in the other end", with the SSL libraries first, to be sure the SSL layer is fine and 16bit safe before starting modifying OpenVPN.

kind regards,

David Sommerseth

Quoted 18 lines

-----Original Message----- From: Adriaan de Jong [mailto:[email protected]...] Sent: Tuesday, December 13, 2011 11:31 AM
To: Gert Doering; Tiran Kaskas Cc:
[email protected] Subject: RE: [Openvpn-devel] Problem with alloc_buf_gc function

Quoted 11 lines

-----Original Message----- From: Gert Doering
[mailto:[email protected]...]

Quoted 1 line · Tiran Kaskas

Is there a problem connecting a client running 2.1.4 (the one with

polarssl) to a server running 2.0.9?

Well, the default crypto algorithms are not compatible between polarssl and openssl-using openvpn. So you'd need to change the crypto settings on the openssl-openvpn [--cipher] - and upgrade to 2.2, while at it.

Quoted 9 lines

To be a little more specific: PolarSSL doesn't support blowfish (BF-CBC), a good option would be AES (AES-xxx-CBC). You can see the supported ciphers using --list-ciphers.

Adriaan

------------------------------------------------------------------------------

Systems Optimization Self Assessment

Quoted 7 lines

Improve efficiency and utilization of IT resources. Drive out cost and
improve service delivery. Take 5 minutes to use this Systems
Optimization Self Assessment.
http://www.accelacomm.com/jaw/sdnl/114/51450054/
_______________________________________________ Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7oY6AACgkQDC186MBRfrouQwCgklEb0qpSEvD/edsRAqWP6Jni BHcAmwWP1qIVzttpJco+N+P63DC8qi4i
=v09z
-----END PGP SIGNATURE-----

#12 lore raw

I think Polar even supports 8-bit architectures, but don't quote me on that :).

Adriaan

Quoted 106 lines

-----Original Message-----
From: Tiran Kaskas [mailto:[email protected]...]
Sent: woensdag 14 december 2011 9:54
To: David Sommerseth
Cc: Adriaan de Jong; Gert Doering; [email protected]
Subject: RE: [Openvpn-devel] Problem with alloc_buf_gc function

Thanks.
Already done the ssl part, only polarssl. It is working perfect and does support 16bit with no change.

-----Original Message-----
From: David Sommerseth [mailto:[email protected]...]
Sent: Wednesday, December 14, 2011 10:52 AM
To: Tiran Kaskas
Cc: Adriaan de Jong; Gert Doering; [email protected]
Subject: Re: [Openvpn-devel] Problem with alloc_buf_gc function

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 9 lines · Tiran Kaskas

The problem is that the nl package was built with 2.1 version, and I have used this.

On a different topic: I found an issue, you probably want to fix
that: In reliable_pid_in_range1() function, the third parameter(extent) is an unsigned int. However, this function is being called by reliable_pid_min(), passing 0x80000000u as the value to extent. On a 16 bit machine (int is 16 bit) this will never work. The type of extent need to change to unsigned long and not int.

As Gert already said, OpenVPN is written for minimum 32bit architectures.
The first OpenVPN release was in 2002, long after 16bit computers were
quite irrelevant for most consumer users. So at the moment I'm sceptical if we should also support 16bit. As the int and also long integers will be a rats nest to review. You probably got more data types which needs to be reviewed as well.

On the 32bit platform both int and long are 4 bytes (32bit), while on 64bit int is 4 bytes and long is 8 bytes. And I'm not sure how long's are tackled on 16bit platforms, and if this is consistent the whole way through.

If we manage to fix OpenVPN to be 16bit safe as well, there are no guarantee that the SSL libraries will be 16bit safe. You also got potentially the LZO library as well - which may be skipped. The PKCS#11 support I guess is out of question on this kind of hardware. I would say it's better to get started "in the other end", with the SSL libraries first, to be sure the SSL layer is fine and 16bit safe before starting modifying OpenVPN.

kind regards,

David Sommerseth

Quoted 18 lines

-----Original Message----- From: Adriaan de Jong [mailto:[email protected]...] Sent: Tuesday, December 13, 2011 11:31 AM
To: Gert Doering; Tiran Kaskas Cc:
[email protected] Subject: RE: [Openvpn-devel] Problem with alloc_buf_gc function

Quoted 11 lines

-----Original Message----- From: Gert Doering
[mailto:[email protected]...]

Quoted 1 line · Tiran Kaskas

Is there a problem connecting a client running 2.1.4 (the one with

polarssl) to a server running 2.0.9?

Well, the default crypto algorithms are not compatible between polarssl and openssl-using openvpn. So you'd need to change the crypto settings on the openssl-openvpn [--cipher] - and upgrade to 2.2, while at it.

Quoted 7 lines

To be a little more specific: PolarSSL doesn't support blowfish (BF-CBC), a good option would be AES (AES-xxx-CBC). You can see the supported ciphers using --list-ciphers.

Adriaan

---------------------------------------------------------------------

-

Quoted 3 lines

--------

Systems Optimization Self Assessment

Quoted 1 line

Improve efficiency and utilization of IT resources. Drive out cost

and

Quoted 6 lines

improve service delivery. Take 5 minutes to use this Systems Optimization Self Assessment.
http://www.accelacomm.com/jaw/sdnl/114/51450054/
_______________________________________________ Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7oY6AACgkQDC186MBRfrouQwCgklEb0qpSEvD/edsRAqWP6Jni BHcAmwWP1qIVzttpJco+N+P63DC8qi4i
=v09z
-----END PGP SIGNATURE-----

#13 lore raw
In reply to Tiran Kaskas
Quoted 1 line · Tiran Kaskas

Already done the ssl part, only polarssl. It is working perfect and does support 16bit with no change.

You got all the data in PolarSSL, LZO and OpenVPN to fit in a 16-bit data-segment of 64 kByte? I'll be amazed. What memory model would be needed to link in all the code. 64 kByte would be not enough, so at least large model would be needed (1 data-segment multiple code- segments).

--gv

#14 lore raw

Indeed, a large model is used

-----Original Message-----
From: Gisle Vanem [mailto:[email protected]...]
Sent: Wednesday, December 14, 2011 11:45 AM
To: [email protected]
Subject: Re: [Openvpn-devel] Problem with alloc_buf_gc function

Quoted 1 line · Tiran Kaskas

Already done the ssl part, only polarssl. It is working perfect and does support 16bit with no change.

You got all the data in PolarSSL, LZO and OpenVPN to fit in a 16-bit data-segment of 64 kByte? I'll be amazed. What memory model would be needed to link in all the code. 64 kByte would be not enough, so at least large model would be needed (1 data-segment multiple code- segments).

--gv

------------------------------------------------------------------------------
Cloud Computing - Latest Buzzword or a Glimpse of the Future? This paper surveys cloud computing today: What are the benefits? Why are businesses embracing it? What are its payoffs and pitfalls?
http://www.accelacomm.com/jaw/sdnl/114/51425149/
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#15 lore raw

Again, need some help:

It seems like I am through with the vpn initialization, and seems like the session is created successfully.
Now, I start sending data to some server from the client side (I have an application which opens a socket to google.com and sends some data). I do see the packet is received on the server side and decrypted successfully (virtual address is the client's tun ip). I see the server reads this packet from the link adapter(ethernet), and writes it to the tun adapter.
Looking at the tun adapter (using wireshark), I see a packet is there with:
source ip: client's tun ip
destination ip: the google ip

The problem is that nothing happens from this point.
I am missing something, pretty sure about that, but do not know what...
I know that when the server write this packet to the TUN, it means the packet is injected into the OS ip stack, as if it was received from the outside. But who will take care of actually sending it to the destination address? Am I missing some routing configuration?

Thanks!

-----Original Message-----
From: Tiran Kaskas [mailto:[email protected]...]
Sent: Wednesday, December 14, 2011 11:47 AM
To: Gisle Vanem; [email protected]
Subject: Re: [Openvpn-devel] Problem with alloc_buf_gc function

Indeed, a large model is used

-----Original Message-----
From: Gisle Vanem [mailto:[email protected]...]
Sent: Wednesday, December 14, 2011 11:45 AM
To: [email protected]
Subject: Re: [Openvpn-devel] Problem with alloc_buf_gc function

Quoted 1 line · Tiran Kaskas

Already done the ssl part, only polarssl. It is working perfect and does support 16bit with no change.

You got all the data in PolarSSL, LZO and OpenVPN to fit in a 16-bit data-segment of 64 kByte? I'll be amazed. What memory model would be needed to link in all the code. 64 kByte would be not enough, so at least large model would be needed (1 data-segment multiple code- segments).

--gv

------------------------------------------------------------------------------
Cloud Computing - Latest Buzzword or a Glimpse of the Future? This paper surveys cloud computing today: What are the benefits? Why are businesses embracing it? What are its payoffs and pitfalls?
http://www.accelacomm.com/jaw/sdnl/114/51425149/
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

------------------------------------------------------------------------------
Cloud Computing - Latest Buzzword or a Glimpse of the Future? This paper surveys cloud computing today: What are the benefits? Why are businesses embracing it? What are its payoffs and pitfalls?
http://www.accelacomm.com/jaw/sdnl/114/51425149/
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#16 lore raw

Hi,

Quoted 3 lines · Tiran Kaskas

It seems like I am through with the vpn initialization, and seems like the session is created successfully.
Now, I start sending data to some server from the client side (I have an application which opens a socket to google.com and sends some data). I do see the packet is received on the server side and decrypted successfully (virtual address is the client's tun ip).

Cool :-)

Quoted 4 lines

I see the server reads this packet from the link adapter(ethernet), and writes it to the tun adapter. Looking at the tun adapter (using wireshark), I see a packet is there with:
source ip: client's tun ip
destination ip: the google ip

That's good.

Quoted 1 line

The problem is that nothing happens from this point.

Most likely, the Linux kernel side of things is dropping the packet because "ip forwarding" is not turned on - so it's not a router, and will not forward packets destined to someone else's address.

What you need to do is:

- make sure that your linux server is forwarding packets to its gateway
- make sure that the answer packets from google (etc) are routed *back* to your linux server
- either your external router knows how to route the client subnet back to the openvpn machine
- or you need to turn on NAT (masquerading) on the openvpn server, so that google will see all requests coming from the openvpn server's IP address

Some useful info is here:

http://www.secure-computing.net/wiki/index.php/OpenVPN/Routing

Quoted 4 lines

I am missing something, pretty sure about that, but do not know what... I know that when the server write this packet to the TUN, it means the packet is injected into the OS ip stack, as if it was received from the outside.

Exactly.

Quoted 2 lines

But who will take care of actually sending it to the destination address? Am I missing some routing configuration?

Linux needs to know that it is to be a router:

 # echo 1 >/proc/sys/net/ipv4/ip_forward

and it needs to have routes toward the destination.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#17 lore raw
Quoted 3 lines · Gert Doering

Linux needs to know that it is to be a router:

 # echo 1 >/proc/sys/net/ipv4/ip_forward

See /etc/sysctl.conf (man sysctl.conf) to set
forwarding at boot.

Karl <[email protected]...>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein

#18 lore raw

Well, the vpn server runs on windows.
You mean that every packet received from the outside should be forwarded to the tun?
The problem is that i do not see this reply from the outside coming into the vpn server(listenning on the physical link using wireshark).

Sent from my Android phone using TouchDown (www.nitrodesk.com)

-----Original Message-----
From: Karl O. Pinc [[email protected]...]
Received: יום חמישי, 29 דצמ 2011, 18:38
To: Tiran Kaskas [[email protected]...]
CC: [email protected] [[email protected]]
Subject: Re: [Openvpn-devel] Problem with alloc_buf_gc function

Quoted 3 lines · Gert Doering

Linux needs to know that it is to be a router:

 # echo 1 >/proc/sys/net/ipv4/ip_forward

See /etc/sysctl.conf (man sysctl.conf) to set
forwarding at boot.

Karl <[email protected]...>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein

#19 lore raw

Hi,

Quoted 1 line · Tiran Kaskas

Well, the vpn server runs on windows.

Why would you want to do that? But even though - you need to enable routing on the box, if you want it to be a router.

Quoted 1 line

You mean that every packet received from the outside should be forwarded to the tun?

No. Only packets destined to the tun interface.

Quoted 1 line

The problem is that i do not see this reply from the outside coming into the vpn server(listenning on the physical link using wireshark).

You didn't listen. If the box is not operating as a router, it will NOT forward packets for IP adresses not belonging to itself, but silently drop the packet ("this is not for me, I am not a router, to hell with it").

Now I wouldn't know how to enable ip forwarding on Windows, and I wouldn't even think of running an OpenVPN server on Windows, but supposedly it can be done. Let someone else chime in and answer that...

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#20 lore raw
Quoted 5 lines · Gert Doering

Now I wouldn't know how to enable ip forwarding on Windows, and I wouldn't
even think of running an OpenVPN server on Windows, but supposedly it can
be done. Let someone else chime in and answer that...

Perhaps on the openvpn-users list instead of on the developer list?

Karl <[email protected]...>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein