Hi Team,

I was looking a the code in multipath.c file. In function algorithm_hrw( )
assignment is done from int->short (best_link = link). It might lead to
bit truncation. Following is the code snippet for your reference.

uint32_t best_weight;
    uint16_t best_link;
    unsigned int link;

    best_link = 0;
    best_weight = hash_2words(hash, 0);
    for (link = 1; link < n_links; link++) {
        uint32_t weight = hash_2words(hash, link);
        if (weight > best_weight) {
            best_link = link;
            best_weight = weight;

Regards
Neeraj



algorithm_hrw
_______________________________________________
discuss mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/discuss

Reply via email to