diff options
| -rw-r--r-- | networking/udhcp/d6_common.h | 36 | ||||
| -rw-r--r-- | networking/udhcp/d6_dhcpc.c | 8 |
2 files changed, 42 insertions, 2 deletions
diff --git a/networking/udhcp/d6_common.h b/networking/udhcp/d6_common.h index ca5788390..310550371 100644 --- a/networking/udhcp/d6_common.h +++ b/networking/udhcp/d6_common.h | |||
| @@ -87,6 +87,42 @@ struct d6_option { | |||
| 87 | #define D6_OPT_IA_PD 25 | 87 | #define D6_OPT_IA_PD 25 |
| 88 | #define D6_OPT_IAPREFIX 26 | 88 | #define D6_OPT_IAPREFIX 26 |
| 89 | 89 | ||
| 90 | /* RFC 4704 "The DHCPv6 Client FQDN Option" | ||
| 91 | * uint16 option-code OPTION_CLIENT_FQDN (39) | ||
| 92 | * uint16 option-len 1 + length of domain name | ||
| 93 | * uint8 flags | ||
| 94 | * char[] domain-name partial or fully qualified domain name | ||
| 95 | * | ||
| 96 | * Flags format is |MBZ|N|O|S| | ||
| 97 | * The "S" bit indicates whether the server SHOULD or SHOULD NOT perform | ||
| 98 | * the AAAA RR (FQDN-to-address) DNS updates. A client sets the bit to | ||
| 99 | * 0 to indicate that the server SHOULD NOT perform the updates and 1 to | ||
| 100 | * indicate that the server SHOULD perform the updates. The state of | ||
| 101 | * the bit in the reply from the server indicates the action to be taken | ||
| 102 | * by the server; if it is 1, the server has taken responsibility for | ||
| 103 | * AAAA RR updates for the FQDN. | ||
| 104 | * The "O" bit indicates whether the server has overridden the client's | ||
| 105 | * preference for the "S" bit. A client MUST set this bit to 0. A | ||
| 106 | * server MUST set this bit to 1 if the "S" bit in its reply to the | ||
| 107 | * client does not match the "S" bit received from the client. | ||
| 108 | * The "N" bit indicates whether the server SHOULD NOT perform any DNS | ||
| 109 | * updates. A client sets this bit to 0 to request that the server | ||
| 110 | * SHOULD perform updates (the PTR RR and possibly the AAAA RR based on | ||
| 111 | * the "S" bit) or to 1 to request that the server SHOULD NOT perform | ||
| 112 | * any DNS updates. A server sets the "N" bit to indicate whether the | ||
| 113 | * server SHALL (0) or SHALL NOT (1) perform DNS updates. If the "N" | ||
| 114 | * bit is 1, the "S" bit MUST be 0. | ||
| 115 | * | ||
| 116 | * If a client knows only part of its name, it MAY send a name that is not | ||
| 117 | * fully qualified, indicating that it knows part of the name but does not | ||
| 118 | * necessarily know the zone in which the name is to be embedded. | ||
| 119 | * To send a fully qualified domain name, the Domain Name field is set | ||
| 120 | * to the DNS-encoded domain name including the terminating zero-length | ||
| 121 | * label. To send a partial name, the Domain Name field is set to the | ||
| 122 | * DNS-encoded domain name without the terminating zero-length label. | ||
| 123 | * A client MAY also leave the Domain Name field empty if it desires the | ||
| 124 | * server to provide a name. | ||
| 125 | */ | ||
| 90 | #define D6_OPT_CLIENT_FQDN 39 | 126 | #define D6_OPT_CLIENT_FQDN 39 |
| 91 | 127 | ||
| 92 | #define D6_OPT_TZ_POSIX 41 | 128 | #define D6_OPT_TZ_POSIX 41 |
diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c index 08a26fb57..ef9b9a5f2 100644 --- a/networking/udhcp/d6_dhcpc.c +++ b/networking/udhcp/d6_dhcpc.c | |||
| @@ -98,8 +98,12 @@ static const char opt_req[] = { | |||
| 98 | 98 | ||
| 99 | static const char opt_fqdn_req[] = { | 99 | static const char opt_fqdn_req[] = { |
| 100 | (D6_OPT_CLIENT_FQDN >> 8), (D6_OPT_CLIENT_FQDN & 0xff), | 100 | (D6_OPT_CLIENT_FQDN >> 8), (D6_OPT_CLIENT_FQDN & 0xff), |
| 101 | 0, 2, | 101 | 0, 2, /* optlen */ |
| 102 | 0, 0 | 102 | 0, /* flags: */ |
| 103 | /* S=0: server SHOULD NOT perform AAAA RR updates */ | ||
| 104 | /* O=0: client MUST set this bit to 0 */ | ||
| 105 | /* N=0: server SHOULD perform updates (PTR RR only in our case, since S=0) */ | ||
| 106 | 0 /* empty DNS-encoded name */ | ||
| 103 | }; | 107 | }; |
| 104 | 108 | ||
| 105 | /*** Utility functions ***/ | 109 | /*** Utility functions ***/ |
