]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
check the other ends ACKs of our packets
authorAlan T. DeKok <aland@freeradius.org>
Tue, 6 Dec 2016 16:32:19 +0000 (11:32 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 7 Dec 2016 14:57:20 +0000 (09:57 -0500)
not our ACKs of the other ends packets

src/util/channel.c

index 5c27569f1d1f810ddf214bc6a08addb01232bbc7..3e55703daabe0ada3d3fa717079b65cc78e9dd6e 100644 (file)
@@ -405,9 +405,10 @@ int fr_channel_send_reply(fr_channel_t *ch, fr_channel_data_t *cd, fr_channel_da
 {
        uint64_t sequence;
        fr_time_t when, message_interval;
-       fr_channel_end_t *end;
+       fr_channel_end_t *end, *other;
 
        end = &(ch->end[FROM_WORKER]);
+       other = &(ch->end[TO_WORKER]);
 
        when = cd->m.when;
 
@@ -447,7 +448,7 @@ int fr_channel_send_reply(fr_channel_t *ch, fr_channel_data_t *cd, fr_channel_da
 
        MPRINT("\twhen - last_read_other = %zd - %zd = %zd\n", when, end->last_read_other, when - end->last_read_other);
        MPRINT("\twhen - ast signal = %zd - %zd = %zd\n", when, end->last_sent_signal, when - end->last_sent_signal);
-       MPRINT("\tack - sequence = %zd - %zd = %zd\n", end->ack, end->sequence, end->ack - end->sequence);
+       MPRINT("\tsequence - ack = %zd - %zd = %zd\n", end->sequence, other->ack, end->sequence - other->ack);
 
        /*
         *      If we've received a new packet in the last while, OR
@@ -458,7 +459,8 @@ int fr_channel_send_reply(fr_channel_t *ch, fr_channel_data_t *cd, fr_channel_da
         *      FIXME: make these limits configurable, or include
         *      predictions about packet processing time?
         */
-       if (((end->ack - end->sequence) <= 5) &&
+       rad_assert(other->ack <= end->sequence);
+       if (((end->sequence - other->ack) <= 100) &&
            ((when - end->last_read_other < SIGNAL_INTERVAL) ||
             ((when - end->last_sent_signal) < SIGNAL_INTERVAL))) {
                MPRINT("WORKER SKIPS\n");