summaryrefslogtreecommitdiff
path: root/src/kernel/kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/kernel.c')
-rw-r--r--src/kernel/kernel.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c
index 0b10f45..d91c5d6 100644
--- a/src/kernel/kernel.c
+++ b/src/kernel/kernel.c
@@ -461,8 +461,8 @@ void handle_network_event( network_event_t *event, void *context )
char src_mac_addr[NETWORK_ETHERNET_MAC_ADDR_STRING];
char dst_mac_addr[NETWORK_ETHERNET_MAC_ADDR_STRING];
- network_mac_address_to_string( packet->header.src_addr, src_mac_addr, NETWORK_ETHERNET_MAC_ADDR_STRING );
- network_mac_address_to_string( packet->header.dst_addr, dst_mac_addr, NETWORK_ETHERNET_MAC_ADDR_STRING );
+ ethernet_mac_address_to_string( packet->header.src_addr, src_mac_addr, NETWORK_ETHERNET_MAC_ADDR_STRING );
+ ethernet_mac_address_to_string( packet->header.dst_addr, dst_mac_addr, NETWORK_ETHERNET_MAC_ADDR_STRING );
printf( "NETWORK DATA: src: %s, dst: %s, len: %d, type: %X\n",
src_mac_addr, dst_mac_addr,
event->buf.length,
@@ -473,8 +473,8 @@ void handle_network_event( network_event_t *event, void *context )
char src_ip[NETWORK_PROTOCOL_IPV4_ADDR_STRING];
char dst_ip[NETWORK_PROTOCOL_IPV4_ADDR_STRING];
- network_mac_address_to_string( arp->source_hardware_address, src_mac_addr, NETWORK_ETHERNET_MAC_ADDR_STRING );
- network_mac_address_to_string( arp->destination_hardware_address, dst_mac_addr, NETWORK_ETHERNET_MAC_ADDR_STRING );
+ ethernet_mac_address_to_string( arp->source_hardware_address, src_mac_addr, NETWORK_ETHERNET_MAC_ADDR_STRING );
+ ethernet_mac_address_to_string( arp->destination_hardware_address, dst_mac_addr, NETWORK_ETHERNET_MAC_ADDR_STRING );
network_ipv4_address_to_string( arp->source_protocol_address, src_ip, NETWORK_PROTOCOL_IPV4_ADDR_STRING );
network_ipv4_address_to_string( arp->destination_protocol_address, dst_ip, NETWORK_PROTOCOL_IPV4_ADDR_STRING );
@@ -489,6 +489,9 @@ void handle_network_event( network_event_t *event, void *context )
arp->operation = ARP_OPERATION_ANSWER;
arp->destination_hardware_address = arp->source_hardware_address;
arp->source_hardware_address = global_context.network->mac_address;
+ network_ipv4_address_t tmp = arp->destination_protocol_address;
+ arp->destination_protocol_address = arp->source_protocol_address;
+ arp->source_protocol_address = tmp;
((network_vtable_t *)( global_context.network->base.vtable ))->write( global_context.network, event->buf );
}