All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iputils 1/6] start gitignore files
@ 2016-06-01  3:48 Mike Frysinger
  2016-06-01  3:48 ` [PATCH iputils 2/6] doc: fix parallel build of html/man pages Mike Frysinger
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: Mike Frysinger @ 2016-06-01  3:48 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki; +Cc: netdev

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 .gitignore     | 22 ++++++++++++++++++++++
 doc/.gitignore |  2 ++
 2 files changed, 24 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 doc/.gitignore

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..30ed00c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,22 @@
+*~
+*.o
+
+*.diff
+*.orig
+*.patch
+*.rej
+
+core
+.gdb_history
+.gdbinit
+
+/arping
+/clockdiff
+/ping
+/ping6
+/rarpd
+/rdisc
+/tftpd
+/tracepath
+/tracepath6
+/traceroute6
diff --git a/doc/.gitignore b/doc/.gitignore
new file mode 100644
index 0000000..085639f
--- /dev/null
+++ b/doc/.gitignore
@@ -0,0 +1,2 @@
+*.html
+*.8
-- 
2.8.2

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH iputils 2/6] doc: fix parallel build of html/man pages
  2016-06-01  3:48 [PATCH iputils 1/6] start gitignore files Mike Frysinger
@ 2016-06-01  3:48 ` Mike Frysinger
  2016-06-02  2:39   ` YOSHIFUJI Hideaki
  2016-06-01  3:48 ` [PATCH iputils 3/6] ping6: allow disabling of openssl support Mike Frysinger
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 22+ messages in thread
From: Mike Frysinger @ 2016-06-01  3:48 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki; +Cc: netdev

The use of the same tempdir prevents building of these files in parallel.
So build all of them in unique tempdirs so we can do them in parallel.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 doc/Makefile | 37 ++++++++++++++++++++++++-------------
 1 file changed, 24 insertions(+), 13 deletions(-)

diff --git a/doc/Makefile b/doc/Makefile
index 7ec4f1c..4f930a3 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -12,29 +12,40 @@ man: $(MANFILES)
 # lots of some strange temporary junk directories and files.
 # So, scope it to a temporary dir and clean all after each run.
 
-$(HTMLFILES): index.db
-	@-rm -rf tmp.db2html
-	@mkdir tmp.db2html
-	@set -e; cd tmp.db2html; docbook2html ../$< ; mv *.html ..
-	@-rm -rf tmp.db2html
+SETUP_TMPDIR = \
+	t="tmp.db2html.$@"; \
+	rm -rf $$t; \
+	mkdir $$t; \
+	cd $$t
+CLEAN_TMPDIR = \
+	cd ..; \
+	rm -rf $$t
+
+MAKE_HTML = \
+	@set -e; \
+	$(SETUP_TMPDIR); \
+	docbook2html ../$<; \
+	mv *.html ..; \
+	$(CLEAN_TMPDIR)
 
+$(HTMLFILES): index.db
+	$(MAKE_HTML)
 iputils.html: iputils.db
-	@-rm -rf tmp.db2html
-	@mkdir tmp.db2html
-	@set -e; cd tmp.db2html; docbook2html -u -o html ../$< ; mv html/$@ ..
-	@-rm -rf tmp.db2html
+	$(MAKE_HTML)
 
 # docbook2man produces utterly ugly output and I did not find
 # any way to customize this but hacking backend perl script a little.
 # Well, hence...
 
 $(MANFILES): index.db
-	@-mkdir tmp.db2man
-	@set -e; cd tmp.db2man; nsgmls ../$< | sgmlspl ../docbook2man-spec.pl ;	mv $@ ..
-	@-rm -rf tmp.db2man
+	@set -e; \
+	$(SETUP_TMPDIR); \
+	nsgmls ../$< | sgmlspl ../docbook2man-spec.pl; \
+	mv $@ ..; \
+	$(CLEAN_TMPDIR)
 
 clean:
-	@rm -rf $(MANFILES) $(HTMLFILES) iputils.html tmp.db2html tmp.db2man
+	@rm -rf $(MANFILES) $(HTMLFILES) iputils.html tmp.db2html* tmp.db2man*
 
 snapshot:
 	@date "+%y%m%d" > snapshot.db
-- 
2.8.2

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH iputils 3/6] ping6: allow disabling of openssl support
  2016-06-01  3:48 [PATCH iputils 1/6] start gitignore files Mike Frysinger
  2016-06-01  3:48 ` [PATCH iputils 2/6] doc: fix parallel build of html/man pages Mike Frysinger
@ 2016-06-01  3:48 ` Mike Frysinger
  2016-06-02  2:04   ` YOSHIFUJI Hideaki
  2016-06-02  4:59   ` [PATCH iputils v2] ping6: allow disabling of openssl/libgcrypt support Mike Frysinger
  2016-06-01  3:48 ` [PATCH iputils 4/6] fix handling of CFLAGS Mike Frysinger
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 22+ messages in thread
From: Mike Frysinger @ 2016-06-01  3:48 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki; +Cc: netdev

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 Makefile         |  5 ++++-
 iputils_md5dig.h |  4 +++-
 ping6.c          | 10 ++++++++++
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 54e5a6d..7147f08 100644
--- a/Makefile
+++ b/Makefile
@@ -36,7 +36,7 @@ ARPING_DEFAULT_DEVICE=
 
 # Libgcrypt (for MD5) for ping6 [yes|no|static]
 USE_GCRYPT=yes
-# Crypto library for ping6 [shared|static]
+# Crypto library for ping6 [shared|static|no]
 USE_CRYPTO=shared
 # Resolv library for ping6 [yes|static]
 USE_RESOLV=yes
@@ -63,7 +63,10 @@ ifneq ($(USE_GCRYPT),no)
 	LIB_CRYPTO = $(call FUNC_LIB,$(USE_GCRYPT),$(LDFLAG_GCRYPT))
 	DEF_CRYPTO = -DUSE_GCRYPT
 else
+ifneq ($(USE_CRYPTO),no)
 	LIB_CRYPTO = $(call FUNC_LIB,$(USE_CRYPTO),$(LDFLAG_CRYPTO))
+	DEF_CRYPTO = -DUSE_OPENSSL
+endif
 endif
 
 # USE_RESOLV: LIB_RESOLV
diff --git a/iputils_md5dig.h b/iputils_md5dig.h
index 4cec866..d6c4d46 100644
--- a/iputils_md5dig.h
+++ b/iputils_md5dig.h
@@ -5,8 +5,10 @@
 # include <stdlib.h>
 # include <gcrypt.h>
 # define IPUTILS_MD5DIG_LEN	16
-#else
+# define USE_CRYPTO
+#elif defined(USE_OPENSSL)
 # include <openssl/md5.h>
+# define USE_CRYPTO
 #endif
 
 #ifdef USE_GCRYPT
diff --git a/ping6.c b/ping6.c
index 6d1a6db..cd140e2 100644
--- a/ping6.c
+++ b/ping6.c
@@ -324,6 +324,7 @@ static void niquery_init_nonce(void)
 #if !PING6_NONCE_MEMORY
 static int niquery_nonce(__u8 *nonce, int fill)
 {
+# ifdef USE_CRYPTO
 	static __u8 digest[MD5_DIGEST_LENGTH];
 	static int seq = -1;
 
@@ -346,6 +347,10 @@ static int niquery_nonce(__u8 *nonce, int fill)
 			return -1;
 		return ntohsp((__u16 *)nonce);
 	}
+# else
+	fprintf(stderr, "ping6: function not available; crypto disabled\n");
+	exit(3);
+# endif
 }
 #endif
 
@@ -500,6 +505,7 @@ static int niquery_option_subject_addr_handler(int index, const char *arg)
 
 static int niquery_option_subject_name_handler(int index, const char *arg)
 {
+#ifdef USE_CRYPTO
 	static char nigroup_buf[INET6_ADDRSTRLEN + 1 + IFNAMSIZ];
 	unsigned char *dnptrs[2], **dpp, **lastdnptr;
 	int n;
@@ -625,6 +631,10 @@ errexit:
 	free(idn);
 	free(name);
 	exit(1);
+#else
+	fprintf(stderr, "ping6: function not available; crypto disabled\n");
+	exit(3);
+#endif
 }
 
 int niquery_option_help_handler(int index, const char *arg)
-- 
2.8.2

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH iputils 4/6] fix handling of CFLAGS
  2016-06-01  3:48 [PATCH iputils 1/6] start gitignore files Mike Frysinger
  2016-06-01  3:48 ` [PATCH iputils 2/6] doc: fix parallel build of html/man pages Mike Frysinger
  2016-06-01  3:48 ` [PATCH iputils 3/6] ping6: allow disabling of openssl support Mike Frysinger
@ 2016-06-01  3:48 ` Mike Frysinger
  2016-06-02  2:35   ` YOSHIFUJI Hideaki
  2016-06-01  3:48 ` [PATCH iputils 5/6] tftpd: fix syslog setup Mike Frysinger
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 22+ messages in thread
From: Mike Frysinger @ 2016-06-01  3:48 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki; +Cc: netdev

This defaults CFLAGS to -O3 without clobbering settings people have set
up in the environment already.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 Makefile | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index 7147f08..362f1c8 100644
--- a/Makefile
+++ b/Makefile
@@ -2,8 +2,6 @@
 # Configuration
 #
 
-# CC
-CC=gcc
 # Path to parent kernel include files directory
 LIBC_INCLUDE=/usr/include
 # Libraries
@@ -48,11 +46,10 @@ ENABLE_RDISC_SERVER=no
 
 # -------------------------------------
 # What a pity, all new gccs are buggy and -Werror does not work. Sigh.
-# CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -Werror -g
-CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -g
-CCOPTOPT=-O3
-GLIBCFIX=-D_GNU_SOURCE
-DEFINES=
+# CFLAGS+=-fno-strict-aliasing -Wstrict-prototypes -Wall -Werror -g
+CFLAGS?=-O3 -g
+CFLAGS+=-fno-strict-aliasing -Wstrict-prototypes -Wall
+CPPFLAGS+=-D_GNU_SOURCE
 LDLIB=
 
 FUNC_LIB = $(if $(filter static,$(1)),$(LDFLAG_STATIC) $(2) $(LDFLAG_DYNAMIC),$(2))
@@ -113,7 +110,6 @@ IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd
 IPV6_TARGETS=tracepath6 traceroute6 ping6
 TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS)
 
-CFLAGS=$(CCOPTOPT) $(CCOPT) $(GLIBCFIX) $(DEFINES)
 LDLIBS=$(LDLIB) $(ADDLIB)
 
 UNAME_N:=$(shell uname -n)
@@ -132,6 +128,7 @@ all: $(TARGETS)
 	$(COMPILE.c) $< $(DEF_$(patsubst %.o,%,$@)) -S -o $@
 %.o: %.c
 	$(COMPILE.c) $< $(DEF_$(patsubst %.o,%,$@)) -o $@
+LINK.o += $(CFLAGS)
 $(TARGETS): %: %.o
 	$(LINK.o) $^ $(LIB_$@) $(LDLIBS) -o $@
 
-- 
2.8.2

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH iputils 5/6] tftpd: fix syslog setup
  2016-06-01  3:48 [PATCH iputils 1/6] start gitignore files Mike Frysinger
                   ` (2 preceding siblings ...)
  2016-06-01  3:48 ` [PATCH iputils 4/6] fix handling of CFLAGS Mike Frysinger
@ 2016-06-01  3:48 ` Mike Frysinger
  2016-06-02  2:10   ` YOSHIFUJI Hideaki
  2016-06-01  3:48 ` [PATCH iputils 6/6] ping: fix -i number parsing in locales Mike Frysinger
  2016-06-02  2:06 ` [PATCH iputils 1/6] start gitignore files YOSHIFUJI Hideaki
  5 siblings, 1 reply; 22+ messages in thread
From: Mike Frysinger @ 2016-06-01  3:48 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki; +Cc: netdev

Commit d81a44625b04d487c895473aa77af13420b7afdd added support for checking
the set*id calls, but would call syslog() before it had called openlog().
Move the call up earlier to fix that.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 tftpd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tftpd.c b/tftpd.c
index e3af2f4..7ddc8eb 100644
--- a/tftpd.c
+++ b/tftpd.c
@@ -109,6 +109,8 @@ int main(int ac, char **av)
 	register int n = 0;
 	int on = 1;
 
+	openlog("tftpd", LOG_PID, LOG_DAEMON);
+
 	/* Sanity. If parent forgot to setuid() on us. */
 	if (geteuid() == 0) {
 		if (setgid(65534)) {
@@ -125,7 +127,6 @@ int main(int ac, char **av)
 	while (ac-- > 0 && n < MAXARG)
 		dirs[n++] = *av++;
 
-	openlog("tftpd", LOG_PID, LOG_DAEMON);
 	if (ioctl(0, FIONBIO, &on) < 0) {
 		syslog(LOG_ERR, "ioctl(FIONBIO): %m\n");
 		exit(1);
-- 
2.8.2

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH iputils 6/6] ping: fix -i number parsing in locales
  2016-06-01  3:48 [PATCH iputils 1/6] start gitignore files Mike Frysinger
                   ` (3 preceding siblings ...)
  2016-06-01  3:48 ` [PATCH iputils 5/6] tftpd: fix syslog setup Mike Frysinger
@ 2016-06-01  3:48 ` Mike Frysinger
  2016-06-02  2:08   ` YOSHIFUJI Hideaki
  2016-06-02  4:46   ` [PATCH iputils v2] ping: always accept . delimiter with -i number parsing Mike Frysinger
  2016-06-02  2:06 ` [PATCH iputils 1/6] start gitignore files YOSHIFUJI Hideaki
  5 siblings, 2 replies; 22+ messages in thread
From: Mike Frysinger @ 2016-06-01  3:48 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki; +Cc: netdev

Always use #.# format for the -i flag even when the current locale uses
a different separator.  Locale de_DE which uses #,# normally.

Simple testcase:
$ make USE_IDN=1
$ LANG=de_DE.UTF8 ./ping -i 0.5 localhost

Reported-by: Sergey Fionov <fionov@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 ping_common.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/ping_common.c b/ping_common.c
index 62f53a6..0a37e09 100644
--- a/ping_common.c
+++ b/ping_common.c
@@ -269,9 +269,17 @@ void common_options(int ch)
 		double dbl;
 		char *ep;
 
+#ifdef USE_IDN
+		setlocale(LC_ALL, "C");
+#endif
+
 		errno = 0;
 		dbl = strtod(optarg, &ep);
 
+#ifdef USE_IDN
+		setlocale(LC_ALL, "");
+#endif
+
 		if (errno || *ep != '\0' ||
 		    !finite(dbl) || dbl < 0.0 || dbl >= (double)INT_MAX / 1000 - 1.0) {
 			fprintf(stderr, "ping: bad timing interval\n");
-- 
2.8.2

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH iputils 3/6] ping6: allow disabling of openssl support
  2016-06-01  3:48 ` [PATCH iputils 3/6] ping6: allow disabling of openssl support Mike Frysinger
@ 2016-06-02  2:04   ` YOSHIFUJI Hideaki
  2016-06-02  4:59   ` [PATCH iputils v2] ping6: allow disabling of openssl/libgcrypt support Mike Frysinger
  1 sibling, 0 replies; 22+ messages in thread
From: YOSHIFUJI Hideaki @ 2016-06-02  2:04 UTC (permalink / raw)
  To: Mike Frysinger, YOSHIFUJI Hideaki; +Cc: hideaki.yoshifuji, netdev

Hi,

Mike Frysinger wrote:
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>  Makefile         |  5 ++++-
>  iputils_md5dig.h |  4 +++-
>  ping6.c          | 10 ++++++++++
>  3 files changed, 17 insertions(+), 2 deletions(-)
> 
:

> diff --git a/ping6.c b/ping6.c
> index 6d1a6db..cd140e2 100644
> --- a/ping6.c
> +++ b/ping6.c
> @@ -324,6 +324,7 @@ static void niquery_init_nonce(void)
>  #if !PING6_NONCE_MEMORY
>  static int niquery_nonce(__u8 *nonce, int fill)
>  {
> +# ifdef USE_CRYPTO
>  	static __u8 digest[MD5_DIGEST_LENGTH];
>  	static int seq = -1;
>  
> @@ -346,6 +347,10 @@ static int niquery_nonce(__u8 *nonce, int fill)
>  			return -1;
>  		return ntohsp((__u16 *)nonce);
>  	}
> +# else
> +	fprintf(stderr, "ping6: function not available; crypto disabled\n");
> +	exit(3);
> +# endif
>  }
>  #endif
>  
> @@ -500,6 +505,7 @@ static int niquery_option_subject_addr_handler(int index, const char *arg)
>  
>  static int niquery_option_subject_name_handler(int index, const char *arg)
>  {
> +#ifdef USE_CRYPTO
>  	static char nigroup_buf[INET6_ADDRSTRLEN + 1 + IFNAMSIZ];
>  	unsigned char *dnptrs[2], **dpp, **lastdnptr;
>  	int n;
> @@ -625,6 +631,10 @@ errexit:
>  	free(idn);
>  	free(name);
>  	exit(1);
> +#else
> +	fprintf(stderr, "ping6: function not available; crypto disabled\n");
> +	exit(3);
> +#endif
>  }
>  
>  int niquery_option_help_handler(int index, const char *arg)
> 

NAK. If you really build ping without crypto libraries,
you should disable Node Ifnforamtion Query support completely.

-- 
Hideaki Yoshifuji <hideaki.yoshifuji@miraclelinux.com>
Technical Division, MIRACLE LINUX CORPORATION

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH iputils 1/6] start gitignore files
  2016-06-01  3:48 [PATCH iputils 1/6] start gitignore files Mike Frysinger
                   ` (4 preceding siblings ...)
  2016-06-01  3:48 ` [PATCH iputils 6/6] ping: fix -i number parsing in locales Mike Frysinger
@ 2016-06-02  2:06 ` YOSHIFUJI Hideaki
  2016-06-02  4:42   ` Mike Frysinger
  5 siblings, 1 reply; 22+ messages in thread
From: YOSHIFUJI Hideaki @ 2016-06-02  2:06 UTC (permalink / raw)
  To: Mike Frysinger, YOSHIFUJI Hideaki; +Cc: hideaki.yoshifuji, netdev

Hi,

Mike Frysinger wrote:
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>  .gitignore     | 22 ++++++++++++++++++++++
>  doc/.gitignore |  2 ++
>  2 files changed, 24 insertions(+)
>  create mode 100644 .gitignore
>  create mode 100644 doc/.gitignore
> 

files under ninfod/ as well, maybe?

-- 
Hideaki Yoshifuji <hideaki.yoshifuji@miraclelinux.com>
Technical Division, MIRACLE LINUX CORPORATION

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH iputils 6/6] ping: fix -i number parsing in locales
  2016-06-01  3:48 ` [PATCH iputils 6/6] ping: fix -i number parsing in locales Mike Frysinger
@ 2016-06-02  2:08   ` YOSHIFUJI Hideaki
  2016-06-02  4:46   ` [PATCH iputils v2] ping: always accept . delimiter with -i number parsing Mike Frysinger
  1 sibling, 0 replies; 22+ messages in thread
From: YOSHIFUJI Hideaki @ 2016-06-02  2:08 UTC (permalink / raw)
  To: Mike Frysinger, YOSHIFUJI Hideaki; +Cc: hideaki.yoshifuji, netdev



Mike Frysinger wrote:
> Always use #.# format for the -i flag even when the current locale uses
> a different separator.  Locale de_DE which uses #,# normally.
> 
> Simple testcase:
> $ make USE_IDN=1
> $ LANG=de_DE.UTF8 ./ping -i 0.5 localhost
> 
> Reported-by: Sergey Fionov <fionov@gmail.com>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>  ping_common.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/ping_common.c b/ping_common.c
> index 62f53a6..0a37e09 100644
> --- a/ping_common.c
> +++ b/ping_common.c
> @@ -269,9 +269,17 @@ void common_options(int ch)
>  		double dbl;
>  		char *ep;
>  
> +#ifdef USE_IDN
> +		setlocale(LC_ALL, "C");
> +#endif
> +
>  		errno = 0;
>  		dbl = strtod(optarg, &ep);
>  
> +#ifdef USE_IDN
> +		setlocale(LC_ALL, "");
> +#endif
> +
>  		if (errno || *ep != '\0' ||
>  		    !finite(dbl) || dbl < 0.0 || dbl >= (double)INT_MAX / 1000 - 1.0) {
>  			fprintf(stderr, "ping: bad timing interval\n");
> 

Please make it accept both.

-- 
Hideaki Yoshifuji <hideaki.yoshifuji@miraclelinux.com>
Technical Division, MIRACLE LINUX CORPORATION

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH iputils 5/6] tftpd: fix syslog setup
  2016-06-01  3:48 ` [PATCH iputils 5/6] tftpd: fix syslog setup Mike Frysinger
@ 2016-06-02  2:10   ` YOSHIFUJI Hideaki
  2016-06-02  4:33     ` Mike Frysinger
  0 siblings, 1 reply; 22+ messages in thread
From: YOSHIFUJI Hideaki @ 2016-06-02  2:10 UTC (permalink / raw)
  To: Mike Frysinger, YOSHIFUJI Hideaki; +Cc: hideaki.yoshifuji, netdev

Hi,

Mike Frysinger wrote:
> Commit d81a44625b04d487c895473aa77af13420b7afdd added support for checking
> the set*id calls, but would call syslog() before it had called openlog().
> Move the call up earlier to fix that.

Please describe what it really fixes.

-- 
Hideaki Yoshifuji <hideaki.yoshifuji@miraclelinux.com>
Technical Division, MIRACLE LINUX CORPORATION

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH iputils 4/6] fix handling of CFLAGS
  2016-06-01  3:48 ` [PATCH iputils 4/6] fix handling of CFLAGS Mike Frysinger
@ 2016-06-02  2:35   ` YOSHIFUJI Hideaki
  0 siblings, 0 replies; 22+ messages in thread
From: YOSHIFUJI Hideaki @ 2016-06-02  2:35 UTC (permalink / raw)
  To: Mike Frysinger, YOSHIFUJI Hideaki; +Cc: hideaki.yoshifuji, netdev

Mike Frysinger wrote:
> This defaults CFLAGS to -O3 without clobbering settings people have set
> up in the environment already.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>

Fixed in different way. Thank you.

-- 
Hideaki Yoshifuji <hideaki.yoshifuji@miraclelinux.com>
Technical Division, MIRACLE LINUX CORPORATION

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH iputils 2/6] doc: fix parallel build of html/man pages
  2016-06-01  3:48 ` [PATCH iputils 2/6] doc: fix parallel build of html/man pages Mike Frysinger
@ 2016-06-02  2:39   ` YOSHIFUJI Hideaki
  0 siblings, 0 replies; 22+ messages in thread
From: YOSHIFUJI Hideaki @ 2016-06-02  2:39 UTC (permalink / raw)
  To: Mike Frysinger, YOSHIFUJI Hideaki; +Cc: hideaki.yoshifuji, netdev

Hi,

Mike Frysinger wrote:
> The use of the same tempdir prevents building of these files in parallel.
> So build all of them in unique tempdirs so we can do them in parallel.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>

Applied.  Thank you.

-- 
Hideaki Yoshifuji <hideaki.yoshifuji@miraclelinux.com>
Technical Division, MIRACLE LINUX CORPORATION

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH iputils 5/6] tftpd: fix syslog setup
  2016-06-02  2:10   ` YOSHIFUJI Hideaki
@ 2016-06-02  4:33     ` Mike Frysinger
  2016-06-02  8:31       ` YOSHIFUJI Hideaki
  0 siblings, 1 reply; 22+ messages in thread
From: Mike Frysinger @ 2016-06-02  4:33 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki; +Cc: YOSHIFUJI Hideaki, netdev

[-- Attachment #1: Type: text/plain, Size: 560 bytes --]

On 02 Jun 2016 11:10, YOSHIFUJI Hideaki wrote:
> Mike Frysinger wrote:
> > Commit d81a44625b04d487c895473aa77af13420b7afdd added support for checking
> > the set*id calls, but would call syslog() before it had called openlog().
> > Move the call up earlier to fix that.
> 
> Please describe what it really fixes.

i already did: you need to call openlog before calling syslog, but the
code here very clearly doesn't.  if you read the commit i referenced,
and the all <25 lines of context here, it should be pretty obvious the
code is wrong.
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH iputils 1/6] start gitignore files
  2016-06-02  2:06 ` [PATCH iputils 1/6] start gitignore files YOSHIFUJI Hideaki
@ 2016-06-02  4:42   ` Mike Frysinger
  2016-06-02  8:57     ` YOSHIFUJI Hideaki
  0 siblings, 1 reply; 22+ messages in thread
From: Mike Frysinger @ 2016-06-02  4:42 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki; +Cc: YOSHIFUJI Hideaki, netdev

[-- Attachment #1: Type: text/plain, Size: 642 bytes --]

On 02 Jun 2016 11:06, YOSHIFUJI Hideaki wrote:
> Mike Frysinger wrote:
> > Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> > ---
> >  .gitignore     | 22 ++++++++++++++++++++++
> >  doc/.gitignore |  2 ++
> >  2 files changed, 24 insertions(+)
> >  create mode 100644 .gitignore
> >  create mode 100644 doc/.gitignore
> > 
> 
> files under ninfod/ as well, maybe?

perhaps ... i've never seen this dir before.  it has generated files
committed to the git repo though which kind on conflicts with using
gitignore.

maybe merge this and then wait for someone who actually builds/tests
ninfod to submit an update ?
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH iputils v2] ping: always accept . delimiter with -i number parsing
  2016-06-01  3:48 ` [PATCH iputils 6/6] ping: fix -i number parsing in locales Mike Frysinger
  2016-06-02  2:08   ` YOSHIFUJI Hideaki
@ 2016-06-02  4:46   ` Mike Frysinger
  2016-06-02  8:28     ` YOSHIFUJI Hideaki
  1 sibling, 1 reply; 22+ messages in thread
From: Mike Frysinger @ 2016-06-02  4:46 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki; +Cc: netdev

Always allow #.# format for the -i flag even when the current locale
uses a different separator.  Locale de_DE which uses #,# normally.

Simple testcase:
$ make USE_IDN=1
$ LANG=de_DE.UTF8 ./ping -i 0.5 localhost
$ LANG=de_DE.UTF8 ./ping -i 0,5 localhost

Reported-by: Sergey Fionov <fionov@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 ping_common.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/ping_common.c b/ping_common.c
index 62f53a6..6054a91 100644
--- a/ping_common.c
+++ b/ping_common.c
@@ -269,11 +269,28 @@ void common_options(int ch)
 		double dbl;
 		char *ep;
 
+#ifdef USE_IDN
+		int try_c_loc = 0;
+ retry_c_loc:
+#endif
+
 		errno = 0;
 		dbl = strtod(optarg, &ep);
 
+#ifdef USE_IDN
+		if (try_c_loc)
+			setlocale(LC_ALL, "");
+#endif
+
 		if (errno || *ep != '\0' ||
 		    !finite(dbl) || dbl < 0.0 || dbl >= (double)INT_MAX / 1000 - 1.0) {
+#ifdef USE_IDN
+			if (!try_c_loc) {
+				try_c_loc = 1;
+				setlocale(LC_ALL, "C");
+				goto retry_c_loc;
+			}
+#endif
 			fprintf(stderr, "ping: bad timing interval\n");
 			exit(2);
 		}
-- 
2.8.2

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH iputils v2] ping6: allow disabling of openssl/libgcrypt support
  2016-06-01  3:48 ` [PATCH iputils 3/6] ping6: allow disabling of openssl support Mike Frysinger
  2016-06-02  2:04   ` YOSHIFUJI Hideaki
@ 2016-06-02  4:59   ` Mike Frysinger
  2016-06-02  8:49     ` YOSHIFUJI Hideaki
  2016-06-02 17:16     ` [PATCH iputils v3] " Mike Frysinger
  1 sibling, 2 replies; 22+ messages in thread
From: Mike Frysinger @ 2016-06-02  4:59 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki; +Cc: netdev

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 Makefile         |  5 ++++-
 iputils_md5dig.h |  4 +++-
 ping6.c          | 19 ++++++++++++++++++-
 3 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index b6cf512..8b9e2aa 100644
--- a/Makefile
+++ b/Makefile
@@ -36,7 +36,7 @@ ARPING_DEFAULT_DEVICE=
 
 # Libgcrypt (for MD5) for ping6 [yes|no|static]
 USE_GCRYPT=yes
-# Crypto library for ping6 [shared|static]
+# Crypto library for ping6 [shared|static|no]
 USE_CRYPTO=shared
 # Resolv library for ping6 [yes|static]
 USE_RESOLV=yes
@@ -66,7 +66,10 @@ ifneq ($(USE_GCRYPT),no)
 	LIB_CRYPTO = $(call FUNC_LIB,$(USE_GCRYPT),$(LDFLAG_GCRYPT))
 	DEF_CRYPTO = -DUSE_GCRYPT
 else
+ifneq ($(USE_CRYPTO),no)
 	LIB_CRYPTO = $(call FUNC_LIB,$(USE_CRYPTO),$(LDFLAG_CRYPTO))
+	DEF_CRYPTO = -DUSE_OPENSSL
+endif
 endif
 
 # USE_RESOLV: LIB_RESOLV
diff --git a/iputils_md5dig.h b/iputils_md5dig.h
index 4cec866..d6c4d46 100644
--- a/iputils_md5dig.h
+++ b/iputils_md5dig.h
@@ -5,8 +5,10 @@
 # include <stdlib.h>
 # include <gcrypt.h>
 # define IPUTILS_MD5DIG_LEN	16
-#else
+# define USE_CRYPTO
+#elif defined(USE_OPENSSL)
 # include <openssl/md5.h>
+# define USE_CRYPTO
 #endif
 
 #ifdef USE_GCRYPT
diff --git a/ping6.c b/ping6.c
index 6d1a6db..db7ec4a 100644
--- a/ping6.c
+++ b/ping6.c
@@ -238,6 +238,8 @@ unsigned int if_name2index(const char *ifname)
 	return i;
 }
 
+#ifdef USE_CRYPTO
+
 struct niquery_option {
 	char *name;
 	int namelen;
@@ -668,6 +670,7 @@ int niquery_option_handler(const char *opt_arg)
 		ret = niquery_option_help_handler(0, NULL);
 	return ret;
 }
+#endif
 
 static int hextoui(const char *str)
 {
@@ -790,6 +793,7 @@ int main(int argc, char *argv[])
 			printf("ping6 utility, iputils-%s\n", SNAPSHOT);
 			exit(0);
 		case 'N':
+#ifdef USE_CRYPTO
 			if (using_ping_socket) {
 				fprintf(stderr, "ping: -N requires raw socket permissions\n");
 				exit(2);
@@ -798,6 +802,10 @@ int main(int argc, char *argv[])
 				usage();
 				break;
 			}
+#else
+			fprintf(stderr, "ping: function not available; crypto disabled\n");
+			exit(2);
+#endif
 			break;
 		COMMON_OPTIONS
 			common_options(ch);
@@ -891,6 +899,7 @@ int main(int argc, char *argv[])
 	}
 #endif
 
+#ifdef USE_CRYPTO
 	if (niquery_is_enabled()) {
 		niquery_init_nonce();
 
@@ -900,6 +909,7 @@ int main(int argc, char *argv[])
 			ni_subject_type = NI_SUBJ_IPV6;
 		}
 	}
+#endif
 
 	if (argc > 1) {
 #ifndef ENABLE_PING6_RTHDR
@@ -1126,9 +1136,11 @@ int main(int argc, char *argv[])
 			ICMP6_FILTER_SETPASS(ICMP6_PARAM_PROB, &filter);
 		}
 
+#ifdef USE_CRYPTO
 		if (niquery_is_enabled())
 			ICMP6_FILTER_SETPASS(ICMPV6_NI_REPLY, &filter);
 		else
+#endif
 			ICMP6_FILTER_SETPASS(ICMP6_ECHO_REPLY, &filter);
 
 		err = setsockopt(icmp_sock, IPPROTO_ICMPV6, ICMP6_FILTER, &filter,
@@ -1369,7 +1381,7 @@ int build_echo(__u8 *_icmph)
 	return cc;
 }
 
-
+#ifdef USE_CRYPTO
 int build_niquery(__u8 *_nih)
 {
 	struct ni_hdr *nih;
@@ -1391,6 +1403,7 @@ int build_niquery(__u8 *_nih)
 
 	return cc;
 }
+#endif
 
 int send_probe(void)
 {
@@ -1398,9 +1411,11 @@ int send_probe(void)
 
 	rcvd_clear(ntransmitted + 1);
 
+#ifdef USE_CRYPTO
 	if (niquery_is_enabled())
 		len = build_niquery(outpack);
 	else
+#endif
 		len = build_echo(outpack);
 
 	if (cmsglen == 0) {
@@ -1619,6 +1634,7 @@ parse_reply(struct msghdr *msg, int cc, void *addr, struct timeval *tv)
 				      hops, 0, tv, pr_addr(&from->sin6_addr),
 				      pr_echo_reply))
 			return 0;
+#ifdef USE_CRYPTO
 	} else if (icmph->icmp6_type == ICMPV6_NI_REPLY) {
 		struct ni_hdr *nih = (struct ni_hdr *)icmph;
 		int seq = niquery_check_nonce(nih->ni_nonce);
@@ -1629,6 +1645,7 @@ parse_reply(struct msghdr *msg, int cc, void *addr, struct timeval *tv)
 				      hops, 0, tv, pr_addr(&from->sin6_addr),
 				      pr_niquery_reply))
 			return 0;
+#endif
 	} else {
 		int nexthdr;
 		struct ip6_hdr *iph1 = (struct ip6_hdr*)(icmph+1);
-- 
2.8.2

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH iputils v2] ping: always accept . delimiter with -i number parsing
  2016-06-02  4:46   ` [PATCH iputils v2] ping: always accept . delimiter with -i number parsing Mike Frysinger
@ 2016-06-02  8:28     ` YOSHIFUJI Hideaki
  0 siblings, 0 replies; 22+ messages in thread
From: YOSHIFUJI Hideaki @ 2016-06-02  8:28 UTC (permalink / raw)
  To: Mike Frysinger, YOSHIFUJI Hideaki; +Cc: hideaki.yoshifuji, netdev

Hi,

Mike Frysinger wrote:
> Always allow #.# format for the -i flag even when the current locale
> uses a different separator.  Locale de_DE which uses #,# normally.
> 
> Simple testcase:
> $ make USE_IDN=1
> $ LANG=de_DE.UTF8 ./ping -i 0.5 localhost
> $ LANG=de_DE.UTF8 ./ping -i 0,5 localhost
> 
> Reported-by: Sergey Fionov <fionov@gmail.com>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---

Applied, thanks.

-- 
Hideaki Yoshifuji <hideaki.yoshifuji@miraclelinux.com>
Technical Division, MIRACLE LINUX CORPORATION

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH iputils 5/6] tftpd: fix syslog setup
  2016-06-02  4:33     ` Mike Frysinger
@ 2016-06-02  8:31       ` YOSHIFUJI Hideaki
  0 siblings, 0 replies; 22+ messages in thread
From: YOSHIFUJI Hideaki @ 2016-06-02  8:31 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki, netdev; +Cc: hideaki.yoshifuji

Hi,

Mike Frysinger wrote:
> On 02 Jun 2016 11:10, YOSHIFUJI Hideaki wrote:
>> Mike Frysinger wrote:
>>> Commit d81a44625b04d487c895473aa77af13420b7afdd added support for checking
>>> the set*id calls, but would call syslog() before it had called openlog().
>>> Move the call up earlier to fix that.
>>
>> Please describe what it really fixes.
> 
> i already did: you need to call openlog before calling syslog, but the
> code here very clearly doesn't.  if you read the commit i referenced,
> and the all <25 lines of context here, it should be pretty obvious the
> code is wrong.
> -mike
> 

OK, applied. Thank you.

-- 
Hideaki Yoshifuji <hideaki.yoshifuji@miraclelinux.com>
Technical Division, MIRACLE LINUX CORPORATION

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH iputils v2] ping6: allow disabling of openssl/libgcrypt support
  2016-06-02  4:59   ` [PATCH iputils v2] ping6: allow disabling of openssl/libgcrypt support Mike Frysinger
@ 2016-06-02  8:49     ` YOSHIFUJI Hideaki
  2016-06-02 13:38       ` Mike Frysinger
  2016-06-02 17:16     ` [PATCH iputils v3] " Mike Frysinger
  1 sibling, 1 reply; 22+ messages in thread
From: YOSHIFUJI Hideaki @ 2016-06-02  8:49 UTC (permalink / raw)
  To: Mike Frysinger, YOSHIFUJI Hideaki; +Cc: hideaki.yoshifuji, netdev

Hi,

Mike Frysinger wrote:
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>  Makefile         |  5 ++++-
>  iputils_md5dig.h |  4 +++-
>  ping6.c          | 19 ++++++++++++++++++-
>  3 files changed, 25 insertions(+), 3 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index b6cf512..8b9e2aa 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -36,7 +36,7 @@ ARPING_DEFAULT_DEVICE=
>  
>  # Libgcrypt (for MD5) for ping6 [yes|no|static]
>  USE_GCRYPT=yes
> -# Crypto library for ping6 [shared|static]
> +# Crypto library for ping6 [shared|static|no]
>  USE_CRYPTO=shared
>  # Resolv library for ping6 [yes|static]
>  USE_RESOLV=yes
> @@ -66,7 +66,10 @@ ifneq ($(USE_GCRYPT),no)
>  	LIB_CRYPTO = $(call FUNC_LIB,$(USE_GCRYPT),$(LDFLAG_GCRYPT))
>  	DEF_CRYPTO = -DUSE_GCRYPT
>  else
> +ifneq ($(USE_CRYPTO),no)
>  	LIB_CRYPTO = $(call FUNC_LIB,$(USE_CRYPTO),$(LDFLAG_CRYPTO))
> +	DEF_CRYPTO = -DUSE_OPENSSL
> +endif
>  endif
>  
>  # USE_RESOLV: LIB_RESOLV
> diff --git a/iputils_md5dig.h b/iputils_md5dig.h
> index 4cec866..d6c4d46 100644
> --- a/iputils_md5dig.h
> +++ b/iputils_md5dig.h
> @@ -5,8 +5,10 @@
>  # include <stdlib.h>
>  # include <gcrypt.h>
>  # define IPUTILS_MD5DIG_LEN	16
> -#else
> +# define USE_CRYPTO
> +#elif defined(USE_OPENSSL)
>  # include <openssl/md5.h>
> +# define USE_CRYPTO
>  #endif
>  
>  #ifdef USE_GCRYPT

Please define ENABLE_NIQUERY (or something else) for
USE_GCRYPT || USE_CRYPTO case and use it in sources.

> diff --git a/ping6.c b/ping6.c
> index 6d1a6db..db7ec4a 100644
> --- a/ping6.c
> +++ b/ping6.c


> @@ -891,6 +899,7 @@ int main(int argc, char *argv[])
>  	}
>  #endif
>  
> +#ifdef USE_CRYPTO
>  	if (niquery_is_enabled()) {
>  		niquery_init_nonce();
>  

Make niquery_is_enabled() returns 0 without ENABLE_NIQUERY
and reduce #ifdefs.

Thank you.

-- 
Hideaki Yoshifuji <hideaki.yoshifuji@miraclelinux.com>
Technical Division, MIRACLE LINUX CORPORATION

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH iputils 1/6] start gitignore files
  2016-06-02  4:42   ` Mike Frysinger
@ 2016-06-02  8:57     ` YOSHIFUJI Hideaki
  0 siblings, 0 replies; 22+ messages in thread
From: YOSHIFUJI Hideaki @ 2016-06-02  8:57 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki, netdev; +Cc: hideaki.yoshifuji

Hi,

Mike Frysinger wrote:
> On 02 Jun 2016 11:06, YOSHIFUJI Hideaki wrote:
>> Mike Frysinger wrote:
>>> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
>>> ---
>>>  .gitignore     | 22 ++++++++++++++++++++++
>>>  doc/.gitignore |  2 ++
>>>  2 files changed, 24 insertions(+)
>>>  create mode 100644 .gitignore
>>>  create mode 100644 doc/.gitignore
>>>
>>
>> files under ninfod/ as well, maybe?
> 
> perhaps ... i've never seen this dir before.  it has generated files
> committed to the git repo though which kind on conflicts with using
> gitignore.
> 
> maybe merge this and then wait for someone who actually builds/tests
> ninfod to submit an update ?
> -mike
> 

Okay, applied.  Thanks.

-- 
Hideaki Yoshifuji <hideaki.yoshifuji@miraclelinux.com>
Technical Division, MIRACLE LINUX CORPORATION

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH iputils v2] ping6: allow disabling of openssl/libgcrypt support
  2016-06-02  8:49     ` YOSHIFUJI Hideaki
@ 2016-06-02 13:38       ` Mike Frysinger
  0 siblings, 0 replies; 22+ messages in thread
From: Mike Frysinger @ 2016-06-02 13:38 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki; +Cc: YOSHIFUJI Hideaki, netdev

[-- Attachment #1: Type: text/plain, Size: 518 bytes --]

On 02 Jun 2016 17:49, YOSHIFUJI Hideaki wrote:
> Mike Frysinger wrote:
> > @@ -891,6 +899,7 @@ int main(int argc, char *argv[])
> >  	}
> >  #endif
> >  
> > +#ifdef USE_CRYPTO
> >  	if (niquery_is_enabled()) {
> >  		niquery_init_nonce();
> >  
> 
> Make niquery_is_enabled() returns 0 without ENABLE_NIQUERY
> and reduce #ifdefs.

i did that originally, but it only reduces like one set.  you have to
define other stubs like niquery_init_nonce too otherwise gcc will throw
warnings & errors.
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH iputils v3] ping6: allow disabling of openssl/libgcrypt support
  2016-06-02  4:59   ` [PATCH iputils v2] ping6: allow disabling of openssl/libgcrypt support Mike Frysinger
  2016-06-02  8:49     ` YOSHIFUJI Hideaki
@ 2016-06-02 17:16     ` Mike Frysinger
  1 sibling, 0 replies; 22+ messages in thread
From: Mike Frysinger @ 2016-06-02 17:16 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki; +Cc: netdev

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 Makefile         |  5 ++++-
 iputils_md5dig.h |  2 +-
 ping6.c          | 28 +++++++++++++++++++++++++++-
 3 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index b6cf512f22a5..8b9e2aa232e6 100644
--- a/Makefile
+++ b/Makefile
@@ -36,7 +36,7 @@ ARPING_DEFAULT_DEVICE=
 
 # Libgcrypt (for MD5) for ping6 [yes|no|static]
 USE_GCRYPT=yes
-# Crypto library for ping6 [shared|static]
+# Crypto library for ping6 [shared|static|no]
 USE_CRYPTO=shared
 # Resolv library for ping6 [yes|static]
 USE_RESOLV=yes
@@ -66,7 +66,10 @@ ifneq ($(USE_GCRYPT),no)
 	LIB_CRYPTO = $(call FUNC_LIB,$(USE_GCRYPT),$(LDFLAG_GCRYPT))
 	DEF_CRYPTO = -DUSE_GCRYPT
 else
+ifneq ($(USE_CRYPTO),no)
 	LIB_CRYPTO = $(call FUNC_LIB,$(USE_CRYPTO),$(LDFLAG_CRYPTO))
+	DEF_CRYPTO = -DUSE_OPENSSL
+endif
 endif
 
 # USE_RESOLV: LIB_RESOLV
diff --git a/iputils_md5dig.h b/iputils_md5dig.h
index 4cec86699465..9f09ba0a8c60 100644
--- a/iputils_md5dig.h
+++ b/iputils_md5dig.h
@@ -5,7 +5,7 @@
 # include <stdlib.h>
 # include <gcrypt.h>
 # define IPUTILS_MD5DIG_LEN	16
-#else
+#elif defined(USE_OPENSSL)
 # include <openssl/md5.h>
 #endif
 
diff --git a/ping6.c b/ping6.c
index 6d1a6db37146..95568ec4fbaf 100644
--- a/ping6.c
+++ b/ping6.c
@@ -85,6 +85,12 @@ char copyright[] =
 #include "ping6_niquery.h"
 #include "in6_flowlabel.h"
 
+#if defined(USE_GCRYPT) || defined(USE_OPENSSL)
+# define ENABLE_NIQUERY 1
+#else
+# define ENABLE_NIQUERY 0
+#endif
+
 #ifndef SOL_IPV6
 #define SOL_IPV6 IPPROTO_IPV6
 #endif
@@ -238,6 +244,8 @@ unsigned int if_name2index(const char *ifname)
 	return i;
 }
 
+#if ENABLE_NIQUERY
+
 struct niquery_option {
 	char *name;
 	int namelen;
@@ -669,6 +677,12 @@ int niquery_option_handler(const char *opt_arg)
 	return ret;
 }
 
+#else
+
+# define niquery_is_enabled() 0
+
+#endif /* ENABLE_NIQUERY */
+
 static int hextoui(const char *str)
 {
 	unsigned long val;
@@ -790,6 +804,7 @@ int main(int argc, char *argv[])
 			printf("ping6 utility, iputils-%s\n", SNAPSHOT);
 			exit(0);
 		case 'N':
+#if ENABLE_NIQUERY
 			if (using_ping_socket) {
 				fprintf(stderr, "ping: -N requires raw socket permissions\n");
 				exit(2);
@@ -798,6 +813,10 @@ int main(int argc, char *argv[])
 				usage();
 				break;
 			}
+#else
+			fprintf(stderr, "ping: function not available; crypto disabled\n");
+			exit(2);
+#endif
 			break;
 		COMMON_OPTIONS
 			common_options(ch);
@@ -891,6 +910,7 @@ int main(int argc, char *argv[])
 	}
 #endif
 
+#if ENABLE_NIQUERY
 	if (niquery_is_enabled()) {
 		niquery_init_nonce();
 
@@ -900,6 +920,7 @@ int main(int argc, char *argv[])
 			ni_subject_type = NI_SUBJ_IPV6;
 		}
 	}
+#endif
 
 	if (argc > 1) {
 #ifndef ENABLE_PING6_RTHDR
@@ -1369,7 +1390,7 @@ int build_echo(__u8 *_icmph)
 	return cc;
 }
 
-
+#if ENABLE_NIQUERY
 int build_niquery(__u8 *_nih)
 {
 	struct ni_hdr *nih;
@@ -1391,6 +1412,7 @@ int build_niquery(__u8 *_nih)
 
 	return cc;
 }
+#endif
 
 int send_probe(void)
 {
@@ -1398,9 +1420,11 @@ int send_probe(void)
 
 	rcvd_clear(ntransmitted + 1);
 
+#if ENABLE_NIQUERY
 	if (niquery_is_enabled())
 		len = build_niquery(outpack);
 	else
+#endif
 		len = build_echo(outpack);
 
 	if (cmsglen == 0) {
@@ -1619,6 +1643,7 @@ parse_reply(struct msghdr *msg, int cc, void *addr, struct timeval *tv)
 				      hops, 0, tv, pr_addr(&from->sin6_addr),
 				      pr_echo_reply))
 			return 0;
+#if ENABLE_NIQUERY
 	} else if (icmph->icmp6_type == ICMPV6_NI_REPLY) {
 		struct ni_hdr *nih = (struct ni_hdr *)icmph;
 		int seq = niquery_check_nonce(nih->ni_nonce);
@@ -1629,6 +1654,7 @@ parse_reply(struct msghdr *msg, int cc, void *addr, struct timeval *tv)
 				      hops, 0, tv, pr_addr(&from->sin6_addr),
 				      pr_niquery_reply))
 			return 0;
+#endif
 	} else {
 		int nexthdr;
 		struct ip6_hdr *iph1 = (struct ip6_hdr*)(icmph+1);
-- 
2.8.2

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2016-06-02 17:16 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-01  3:48 [PATCH iputils 1/6] start gitignore files Mike Frysinger
2016-06-01  3:48 ` [PATCH iputils 2/6] doc: fix parallel build of html/man pages Mike Frysinger
2016-06-02  2:39   ` YOSHIFUJI Hideaki
2016-06-01  3:48 ` [PATCH iputils 3/6] ping6: allow disabling of openssl support Mike Frysinger
2016-06-02  2:04   ` YOSHIFUJI Hideaki
2016-06-02  4:59   ` [PATCH iputils v2] ping6: allow disabling of openssl/libgcrypt support Mike Frysinger
2016-06-02  8:49     ` YOSHIFUJI Hideaki
2016-06-02 13:38       ` Mike Frysinger
2016-06-02 17:16     ` [PATCH iputils v3] " Mike Frysinger
2016-06-01  3:48 ` [PATCH iputils 4/6] fix handling of CFLAGS Mike Frysinger
2016-06-02  2:35   ` YOSHIFUJI Hideaki
2016-06-01  3:48 ` [PATCH iputils 5/6] tftpd: fix syslog setup Mike Frysinger
2016-06-02  2:10   ` YOSHIFUJI Hideaki
2016-06-02  4:33     ` Mike Frysinger
2016-06-02  8:31       ` YOSHIFUJI Hideaki
2016-06-01  3:48 ` [PATCH iputils 6/6] ping: fix -i number parsing in locales Mike Frysinger
2016-06-02  2:08   ` YOSHIFUJI Hideaki
2016-06-02  4:46   ` [PATCH iputils v2] ping: always accept . delimiter with -i number parsing Mike Frysinger
2016-06-02  8:28     ` YOSHIFUJI Hideaki
2016-06-02  2:06 ` [PATCH iputils 1/6] start gitignore files YOSHIFUJI Hideaki
2016-06-02  4:42   ` Mike Frysinger
2016-06-02  8:57     ` YOSHIFUJI Hideaki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.