Results 1 to 3 of 3
I'm hoping there are some 'ping' guru's out there (if such a guru exists) because i've a questoin that has been annoying me for days now. Google doesn't seem to ...
- 05-18-2005 #1Just Joined!
- Join Date
- May 2005
- Location
- US: Pittsburg, KS
- Posts
- 2
Inconsistent behavior: Ping.
I'm hoping there are some 'ping' guru's out there (if such a guru exists) because i've a questoin that has been annoying me for days now. Google doesn't seem to hold the answer, nor do the network admins/developers where i work.
I made a network utility that pings several hundred addresses, some of which are fed to the utility with a leading zero. For instance:
10.11.01.253
10.27.08.253
Why oh why would linux change 10.11.01.253 to 10.11.1.253 but leave 10.27.08.253 as-is? I've worked around the problem already, but am still stumped as to exactly what it is i had to work around.
- 05-19-2005 #2Just Joined!
- Join Date
- May 2005
- Posts
- 7
script
can we see the script?
- 05-19-2005 #3Just Joined!
- Join Date
- May 2005
- Location
- US: Pittsburg, KS
- Posts
- 2
I don't think the script is relevant here since executing ping from the command line is how i first observed the funky behavior, but here's the relevant portion of the code:
From the command line, typing:Code:// $k is a four digit number, such as 2701 or 1101. These are the unit numbers for stores in a fast food chain that uses mnemonic IP's in its WAN $stip1 = substr($k,0,2); $stip2 = substr($k,2,2); settype($stip1, "integer"); settype($stip2, "integer"); exec("ping -c 2 -q 10.$stip1.$stip2.253",$bmtest);
ping 10.27.01.253 will return "unknown host"
ping 10.27.1.253 will return ping results.
ping 10.11.01.253 will return ping results as 10.11.1.253.
The strangest thing is that i came in this morning and 10.27.01.253 now gets converted to 10.27.1.253 when pinging it. Nothing has changed on our network since yesterday when i made my post.
I guess it isn't too important since setting the script's ip strings to integer does the converting for Suse ES 9, but it had me stumped for days and I just can't let it go. heheh... call me OCD.


Reply With Quote