]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Add support for multicast-to-unicast conversion for DGAF Disable
authorKyeyoon Park <kyeyoonp@qca.qualcomm.com>
Mon, 3 Nov 2014 22:10:24 +0000 (14:10 -0800)
committerJouni Malinen <j@w1.fi>
Wed, 19 Nov 2014 14:47:06 +0000 (16:47 +0200)
When DGAF Disable is on, perform multicast-to-unicast for DHCP packets
and Router Advertisement packets. This is a requirement for Hotspot 2.0.

Signed-off-by: Kyeyoon Park <kyeyoonp@qca.qualcomm.com>
src/ap/dhcp_snoop.c
src/ap/ndisc_snoop.c

index 40f5421aade0b4b2ec024f6540756618f69dd491..0b8f92aa2cf3bf08c8432ebd9827b162c455cd77 100644 (file)
@@ -128,6 +128,12 @@ static void handle_dhcp(void *ctx, const u8 *src_addr, const u8 *buf,
                }
                sta->ipaddr = b->your_ip;
        }
+
+       if (hapd->conf->disable_dgaf && is_broadcast_ether_addr(buf)) {
+               for (sta = hapd->sta_list; sta; sta = sta->next)
+                       x_snoop_mcast_to_ucast_convert_send(hapd, sta,
+                                                           (u8 *) buf, len);
+       }
 }
 
 
index 81b9d8426ee8bff93c8dd95c25c691418297c1de..b6faeedc0a2e2c8cd644826425e6eb8141588f67 100644 (file)
@@ -32,6 +32,7 @@ struct icmpv6_ndmsg {
        u8 opt_lladdr[0];
 };
 
+#define ROUTER_ADVERTISEMENT   134
 #define NEIGHBOR_SOLICITATION  135
 #define NEIGHBOR_ADVERTISEMENT 136
 #define SOURCE_LL_ADDR         1
@@ -123,6 +124,10 @@ static void handle_ndisc(void *ctx, const u8 *src_addr, const u8 *buf,
                                return;
                }
                break;
+       case ROUTER_ADVERTISEMENT:
+               if (!hapd->conf->disable_dgaf)
+                       return;
+               /* fall through */
        case NEIGHBOR_ADVERTISEMENT:
                for (sta = hapd->sta_list; sta; sta = sta->next) {
                        x_snoop_mcast_to_ucast_convert_send(hapd, sta,