]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
proxyarp: Relax frame length limit for RA and NA
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 28 Nov 2014 17:44:58 +0000 (19:44 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 28 Nov 2014 20:37:05 +0000 (22:37 +0200)
Only the NS frames should be checked to be long enough to cover all the
fields used in the NS data structure. This allows shorter RA and NA
frames to be processed for multicast-to-unicast rules.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/ap/ndisc_snoop.c

index cfd90a2c60e0c7cdc054716ed982cd5212d18e58..b0d42dcd82c4912b63c9ccc1e35f659d38176105 100644 (file)
@@ -91,11 +91,13 @@ static void handle_ndisc(void *ctx, const u8 *src_addr, const u8 *buf,
        int res;
        char addrtxt[INET6_ADDRSTRLEN + 1];
 
-       if (len < ETH_HLEN + sizeof(*msg))
+       if (len < ETH_HLEN + sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr))
                return;
        msg = (struct icmpv6_ndmsg *) &buf[ETH_HLEN];
        switch (msg->icmp6h.icmp6_type) {
        case NEIGHBOR_SOLICITATION:
+               if (len < ETH_HLEN + sizeof(*msg))
+                       return;
                if (msg->opt_type != SOURCE_LL_ADDR)
                        return;