dhcpv6: Drop bogus option length test while checking for not-on-link IA_NA
dhcpv6_opt() already reflects consumed bytes on the remaining length, and that we're not exceeding the message length. At this point, the remaining length is usually zero. While at it, drop a useless __packed__ attribute that triggers a gcc warning. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
60dee2705b
commit
0be49ccd93
1 changed files with 1 additions and 4 deletions
5
dhcpv6.c
5
dhcpv6.c
|
@ -61,7 +61,7 @@ struct opt_hdr {
|
||||||
#define STR_NOTONLINK "Prefix not appropriate for link."
|
#define STR_NOTONLINK "Prefix not appropriate for link."
|
||||||
|
|
||||||
uint16_t l;
|
uint16_t l;
|
||||||
} __attribute__((__packed__));
|
};
|
||||||
|
|
||||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||||
# define OPT_SIZE_CONV(x) (x)
|
# define OPT_SIZE_CONV(x) (x)
|
||||||
|
@ -334,9 +334,6 @@ ia_ta:
|
||||||
while ((ia = dhcpv6_opt(ia, ia_type, &__len))) {
|
while ((ia = dhcpv6_opt(ia, ia_type, &__len))) {
|
||||||
size_t ia_len = ntohs(ia->l);
|
size_t ia_len = ntohs(ia->l);
|
||||||
|
|
||||||
if (ia_len > __len)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if (ia_type == OPT_IA_NA) {
|
if (ia_type == OPT_IA_NA) {
|
||||||
struct opt_ia_na *opts = (struct opt_ia_na *)ia + 1;
|
struct opt_ia_na *opts = (struct opt_ia_na *)ia + 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue