What is INADDR_LOOPBACK for in sockets?

Peter S. Housel housel at en.ecn.purdue.edu
Sun Dec 3 02:15:27 AEST 1989


In article <MCGRATH.89Dec1142539 at paris.Berkeley.EDU>, mcgrath at paris (Roland McGrath) writes:
>INADDR_LOOPBACK is 0x7f000001, Internet address 127.0.0.1, usually called
>`localhost'.  Talking to this address gets you back to where you started from,
>without going through the network hardware.

	The nifty thing is that (on many systems with BSD-derived
networking) you can disable the loopback-net, through which address
127.0.0.1 is routed. Running "ifconfig lo0 down" will disable the
"loopback interface" and the machine will be unable to talk to itself.

	We once had cause to do this. Due to some kernel bug, packets
were occasionally getting stuck in loops within the loopback. The
system would get very sluggish, forwarding packets in tight little
circles.  Until the problem was fixed we just disabled the "interface"
for 30 seconds or so until the offending packet timed out.

-Peter S. Housel-	housel at ecn.purdue.edu		...!pur-ee!housel



More information about the Comp.unix.wizards mailing list