File tree 1 file changed +9
-18
lines changed
1 file changed +9
-18
lines changed Original file line number Diff line number Diff line change @@ -137,21 +137,16 @@ static uint8_t* ICACHE_FLASH_ATTR add_offer_options(uint8_t *optptr)
137
137
138
138
ipadd .addr = * ( (uint32_t * ) & server_address );
139
139
140
- #ifdef USE_CLASS_B_NET
141
- * optptr ++ = DHCP_OPTION_SUBNET_MASK ;
142
- * optptr ++ = 4 ; //length
143
- * optptr ++ = 255 ;
144
- * optptr ++ = 240 ;
145
- * optptr ++ = 0 ;
146
- * optptr ++ = 0 ;
147
- #else
140
+ struct ip_info if_ip ;
141
+ os_bzero (& if_ip , sizeof (struct ip_info ));
142
+ wifi_get_ip_info (SOFTAP_IF , & if_ip );
143
+
148
144
* optptr ++ = DHCP_OPTION_SUBNET_MASK ;
149
- * optptr ++ = 4 ;
150
- * optptr ++ = 255 ;
151
- * optptr ++ = 255 ;
152
- * optptr ++ = 255 ;
153
- * optptr ++ = 0 ;
154
- #endif
145
+ * optptr ++ = 4 ;
146
+ * optptr ++ = ip4_addr1 ( & if_ip .netmask );
147
+ * optptr ++ = ip4_addr2 ( & if_ip .netmask );
148
+ * optptr ++ = ip4_addr3 ( & if_ip .netmask );
149
+ * optptr ++ = ip4_addr4 ( & if_ip .netmask );
155
150
156
151
* optptr ++ = DHCP_OPTION_LEASE_TIME ;
157
152
* optptr ++ = 4 ;
@@ -168,10 +163,6 @@ static uint8_t* ICACHE_FLASH_ATTR add_offer_options(uint8_t *optptr)
168
163
* optptr ++ = ip4_addr4 ( & ipadd );
169
164
170
165
if (dhcps_router_enabled (offer )){
171
- struct ip_info if_ip ;
172
- os_bzero (& if_ip , sizeof (struct ip_info ));
173
- wifi_get_ip_info (SOFTAP_IF , & if_ip );
174
-
175
166
* optptr ++ = DHCP_OPTION_ROUTER ;
176
167
* optptr ++ = 4 ;
177
168
* optptr ++ = ip4_addr1 ( & if_ip .gw );
You can’t perform that action at this time.
0 commit comments