Skip to content

Commit

Permalink
TCP NSC bugfix for 64 bit systems
Browse files Browse the repository at this point in the history
the README edited, too
  • Loading branch information
ZoltanBojthe committed Feb 18, 2011
1 parent 280efb0 commit 8a2211d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
18 changes: 14 additions & 4 deletions 3rdparty/README
Expand Up @@ -7,14 +7,24 @@ Supported software:

Download NSC from: http://www.wand.net.nz/~stj2/nsc/

Extract the 'nsc-0.5.1.tar.bz2' tarball in this directory and build it.
Extract the 'nsc-0.5.2.tar.bz2' tarball in this directory and build it.

$ tar xvfj nsc-0.5.1.tar.bz2
$ cd nsc-0.5.1
$ tar xvfj nsc-0.5.2.tar.bz2

When you use it on a 64 bit system, you must use the 'nsc-0.5.2-amd64.patch'.
The NSC works with this patch on 32 bit system, too.

$ patch -p 1 <nsc-0.5.2-amd64.patch

Build the 'nsc-0.5.2'.

$ cd nsc-0.5.2
$ python scons.py

This should generate libfreebsd5.3.so, liblinux2.6.10.so, liblinux2.6.18.so,
liblinux2.6.26.so, liblwip.so, libopenbsd3.5.so in the nsc-0.5.1 directory.
liblinux2.6.26.so, liblwip.so, libopenbsd3.5.so in the nsc-0.5.2 directory.
When you use it on a 64 bit system, the generated libraries are
liblinux2.6.18.so and liblinux2.6.26.so only.

Then rebuild INET.

Expand Down
15 changes: 15 additions & 0 deletions 3rdparty/nsc-0.5.2-amd64.patch
@@ -0,0 +1,15 @@
--- a/nsc-0.5.2/linux-2.6.26/nsc/sim_support.cpp 2010-08-12 22:38:44.000000000 +0200
+++ b/nsc-0.5.2/linux-2.6.26/nsc/sim_support.cpp 2011-02-18 16:13:01.198735996 +0100
@@ -428,9 +428,9 @@
{
// net/core/wmem_default = 106496
// net/core/wmem_max = 131071
- size_t oldval, oldlen = sizeof(oldval);
- size_t newval = size, newlen = sizeof(newval);
- size_t oldval3[3], newval3[3];
+ int oldval; size_t oldlen = sizeof(oldval);
+ int newval = size; size_t newlen = sizeof(newval);
+ int oldval3[3], newval3[3];
int err;

newval = size;

0 comments on commit 8a2211d

Please sign in to comment.