Skip to content

Commit 7e5764b

Browse files
authored
init_buildsystem: explain the remark about 127.0.0.2 (openSUSE#1050)
1 parent e48d493 commit 7e5764b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

init_buildsystem

+15
Original file line numberDiff line numberDiff line change
@@ -1294,6 +1294,21 @@ test -e $BUILD_ROOT/etc/hosts || echo "127.0.0.1 localhost" > $BUILD_ROOT/etc/ho
12941294
if ! grep -F "127.0.0.1 $HOST" $BUILD_ROOT/etc/hosts > /dev/null ; then
12951295
# this makes a reverse lookup on 127.0.0.1 return the host name,
12961296
# 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+
#
12971312
echo "127.0.0.1 $HOST" > $BUILD_ROOT/etc/hosts.new
12981313
test -f $BUILD_ROOT/etc/hosts && cat $BUILD_ROOT/etc/hosts >> $BUILD_ROOT/etc/hosts.new
12991314
mv $BUILD_ROOT/etc/hosts.new $BUILD_ROOT/etc/hosts

0 commit comments

Comments
 (0)