@@ -102,6 +102,7 @@ bbl_network_interfaces_add()
102102
103103 /* Copy gateway MAC from config (default 00:00:00:00:00:00) */
104104 memcpy (network_interface -> gateway_mac , network_config -> gateway_mac , ETH_ADDR_LEN );
105+ memcpy (network_interface -> gateway6_mac , network_config -> gateway_mac , ETH_ADDR_LEN );
105106
106107 /* Init IPv4 */
107108 if (network_config -> ip .address && network_config -> gateway ) {
@@ -350,7 +351,7 @@ bbl_network_rx_arp(bbl_network_interface_s *interface, bbl_ethernet_header_s *et
350351 bbl_arp_s * arp = (bbl_arp_s * )eth -> next ;
351352 if (arp -> sender_ip == interface -> gateway ) {
352353 interface -> arp_resolved = true;
353- if (* ( uint32_t * ) interface -> gateway_mac == 0 ) {
354+ if (memcmp ( interface -> gateway_mac , "\x00\x00\x00\x00\x00\x00" , ETH_ADDR_LEN ) == 0 ) {
354355 memcpy (interface -> gateway_mac , arp -> sender , ETH_ADDR_LEN );
355356 }
356357 }
@@ -385,13 +386,13 @@ bbl_network_rx_icmpv6(bbl_network_interface_s *interface,
385386 if (icmpv6 -> type == IPV6_ICMPV6_NEIGHBOR_ADVERTISEMENT ) {
386387 if (memcmp (icmpv6 -> prefix .address , interface -> gateway6 , IPV6_ADDR_LEN ) == 0 ) {
387388 interface -> icmpv6_nd_resolved = true;
388- if (* ( uint32_t * ) interface -> gateway_mac == 0 ) {
389+ if (memcmp ( interface -> gateway6_mac , "\x00\x00\x00\x00\x00\x00" , ETH_ADDR_LEN ) == 0 ) {
389390 if (icmpv6 -> dst_mac == NULL ) {
390391 gw_mac = eth -> src ;
391392 } else {
392393 gw_mac = icmpv6 -> dst_mac ;
393394 }
394- memcpy (interface -> gateway_mac , gw_mac , ETH_ADDR_LEN );
395+ memcpy (interface -> gateway6_mac , gw_mac , ETH_ADDR_LEN );
395396 }
396397 }
397398 } else if (icmpv6 -> type == IPV6_ICMPV6_NEIGHBOR_SOLICITATION ) {
0 commit comments