Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix of incorrect type conversion. #562

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jan 4, 2021

  1. Update sctp_cc_functions.c

    used transform (uint64_t) (srtt * srtt) is incorrect. first, the product will be counted in uint32_t, and only then the conversion to uint64_t will be performed.
    
    I couldn't find the importance of preemptive execution (srtt * srtt), so I suggest a simple fix.
    however, if the sequence of the product in the expression ((uint64_t) net-> mtu * (uint64_t) (srtt * srtt)) is important, then I can correct the commit to any of the options:
    1. ((uint64_t) srtt * srtt * net-> mtu)
    2. ((uint64_t) net-> mtu * ((uint64_t) srtt * srtt))
    
    I would also pay attention to the comparison if (srtt> 0), given the unsigned nature of srtt, I would suggest replacing it with if (srtt != 0).
    ihsinme committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    ed49dcb View commit details
    Browse the repository at this point in the history