From: Tomek Mrugalski Date: Mon, 19 Feb 2018 16:06:31 +0000 (+0100) Subject: [5390] Minor tweaks to comments and docs. X-Git-Tag: trac5502_base~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e76cb2d7fd565c6f1653870b6cf534e16888fe0d;p=thirdparty%2Fkea.git [5390] Minor tweaks to comments and docs. --- diff --git a/doc/guide/dhcp4-srv.xml b/doc/guide/dhcp4-srv.xml index 66a39e6cb2..37be8932e6 100644 --- a/doc/guide/dhcp4-srv.xml +++ b/doc/guide/dhcp4-srv.xml @@ -773,7 +773,7 @@ temporarily override a list of interface names and listen on all interfaces. Usually loopback interfaces (e.g. the "lo" or "lo0" interface) - may not configured but if a loopback interface is explicitely configured + may not be configured but if a loopback interface is explicitely configured and IP/UDP sockets are specified the loopback interface is accepted. diff --git a/doc/guide/dhcp6-srv.xml b/doc/guide/dhcp6-srv.xml index c26b7ab205..acb58b0c4f 100644 --- a/doc/guide/dhcp6-srv.xml +++ b/doc/guide/dhcp6-srv.xml @@ -654,9 +654,9 @@ temporarily override a list of interface names and listen on all interfaces. } - Usually loopback interfaces (e.g. the "lo" or "lo0" interface) - may not configured but if a loopback interface is explicitely configured - it is accepted. Note Kea requires a link-local address which does + The loopback interfaces (i.e. the "lo" or "lo0" interface) + are not configured by default, unles explicitely mentioned in + the configration. Note Kea requires a link-local address which does not exist on all systems, or a specified unicast address as in: diff --git a/src/lib/dhcpsrv/tests/cfg_iface_unittest.cc b/src/lib/dhcpsrv/tests/cfg_iface_unittest.cc index 25c36056b2..d4927176c0 100644 --- a/src/lib/dhcpsrv/tests/cfg_iface_unittest.cc +++ b/src/lib/dhcpsrv/tests/cfg_iface_unittest.cc @@ -209,12 +209,12 @@ TEST_F(CfgIfaceTest, explicitLoopbackV4) { ASSERT_NO_THROW(cfg.use(AF_INET, "lo")); ASSERT_NO_THROW(cfg.useSocketType(AF_INET, CfgIface::SOCKET_UDP)); cfg.openSockets(AF_INET, DHCP4_SERVER_PORT); - // No wildcard is no longer a constraint + // It is now allowed to use loopback, even with wildcard. EXPECT_TRUE(socketOpen("lo", "127.0.0.1")); cfg.closeSockets(); ASSERT_FALSE(socketOpen("lo", "127.0.0.1")); - // Retry without UDP sockets + // Retry without UDP sockets (lo can be only used with udp sockets) cfg.reset(); ASSERT_NO_THROW(cfg.use(AF_INET, "lo")); cfg.openSockets(AF_INET, DHCP4_SERVER_PORT); @@ -227,7 +227,8 @@ TEST_F(CfgIfaceTest, explicitLoopbackV4) { ASSERT_NO_THROW(cfg.use(AF_INET, "lo")); ASSERT_NO_THROW(cfg.useSocketType(AF_INET, CfgIface::SOCKET_UDP)); cfg.openSockets(AF_INET, DHCP4_SERVER_PORT); - // Only loopback is no longer a constraint + // The logic used to require lo to be the only interface. That constraint + // was removed. EXPECT_TRUE(socketOpen("lo", "127.0.0.1")); cfg.closeSockets(); EXPECT_FALSE(socketOpen("lo", "127.0.0.1")); @@ -381,7 +382,8 @@ TEST_F(CfgIfaceTest, explicitLoopbackV6) { ASSERT_NO_THROW(cfg.use(AF_INET6, "*")); ASSERT_NO_THROW(cfg.use(AF_INET6, "lo/::1")); cfg.openSockets(AF_INET6, DHCP6_SERVER_PORT); - // No wildcard is no longer a constraint + // The logic used to require lo to be used only on its own, not with a + // wildcard. That constraint was removed. EXPECT_TRUE(socketOpen("lo", AF_INET6)); cfg.closeSockets(); ASSERT_FALSE(socketOpen("lo", AF_INET6)); @@ -391,7 +393,8 @@ TEST_F(CfgIfaceTest, explicitLoopbackV6) { ASSERT_NO_THROW(cfg.use(AF_INET6, "eth0")); ASSERT_NO_THROW(cfg.use(AF_INET6, "lo/::1")); cfg.openSockets(AF_INET6, DHCP6_SERVER_PORT); - // Only loopback is no longer a constraint + // The logic used to require lo to be used only on its own, not with a + // wildcard. That constraint was removed. EXPECT_TRUE(socketOpen("lo", AF_INET6)); cfg.closeSockets(); ASSERT_FALSE(socketOpen("lo", AF_INET6)); @@ -401,7 +404,8 @@ TEST_F(CfgIfaceTest, explicitLoopbackV6) { ASSERT_NO_THROW(cfg.use(AF_INET6, "eth0/2001:db8:1::1")); ASSERT_NO_THROW(cfg.use(AF_INET6, "lo/::1")); cfg.openSockets(AF_INET6, DHCP6_SERVER_PORT); - // Only loopback is no longer a constraint + // The logic used to require lo to be used only on its own, not with a + // wildcard. That constraint was removed. EXPECT_TRUE(socketOpen("lo", AF_INET6)); cfg.closeSockets(); ASSERT_FALSE(socketOpen("lo", AF_INET6));