Skip to contentSkip to conversation

netsniff-ng: add dependency on libsodium.

PATCH New Yi Zheng 3 participants 5 messages Nov 4, 2019 – Nov 5, 2019 Kbuild

lore
Share & tools
lore

Yi Zheng

author
#0 lore raw

PATCH 1/1 netsniff-ng: add dependency on libsodium.

The tool 'curvetun' in netsniff-ng package can only be built when NACL/Sodium lib is added.

Adjust the dependency and the configure environ settings to build the curvetun tool.

---
 package/netsniff-ng/netsniff-ng.mk | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/package/netsniff-ng/netsniff-ng.mk
index 283ecaf245..34a9fd8a3a 100644

package/netsniff-ng/netsniff-ng.mk +4 -3
@@ -11,9 +11,10 @@ NETSNIFF_NG_LICENSE = GPL-2.0
 NETSNIFF_NG_LICENSE_FILES = README COPYING
 # Prevent netsniff-ng configure script from finding a host installed nacl
 NETSNIFF_NG_CONF_ENV = \
-       NACL_INC_DIR=/dev/null \
-       NACL_LIB_DIR=/dev/null
-NETSNIFF_NG_DEPENDENCIES = libnl libpcap libnetfilter_conntrack liburcu
+       NACL_INC_DIR=$(STAGING_DIR)/usr/include/sodium \
+       NACL_LIB_DIR=$(STAGING_DIR)/lib\
+       NACL_LIB=sodium
+NETSNIFF_NG_DEPENDENCIES = libnl libpcap libnetfilter_conntrack

liburcu libsodium

ifeq ($(BR2_PACKAGE_NETSNIFF_NG_MAUSEZAHN),y)
NETSNIFF_NG_DEPENDENCIES += libcli libnet
--
2.23.0

#1 lore raw

PATCH 1/1 netsniff-ng: add dependency on libsodium.

Hi Zheng,

Quoted 18 lines · Yi Zheng

The tool 'curvetun' in netsniff-ng package can only be built when NACL/Sodium lib is added.

Adjust the dependency and the configure environ settings to build the curvetun tool.

---
 package/netsniff-ng/netsniff-ng.mk | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
package/netsniff-ng/netsniff-ng.mk +0 -0
index 283ecaf245..34a9fd8a3a 100644

package/netsniff-ng/netsniff-ng.mk NETSNIFF_NG_LICENSE = GPL-2.0 · line 15

Quoted 5 lines
package/netsniff-ng/netsniff-ng.mk +0 -2
@@ -11,9 +11,10 @@ NETSNIFF_NG_LICENSE = GPL-2.0
 NETSNIFF_NG_LICENSE_FILES = README COPYING
 # Prevent netsniff-ng configure script from finding a host installed nacl
 NETSNIFF_NG_CONF_ENV = \
-       NACL_INC_DIR=/dev/null \
-       NACL_LIB_DIR=/dev/null

probably you need to check if BR2_PACKAGE_LIBSODIUM is selected and only then link with it and add to dependencies list ?

Quoted 11 lines
package/netsniff-ng/netsniff-ng.mk +4 -1
-NETSNIFF_NG_DEPENDENCIES = libnl libpcap libnetfilter_conntrack liburcu
+       NACL_INC_DIR=$(STAGING_DIR)/usr/include/sodium \
+       NACL_LIB_DIR=$(STAGING_DIR)/lib\
+       NACL_LIB=sodium
+NETSNIFF_NG_DEPENDENCIES = libnl libpcap libnetfilter_conntrack

liburcu libsodium

ifeq ($(BR2_PACKAGE_NETSNIFF_NG_MAUSEZAHN),y)
NETSNIFF_NG_DEPENDENCIES += libcli libnet
--
2.23.0

Regards,
Vadym Kochan

author
#2 lore raw

PATCH 1/1 netsniff-ng: add libsodium/nacl dependency, to build curvetun tool

The tool 'curvetun' in netsniff-ng package can only be built when NACL/Sodium lib is added.

Adjust the dependency and the configure environ settings to build the curvetun tool.

---
 Makefile                           |  1 +
 package/netsniff-ng/Config.in      |  5 +++++
 package/netsniff-ng/netsniff-ng.mk | 13 ++++++++++++-
 3 files changed, 18 insertions(+), 1 deletion(-)
Makefile +1 -0
index bab34ab9b5..e028a0dc60 100644
@@ -1198,3 +1198,4 @@ include docs/manual/manual.mk
 .PHONY: $(noconfig_targets)
 
 endif #umask / $(CURDIR) / $(O)
+
package/netsniff-ng/Config.in +5 -0
index 5d1407baac..9adae0510a 100644
@@ -27,6 +27,11 @@ config BR2_PACKAGE_NETSNIFF_NG_MAUSEZAHN
 comment "mausezahn needs glibc or musl toolchain"
     depends on BR2_TOOLCHAIN_USES_UCLIBC
 
+config BR2_PACKAGE_NETSNIFF_NG_CURVETUN
+    bool "curvetun"
+    default y
+    select BR2_PACKAGE_LIBSODIUM
+
 endif
 
 comment "netsniff-ng needs a toolchain w/ threads, headers >= 3.0"
(quoted diff) +0 -0

b/package/netsniff-ng/netsniff-ng.mk
index 283ecaf245..b6b03403ad 100644

package/netsniff-ng/netsniff-ng.mk +12 -1
@@ -9,11 +9,22 @@ NETSNIFF_NG_SITE = http://pub.netsniff-ng.org/netsniff-ng
 NETSNIFF_NG_SOURCE = netsniff-ng-$(NETSNIFF_NG_VERSION).tar.xz
 NETSNIFF_NG_LICENSE = GPL-2.0
 NETSNIFF_NG_LICENSE_FILES = README COPYING
+
+NETSNIFF_NG_DEPENDENCIES = libnl libpcap libnetfilter_conntrack liburcu
+
+ifeq ($(BR2_PACKAGE_NETSNIFF_NG_CURVETUN),y)
+# Prevent netsniff-ng configure script from finding a host installed nacl
+NETSNIFF_NG_CONF_ENV = \
+    NACL_INC_DIR=$(STAGING_DIR)/usr/include/sodium \
+    NACL_LIB_DIR=$(STAGING_DIR)/lib \
+    NACL_LIB=sodium
+NETSNIFF_NG_DEPENDENCIES += libsodium
+else
 # Prevent netsniff-ng configure script from finding a host installed nacl
 NETSNIFF_NG_CONF_ENV = \
     NACL_INC_DIR=/dev/null \
     NACL_LIB_DIR=/dev/null
-NETSNIFF_NG_DEPENDENCIES = libnl libpcap libnetfilter_conntrack liburcu
+endif
 
 ifeq ($(BR2_PACKAGE_NETSNIFF_NG_MAUSEZAHN),y)
 NETSNIFF_NG_DEPENDENCIES += libcli libnet
Signature · 1 line
2.23.0
#3 lore raw

PATCH 1/1 netsniff-ng: add libsodium/nacl dependency, to build curvetun tool

Zheng, All,

On 2019-11-04 21:58 +0800, Yi Zheng spake thusly:

Quoted 5 lines

The tool 'curvetun' in netsniff-ng package can only be built when NACL/Sodium lib is added.

Adjust the dependency and the configure environ settings to build the curvetun tool.

Thanks for this new version of the patch. I have a few comments about it.

First, the title should be something like:

package/netsniff-ng: add option to build curvetun

Second, your patch does not apply as-is: the TABs have been replaced by spaces. Please, can you use 'git send-emal' to send the patches, as this keeps the integrity of the patch, next time?

Quoted 12 lines
---
 Makefile                           |  1 +
 package/netsniff-ng/Config.in      |  5 +++++
 package/netsniff-ng/netsniff-ng.mk | 13 ++++++++++++-
 3 files changed, 18 insertions(+), 1 deletion(-)
Makefile +0 -0
index bab34ab9b5..e028a0dc60 100644

Makefile include docs/manual/manual.mk · line 1201

Quoted 4 lines
Makefile +1 -0
@@ -1198,3 +1198,4 @@ include docs/manual/manual.mk
 .PHONY: $(noconfig_targets)
 
 endif #umask / $(CURDIR) / $(O)
+

Spurious empty line change.

package/netsniff-ng/Config.in config BR2_PACKAGE_NETSNIFF_NG_MAUSEZAHN · line 32

Quoted 11 lines
package/netsniff-ng/Config.in +3 -0
index 5d1407baac..9adae0510a 100644
@@ -27,6 +27,11 @@ config BR2_PACKAGE_NETSNIFF_NG_MAUSEZAHN
 comment "mausezahn needs glibc or musl toolchain"
     depends on BR2_TOOLCHAIN_USES_UCLIBC
 
+config BR2_PACKAGE_NETSNIFF_NG_CURVETUN
+    bool "curvetun"
+    default y

We usually do not use 'default y' for optional features, especially when such a feature was previously disabled anyway.

Note that mausezahn is a special case, because it is an optional feature that was previously always built, so it got a 'default y' to keep old (def)config files working.

Quoted 12 lines
package/netsniff-ng/Config.in +2 -0
+    select BR2_PACKAGE_LIBSODIUM
+
 endif
 
 comment "netsniff-ng needs a toolchain w/ threads, headers >= 3.0"
package/netsniff-ng/netsniff-ng.mk +0 -0
index 283ecaf245..b6b03403ad 100644
@@ -9,11 +9,22 @@ NETSNIFF_NG_SITE = http://pub.netsniff-ng.org/netsniff-ng
 NETSNIFF_NG_SOURCE = netsniff-ng-$(NETSNIFF_NG_VERSION).tar.xz

package/netsniff-ng/netsniff-ng.mk NETSNIFF_NG_SITE = http://pub.netsniff-ng.org/netsniff-ng · line 19

Quoted 10 lines
package/netsniff-ng/netsniff-ng.mk +8 -0
 NETSNIFF_NG_LICENSE = GPL-2.0
 NETSNIFF_NG_LICENSE_FILES = README COPYING
+
+NETSNIFF_NG_DEPENDENCIES = libnl libpcap libnetfilter_conntrack liburcu
+
+ifeq ($(BR2_PACKAGE_NETSNIFF_NG_CURVETUN),y)
+# Prevent netsniff-ng configure script from finding a host installed nacl
+NETSNIFF_NG_CONF_ENV = \
+    NACL_INC_DIR=$(STAGING_DIR)/usr/include/sodium \
+    NACL_LIB_DIR=$(STAGING_DIR)/lib \

libsodium is in $(STAGING_DIR)/usr/lib, not in .../lib but bizarrely enough, this patch still produced a curvetune properly linked with libsodium...

Can you check whether those options (NACL_INC_DIR and NACL_LIB_DIR) are indeed really needed? Probably, keeping NACL_LIB=sodium might be jsut enough...

Regards,
Yann E. MORIN.

Quoted 18 lines
package/netsniff-ng/netsniff-ng.mk +4 -1
+    NACL_LIB=sodium
+NETSNIFF_NG_DEPENDENCIES += libsodium
+else
 # Prevent netsniff-ng configure script from finding a host installed nacl
 NETSNIFF_NG_CONF_ENV = \
     NACL_INC_DIR=/dev/null \
     NACL_LIB_DIR=/dev/null
-NETSNIFF_NG_DEPENDENCIES = libnl libpcap libnetfilter_conntrack liburcu
+endif
 
 ifeq ($(BR2_PACKAGE_NETSNIFF_NG_MAUSEZAHN),y)
 NETSNIFF_NG_DEPENDENCIES += libcli libnet
Signature · 5 lines
2.23.0
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
author
#4 lore raw

PATCH 1/1 netsniff-ng: add libsodium/nacl dependency, to build curvetun tool

Hi Yann,

About TAB problem, it is hard for me!
Currently, I can only access my gmail by web. My MUTT mailer is
forbidden to send mail by the GFW in China.
I'll try to find the right way to commit the patch by mail. Damn it, those who developed the GFW will be cursed!

Yann E. MORIN <[email protected]> ?2019?11?5??? ??5:57???

Quoted 119 lines

Zheng, All,

On 2019-11-04 21:58 +0800, Yi Zheng spake thusly:

Quoted 5 lines

The tool 'curvetun' in netsniff-ng package can only be built when NACL/Sodium lib is added.

Adjust the dependency and the configure environ settings to build the curvetun tool.

Thanks for this new version of the patch. I have a few comments about it.

First, the title should be something like:

package/netsniff-ng: add option to build curvetun

Second, your patch does not apply as-is: the TABs have been replaced by spaces. Please, can you use 'git send-emal' to send the patches, as this keeps the integrity of the patch, next time?

Quoted 12 lines
---
 Makefile                           |  1 +
 package/netsniff-ng/Config.in      |  5 +++++
 package/netsniff-ng/netsniff-ng.mk | 13 ++++++++++++-
 3 files changed, 18 insertions(+), 1 deletion(-)
Makefile +0 -0
index bab34ab9b5..e028a0dc60 100644

Makefile include docs/manual/manual.mk · line 1201

Quoted 4 lines
Makefile +1 -0
@@ -1198,3 +1198,4 @@ include docs/manual/manual.mk
 .PHONY: $(noconfig_targets)
 
 endif #umask / $(CURDIR) / $(O)
+

Spurious empty line change.

package/netsniff-ng/Config.in config BR2_PACKAGE_NETSNIFF_NG_MAUSEZAHN · line 32

Quoted 11 lines
package/netsniff-ng/Config.in +3 -0
index 5d1407baac..9adae0510a 100644
@@ -27,6 +27,11 @@ config BR2_PACKAGE_NETSNIFF_NG_MAUSEZAHN
 comment "mausezahn needs glibc or musl toolchain"
     depends on BR2_TOOLCHAIN_USES_UCLIBC
 
+config BR2_PACKAGE_NETSNIFF_NG_CURVETUN
+    bool "curvetun"
+    default y

We usually do not use 'default y' for optional features, especially when such a feature was previously disabled anyway.

Note that mausezahn is a special case, because it is an optional feature that was previously always built, so it got a 'default y' to keep old (def)config files working.

Quoted 12 lines
package/netsniff-ng/Config.in +2 -0
+    select BR2_PACKAGE_LIBSODIUM
+
 endif
 
 comment "netsniff-ng needs a toolchain w/ threads, headers >= 3.0"
package/netsniff-ng/netsniff-ng.mk +0 -0
index 283ecaf245..b6b03403ad 100644
@@ -9,11 +9,22 @@ NETSNIFF_NG_SITE = http://pub.netsniff-ng.org/netsniff-ng
 NETSNIFF_NG_SOURCE = netsniff-ng-$(NETSNIFF_NG_VERSION).tar.xz

package/netsniff-ng/netsniff-ng.mk NETSNIFF_NG_SITE = http://pub.netsniff-ng.org/netsniff-ng · line 19

Quoted 10 lines
package/netsniff-ng/netsniff-ng.mk +8 -0
 NETSNIFF_NG_LICENSE = GPL-2.0
 NETSNIFF_NG_LICENSE_FILES = README COPYING
+
+NETSNIFF_NG_DEPENDENCIES = libnl libpcap libnetfilter_conntrack liburcu
+
+ifeq ($(BR2_PACKAGE_NETSNIFF_NG_CURVETUN),y)
+# Prevent netsniff-ng configure script from finding a host installed nacl
+NETSNIFF_NG_CONF_ENV = \
+    NACL_INC_DIR=$(STAGING_DIR)/usr/include/sodium \
+    NACL_LIB_DIR=$(STAGING_DIR)/lib \

libsodium is in $(STAGING_DIR)/usr/lib, not in .../lib but bizarrely enough, this patch still produced a curvetune properly linked with libsodium...

Can you check whether those options (NACL_INC_DIR and NACL_LIB_DIR) are indeed really needed? Probably, keeping NACL_LIB=sodium might be jsut enough...

Regards,
Yann E. MORIN.

Quoted 13 lines
package/netsniff-ng/netsniff-ng.mk +4 -2
+    NACL_LIB=sodium
+NETSNIFF_NG_DEPENDENCIES += libsodium
+else
 # Prevent netsniff-ng configure script from finding a host installed nacl
 NETSNIFF_NG_CONF_ENV = \
     NACL_INC_DIR=/dev/null \
     NACL_LIB_DIR=/dev/null
-NETSNIFF_NG_DEPENDENCIES = libnl libpcap libnetfilter_conntrack liburcu
+endif
 
 ifeq ($(BR2_PACKAGE_NETSNIFF_NG_MAUSEZAHN),y)
 NETSNIFF_NG_DEPENDENCIES += libcli libnet
--
Quoted 5 lines

2.23.0
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'