]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
mtr-packet: fix a bug causing IPv6 raw socket not working 222/head
authorChonggang Li <chonggangli@google.com>
Wed, 6 Sep 2017 21:23:01 +0000 (14:23 -0700)
committerChonggang Li <chonggangli@google.com>
Wed, 6 Sep 2017 22:20:49 +0000 (15:20 -0700)
This bug causes mtr not working on IPv6 only machines if invoked by root
user, and it is fixed in this commit.

Change-Id: Iaefa548728b668bb64fbb5330bd1365f1af7b9b1

packet/probe_unix.c

index fafb4896fa16260197a15560f691946bb2879300..d6cca0666109119ef84feb293885a6bc332588f1 100644 (file)
@@ -458,7 +458,7 @@ void init_net_state(
         set_socket_nonblocking(net_state->platform.ip4_txrx_icmp_socket);
         set_socket_nonblocking(net_state->platform.ip4_txrx_udp_socket);
     }
-    if (net_state->platform.ip4_socket_raw) {
+    if (net_state->platform.ip6_socket_raw) {
         set_socket_nonblocking(net_state->platform.ip6_recv_socket);
     } else {
         set_socket_nonblocking(net_state->platform.ip6_txrx_icmp_socket);