udhcpc6: add a few comments, no code changes.
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 13 Apr 2019 17:43:15 +0000 (19:43 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 13 Apr 2019 17:43:15 +0000 (19:43 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/udhcp/d6_dhcpc.c
networking/udhcp/d6_socket.c

index 97985642bb0f7c577ac3cdc72b71ff90df56665e..112f12df2b6c5f71499d368efa291691fe8ad903 100644 (file)
@@ -531,6 +531,7 @@ static uint8_t *add_d6_client_options(uint8_t *ptr)
 
 static int d6_mcast_from_client_config_ifindex(struct d6_packet *packet, uint8_t *end)
 {
+       /* FF02::1:2 is "All_DHCP_Relay_Agents_and_Servers" address */
        static const uint8_t FF02__1_2[16] = {
                0xFF, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02,
index 6ad53a9c2bf0dd25dca42209eb64c9491cbe7b1d..fe46e5f1d39911d8b0703558a8067a17af871ab9 100644 (file)
@@ -38,6 +38,15 @@ int FAST_FUNC d6_read_interface(const char *interface, int *ifindex, struct in6_
                        log1("IP %s", inet_ntoa(((struct sockaddr_in *)ifa->ifa_addr)->sin_addr));
                }
 #endif
+/* RFC 3315
+ * 16. Client Source Address and Interface Selection
+ *
+ * "When a client sends a DHCP message to the
+ * All_DHCP_Relay_Agents_and_Servers address, ... ... The client
+ * MUST use a link-local address assigned to the interface for which it
+ * is requesting configuration information as the source address in the
+ * header of the IP datagram."
+ */
                if (ifa->ifa_addr->sa_family == AF_INET6
                 && IN6_IS_ADDR_LINKLOCAL(&sip6->sin6_addr)
                ) {