• David S. Miller's avatar
    [UDP]: Fix reversed logic in udp_get_port(). · 5c668704
    David S. Miller authored
    When this code was converted to use sk_for_each() the
    logic for the "best hash chain length" code was reversed,
    breaking everything.
    
    The original code was of the form:
    
    			size = 0;
    			do {
    				if (++size >= best_size_so_far)
    					goto next;
    			} while ((sk = sk->next) != NULL);
    			best_size_so_far = size;
    			best = result;
    		next:;
    
    and this got converted into:
    
    			sk_for_each(sk2, node, head)
    				if (++size < best_size_so_far) {
    					best_size_so_far = size;
    					best = result;
    				}
    
    Which does something very very different from the original.
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    5c668704
udp.c 43.5 KB