diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2021-07-26 07:11:33 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2021-07-26 07:11:33 +0200 |
commit | 0be49ccd93186600e40b8bffe867d18c4d16366a (patch) | |
tree | 3a8c34b3724a23dbfc9b272e77e109dfbb5ef645 | |
parent | 60dee2705b3a9a8b1c3302b94b098c2d07b41a85 (diff) | |
download | passt-0be49ccd93186600e40b8bffe867d18c4d16366a.tar passt-0be49ccd93186600e40b8bffe867d18c4d16366a.tar.gz passt-0be49ccd93186600e40b8bffe867d18c4d16366a.tar.bz2 passt-0be49ccd93186600e40b8bffe867d18c4d16366a.tar.lz passt-0be49ccd93186600e40b8bffe867d18c4d16366a.tar.xz passt-0be49ccd93186600e40b8bffe867d18c4d16366a.tar.zst passt-0be49ccd93186600e40b8bffe867d18c4d16366a.zip |
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>
-rw-r--r-- | dhcpv6.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -61,7 +61,7 @@ struct opt_hdr { #define STR_NOTONLINK "Prefix not appropriate for link." uint16_t l; -} __attribute__((__packed__)); +}; #if __BYTE_ORDER == __BIG_ENDIAN # define OPT_SIZE_CONV(x) (x) @@ -334,9 +334,6 @@ ia_ta: while ((ia = dhcpv6_opt(ia, ia_type, &__len))) { size_t ia_len = ntohs(ia->l); - if (ia_len > __len) - return NULL; - if (ia_type == OPT_IA_NA) { struct opt_ia_na *opts = (struct opt_ia_na *)ia + 1; |