]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
probe: fix find_source_addr 315/head
authorChongyu Zhu <i@lembacon.com>
Tue, 6 Aug 2019 15:01:57 +0000 (23:01 +0800)
committerChongyu Zhu <i@lembacon.com>
Tue, 6 Aug 2019 15:01:57 +0000 (23:01 +0800)
packet/probe.c

index 0177e97e91c3dd81d53c1fb53f35a83c68e5b134..21c3eb8dbf670ac79856bc412ea42e9950c6be3f 100644 (file)
@@ -323,7 +323,7 @@ int find_source_addr(
        anything to the port.
      */
     *sockaddr_port_offset(&dest_with_port) = htons(1);
-    len = sockaddr_addr_size(&dest_with_port);
+    len = sockaddr_size(&dest_with_port);
 
     sock = socket(destaddr->ss_family, SOCK_DGRAM, IPPROTO_UDP);
     if (sock == -1) {
@@ -364,7 +364,7 @@ int find_source_addr(
        Zero the port, as we may later use this address to finding, and
        we don't want to use the port from the socket we just created.
      */
-    *sockaddr_port_offset(&srcaddr) = 0;
+    *sockaddr_port_offset(srcaddr) = 0;
 
     return 0;
 }