Diff for /embedaddon/mtr/packet/probe_unix.c between versions 1.1.1.2 and 1.1.1.3

version 1.1.1.2, 2021/03/17 00:07:30 version 1.1.1.3, 2023/09/27 11:18:58
Line 153  void check_length_order( Line 153  void check_length_order(
   
     if (resolve_probe_addresses(net_state, &param, &p0.remote_addr,      if (resolve_probe_addresses(net_state, &param, &p0.remote_addr,
                 &p0.local_addr)) {                  &p0.local_addr)) {
        fprintf(stderr, "Error decoding localhost address (%s/%s)\n",         fprintf(stderr, "Error decoding localhost address (%s/%s)\n",
                 probe_err, strerror (errno));                  probe_err, strerror (errno));
         exit(EXIT_FAILURE);          exit(EXIT_FAILURE);
     }      }
Line 575  void send_probe( Line 575  void send_probe(
         error(EXIT_FAILURE, errno, "gettimeofday failure");          error(EXIT_FAILURE, errno, "gettimeofday failure");
     }      }
   
    // there might be an off-by-one in the number of tries here.     // there might be an off-by-one in the number of tries here.
     // this is intentional.  It is no use exhausting the very last      // this is intentional.  It is no use exhausting the very last
    // open port. Max 10 retries would've been acceptable too I think.     // open port. Max 10 retries would've been acceptable too I think.
     for (trytimes=MIN_PORT; trytimes < MAX_PORT; trytimes++) {      for (trytimes=MIN_PORT; trytimes < MAX_PORT; trytimes++) {
                        
         packet_size = construct_packet(net_state, &probe->platform.socket,          packet_size = construct_packet(net_state, &probe->platform.socket,
                          probe, packet, PACKET_BUFFER_SIZE,                           probe, packet, PACKET_BUFFER_SIZE,
                          param);                           param);
   
         if (packet_size > 0) break; // no retry if we succeed.          if (packet_size > 0) break; // no retry if we succeed.
   
        if ((param->protocol != IPPROTO_TCP) &&         if ((param->protocol != IPPROTO_TCP) &&
             (param->protocol != IPPROTO_SCTP)) break; // no retry if not TCP/SCTP              (param->protocol != IPPROTO_SCTP)) break; // no retry if not TCP/SCTP
   
         if ((errno != EADDRINUSE) && (errno != EADDRNOTAVAIL)) {          if ((errno != EADDRINUSE) && (errno != EADDRNOTAVAIL)) {
Line 594  void send_probe( Line 594  void send_probe(
         }          }
   
         probe->sequence = net_state->platform.next_sequence++;          probe->sequence = net_state->platform.next_sequence++;
                
         if (net_state->platform.next_sequence > MAX_PORT) {          if (net_state->platform.next_sequence > MAX_PORT) {
             net_state->platform.next_sequence = MIN_PORT;              net_state->platform.next_sequence = MIN_PORT;
         }          }

Removed from v.1.1.1.2  
changed lines
  Added in v.1.1.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>