mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-08 20:05:54 +00:00
nic_router: support domain-local IPv4
If an IPv4 packet targets an IP local to the domain it comes from and doesn't target the routers IP of that domain, forward it to all other interfaces of the domain without considering any other routing. Issue #2609
This commit is contained in:
parent
b63d83e6a3
commit
f524fb8e61
@ -562,6 +562,18 @@ void Interface::_handle_ip(Ethernet_frame ð,
|
||||
Ipv4_packet &ip = *new (eth.data<void>())
|
||||
Ipv4_packet(eth_size - sizeof(Ethernet_frame));
|
||||
|
||||
/* try handling subnet-local IP packets */
|
||||
if (_ip_config().interface.prefix_matches(ip.dst()) &&
|
||||
ip.dst() != _router_ip())
|
||||
{
|
||||
/*
|
||||
* Packet targets IP local to the domain's subnet and doesn't target
|
||||
* the router. Thus, forward it to all other interfaces of the domain.
|
||||
*/
|
||||
_domain_broadcast(eth, eth_size);
|
||||
return;
|
||||
}
|
||||
|
||||
/* try to route via transport layer rules */
|
||||
try {
|
||||
L3_protocol const prot = ip.protocol();
|
||||
|
Loading…
x
Reference in New Issue
Block a user