make install
- Note that mtr must be suid-root because it requires access to raw IP
- sockets. See SECURITY for security information.
+ Note that mtr-packet must be suid-root because it requires access to
+ raw IP sockets. See SECURITY for security information.
Older versions used to require a non-existent path to GTK for a
correct build of a non-gtk version while GTK was installed. This is
no longer necessary. ./configure --without-gtk should now work.
If it doesn't, try "make WITHOUT_X11=YES" as the make step.
+ On Solaris, you'll need to use GNU make to build.
+ (Use 'gmake' rather than 'make'.)
+
On Solaris (and possibly other systems) the "gtk" library may be
installed in a directory where the dynamic linker refuses to look when
a binary is setuid. Roman Shterenzon reports that adding
in a setuid program, then there is something to say for moving them
to the "trusted" directory.)
- On Solaris, linking usually fails to find "wattr" or something like that.
- Somehow, I can't seem to be able to automate "configure" finding the right
- libs on Solaris. So, the solution is that you cut-and-paste the line
- doing the linking into a terminal window, and add "-lcurses" by hand.
- Then it will link. Help on how to catch this in autoconf appreciated.
-
Building on MacOS should not require any special steps.
BUILDING FOR WINDOWS
ncurses/curses.h \
netinet/in.h \
socket.h \
+ sys/cdefs.h \
sys/limits.h \
sys/socket.h \
stdio_ext.h \
[AS_HELP_STRING([--without-ncurses], [Build without the ncurses interface])],
[], [with_ncurses=yes])
AS_IF([test "x$with_ncurses" = "xyes"],
+
+ # Prefer ncurses over curses, if both are available.
+ # (On Solaris 11.3, ncurses builds and links for us, but curses does not.)
[AC_SEARCH_LIBS(
[initscr], [ncurses curses],
[AC_DEFINE([HAVE_CURSES], [1], [Define if a curses library available])],
[AS_HELP_STRING([--disable-ipv6], [Do not enable IPv6])],
[WANTS_IPV6=$enableval], [WANTS_IPV6=yes])
-USES_IPV6=
-AC_CHECK_FUNC([getaddrinfo], [
- AS_IF([test "x$WANTS_IPV6" = "xyes"], [
- AC_DEFINE([ENABLE_IPV6], [1], [Define to enable IPv6])
- USES_IPV6=yes
- ])
+AS_IF([test "x$WANTS_IPV6" = "xyes"], [
+ AC_DEFINE([ENABLE_IPV6], [1], [Define to enable IPv6])
+ USES_IPV6=yes
])
AC_CHECK_FUNC([socket], [],
{
int send_socket;
bool is_stream_protocol = false;
+ bool bind_send_socket = true;
+ struct sockaddr_storage current_sockaddr;
+ int current_sockaddr_len;
if (param->protocol == IPPROTO_TCP) {
is_stream_protocol = true;
return 0;
}
- if (bind(send_socket,
- (struct sockaddr *)src_sockaddr, sizeof(struct sockaddr_in6))) {
- return -1;
+ /*
+ Check the current socket address, and if it is the same
+ as the source address we intend, we will skip the bind.
+ This is to accomodate Solaris, which, as of Solaris 11.3,
+ will return an EINVAL error on bind if the socket is already
+ bound, even if the same address is used.
+ */
+ current_sockaddr_len = sizeof(struct sockaddr_in6);
+ if (getsockname(send_socket, (struct sockaddr *)¤t_sockaddr,
+ ¤t_sockaddr_len) == 0) {
+
+ if (memcmp(¤t_sockaddr,
+ src_sockaddr, sizeof(struct sockaddr_in6)) == 0) {
+ bind_send_socket = false;
+ }
+ }
+
+ /* Bind to our local address */
+ if (bind_send_socket) {
+ if (bind(send_socket, (struct sockaddr *)src_sockaddr,
+ sizeof(struct sockaddr_in6))) {
+ return -1;
+ }
}
/* The traffic class in IPv6 is analagous to ToS in IPv4 */
#ifndef _SYS_QUEUE_H_
#define _SYS_QUEUE_H_
+#include "config.h"
+
+#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
+#endif
/*
* This file defines four types of data structures: singly-linked lists,