Hide Forgot
Description of problem: The ping -R command report (same route) although the route are different. The problem turns up when before reaching the different section route (A or B), there is a 0 value in a component of the IP address of a node. In the following example, which we use in our university lessons, the routers balanced the network traffic one to one: Route A: 10.0.0.2 <- Fedora 15 10.0.4.5 10.0.3.1 10.0.2.2 <- Fedora 15 10.0.2.2 10.0.4.2 10.0.0.1 10.0.0.2 Route B: 10.0.0.2 <- Fedora 15 10.0.4.1 10.0.2.1 10.0.2.2 <- Fedora 15 10.0.2.2 10.0.4.2 10.0.0.1 10.0.0.2 Executing the command ping -R 10.0.2.2 in the 10.0.0.2 host, the ping reports the first route A (or the first route B) and after always the (same route), instead of reporting the A route, B route, A route, B route... Version-Release number of selected component (if applicable): iputils-20071127 and subsequent iputils packages, including Fedora 14, Fedora 15, Fedora 16 and rawhide iputils packages. How reproducible: Execute ping -R in a network with two routes and, for example, Fedora node with IP 10.0.X.X. Steps to Reproduce: 1. Install the iputils package in a Fedora 14 or later version. 2. Execute ping -R in a network as describe above. 3. The ping -R report (same route). 4. Modify the code as after the bug is solved. Actual results: ping -R report (same route) Expected results: ping -R report route A, route B, route A, route B, ... Additional info: The error is caused by the use of the strncmp() function in the code that replaces the obsolete bcmp() function: if (i == old_rrlen && !strncmp((char *)cp, old_rr, i) && !(options & F_FLOOD)) { printf("\t(same route)"); i = ((i + 3) / 4) * 4; cp += i; break; } The bug solution is to replace the strncmp() function for the memcmp() function as follows: if (i == old_rrlen && !memcmp(cp, (unsigned char *)old_rr, i) && !(options & F_FLOOD)) { printf("\t(same route)"); i = ((i + 3) / 4) * 4; cp += i; break; }