ndisc: add comment and static assert for struct sizes for ndisc packet layout

Obviously, there is no change in behavior. It's just an assertion.
This commit is contained in:
Thomas Haller 2021-01-12 16:53:22 +01:00
parent 5a213541ea
commit 96d7ddc865
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -333,7 +333,12 @@ _ndp_msg_add_option(struct ndp_msg *msg, int len)
return ret;
}
/*****************************************************************************/
/* "Recursive DNS Server Option" at https://tools.ietf.org/html/rfc8106#section-5.1 */
#define NM_ND_OPT_RDNSS 25
typedef struct {
struct nd_opt_hdr header;
uint16_t reserved;
@ -341,7 +346,14 @@ typedef struct {
struct in6_addr addrs[0];
} NMLndpRdnssOption;
G_STATIC_ASSERT(sizeof(NMLndpRdnssOption) == 8u);
/*****************************************************************************/
/* "DNS Search List Option" at https://tools.ietf.org/html/rfc8106#section-5.2 */
#define NM_ND_OPT_DNSSL 31
typedef struct {
struct nd_opt_hdr header;
uint16_t reserved;
@ -349,6 +361,10 @@ typedef struct {
char search_list[0];
} NMLndpDnsslOption;
G_STATIC_ASSERT(sizeof(NMLndpDnsslOption) == 8u);
/*****************************************************************************/
static gboolean
send_ra(NMNDisc *ndisc, GError **error)
{