Commit 7e5764b 1 parent e48d493 commit 7e5764b Copy full SHA for 7e5764b
File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1294,6 +1294,21 @@ test -e $BUILD_ROOT/etc/hosts || echo "127.0.0.1 localhost" > $BUILD_ROOT/etc/ho
1294
1294
if ! grep -F " 127.0.0.1 $HOST " $BUILD_ROOT /etc/hosts > /dev/null ; then
1295
1295
# this makes a reverse lookup on 127.0.0.1 return the host name,
1296
1296
# which is bad, but 127.0.0.2 does not work on all unix systems
1297
+ #
1298
+ # For any address added to the a netdev, kernels normally add a
1299
+ # corresponding network route implicitly.
1300
+ #
1301
+ # Linux adds the RTF_LOCAL flag to such implicit routes if they are for lo.
1302
+ # Packets whose dstaddr matches a RTF_LOCAL routes are locally-delivered,
1303
+ # and so those dstaddrs effectively appear "live" even if the address is
1304
+ # nowhere assigned :-/
1305
+ #
1306
+ # Classic Unixes do not add implicit network routes for addresses added to
1307
+ # lo. Nor do they set a LOCAL flag for lo's network routes.
1308
+ #
1309
+ # Long story short: if you need 127.0.0.2, explicitly add it as an address
1310
+ # on the interface no matter the OS!
1311
+ #
1297
1312
echo " 127.0.0.1 $HOST " > $BUILD_ROOT /etc/hosts.new
1298
1313
test -f $BUILD_ROOT /etc/hosts && cat $BUILD_ROOT /etc/hosts >> $BUILD_ROOT /etc/hosts.new
1299
1314
mv $BUILD_ROOT /etc/hosts.new $BUILD_ROOT /etc/hosts
You can’t perform that action at this time.
0 commit comments