[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-inetutils] regarding ping6 -c Segmentation fault
From: |
Alfred M. Szmidt |
Subject: |
Re: [bug-inetutils] regarding ping6 -c Segmentation fault |
Date: |
Wed, 20 Aug 2008 18:58:17 -0400 |
diff -u -r1.22 Makefile.am
--- ping/Makefile.am 29 Jun 2007 16:29:31 -0000 1.22
+++ ping/Makefile.am 20 Aug 2008 04:49:37 -0000
@@ -29,7 +29,7 @@
-I$(top_srcdir)/libinetutils
ping_SOURCES = ping.c ping_common.c ping_echo.c ping_address.c \
- ping_router.c ping_timestamp.c ping_common.h ping_impl.h
+ ping_router.c ping_timestamp.c ping_common.h ping_impl.h ping.h libping.c
Would it not be easier to move the content of libping.c into
ping_common.c?
diff -u -r1.11 ping6.c
--- ping/ping6.c 6 Jun 2008 16:43:43 -0000 1.11
+++ ping/ping6.c 20 Aug 2008 04:49:38 -0000
...
int one = 1;
int pattern_len = 16;
size_t data_length = PING_DATALEN;
+size_t count = DEFAULT_PING_COUNT;
This should be a seperate patch;it has nothing to do with moving
things into a common ping library. Same for the socket type, etc...
@@ -80,6 +48,7 @@
#define PING_DATALEN (64 - PING_HEADER_LEN) /* default data length
*/
#define PING_MAX_DATALEN (65535 - sizeof (struct icmp6_hdr))
+#undef _PING_BUFLEN
#define _PING_BUFLEN(p) ((p)->ping_datalen + sizeof (struct icmp6_hdr))
Why the undef?
diff -u -r1.8 ping_common.h
--- ping/ping_common.h 29 Jun 2007 16:29:30 -0000 1.8
+++ ping/ping_common.h 20 Aug 2008 04:49:40 -0000
...
+union ping_address {
+ struct sockaddr_in address;
+ struct sockaddr_in6 address6;
+};
This is a nit pick, I dislike the name... sockaddr_inv4/6 or something
would be clearer; you then know that you are messing with something
that looks like sockaddr.... I think it would be clearer to just use
FOOvN where N is 4 or 6... As well as ping_sockaddr or similar.
Please send patches in seperate mails in the future, sending it in one
makes it hard to figure out what belongs to what. And please attach a
ChangeLog entry.