mirror of
https://github.com/rtbrick/bngblaster.git
synced 2024-05-06 15:54:57 +00:00
Respond to IPv6 PING
This commit is contained in:
@ -495,6 +495,8 @@ bbl_rx_icmpv6(bbl_ethernet_header_t *eth, bbl_ipv6_t *ipv6, bbl_interface_s *int
|
||||
}
|
||||
} else if(icmpv6->type == IPV6_ICMPV6_NEIGHBOR_SOLICITATION) {
|
||||
session->send_requests |= BBL_SEND_ICMPV6_NA;
|
||||
} else if(icmpv6->type == IPV6_ICMPV6_ECHO_REQUEST) {
|
||||
bbl_send_icmpv6_echo_reply(interface, session, eth, ipv6, icmpv6);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1736,6 +1738,8 @@ bbl_rx_network_icmpv6(bbl_ethernet_header_t *eth, bbl_interface_s *interface) {
|
||||
secondary_ip6 = secondary_ip6->next;
|
||||
}
|
||||
}
|
||||
} else if(icmpv6->type == IPV6_ICMPV6_ECHO_REQUEST) {
|
||||
bbl_send_icmpv6_echo_reply(interface, NULL, eth, ipv6, icmpv6);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -188,4 +188,23 @@ bbl_send_icmp_reply(bbl_interface_s *interface,
|
||||
ipv4->ttl = 64;
|
||||
icmp->type = ICMP_TYPE_ECHO_REPLY;
|
||||
return bbl_send_to_buffer(interface, eth);
|
||||
}
|
||||
|
||||
bbl_send_result_t
|
||||
bbl_send_icmpv6_echo_reply(bbl_interface_s *interface,
|
||||
bbl_session_s *session,
|
||||
bbl_ethernet_header_t *eth,
|
||||
bbl_ipv6_t *ipv6,
|
||||
bbl_icmpv6_t *icmpv6)
|
||||
{
|
||||
update_eth(interface, session, eth);
|
||||
ipv6->dst = ipv6->src;
|
||||
if(session) {
|
||||
ipv6->src = session->ipv6_address;
|
||||
} else {
|
||||
ipv6->src = interface->ip6.address;
|
||||
}
|
||||
ipv6->ttl = 255;
|
||||
icmpv6->type = IPV6_ICMPV6_ECHO_REPLY;
|
||||
return bbl_send_to_buffer(interface, eth);
|
||||
}
|
@ -62,4 +62,11 @@ bbl_send_icmp_reply(bbl_interface_s *interface,
|
||||
bbl_ipv4_t *ipv4,
|
||||
bbl_icmp_t *icmp);
|
||||
|
||||
bbl_send_result_t
|
||||
bbl_send_icmpv6_echo_reply(bbl_interface_s *interface,
|
||||
bbl_session_s *session,
|
||||
bbl_ethernet_header_t *eth,
|
||||
bbl_ipv6_t *ipv6,
|
||||
bbl_icmpv6_t *icmpv6);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user