mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-19 00:27:21 +00:00
parent
db6a2419f2
commit
b2ea164c76
repos/os/src/server/nic_router
@ -88,7 +88,9 @@ void Dhcp_client::_handle_timeout(Duration)
|
||||
|
||||
void Dhcp_client::handle_ip(Ethernet_frame ð, size_t eth_size)
|
||||
{
|
||||
if (eth.dst() != _interface.router_mac()) {
|
||||
if (eth.dst() != _interface.router_mac() &&
|
||||
eth.dst() != Mac_address(0xff))
|
||||
{
|
||||
throw Packet_ignored("DHCP client expects Ethernet targeting the router");
|
||||
}
|
||||
Ipv4_packet &ip = *new (eth.data<void>())
|
||||
@ -109,6 +111,9 @@ void Dhcp_client::handle_ip(Ethernet_frame ð, size_t eth_size)
|
||||
if (dhcp.op() != Dhcp_packet::REPLY) {
|
||||
throw Packet_ignored("DHCP client expects DHCP reply");
|
||||
}
|
||||
if (dhcp.client_mac() != _interface.router_mac()) {
|
||||
throw Packet_ignored("DHCP client expects DHCP targeting the router");
|
||||
}
|
||||
try { _handle_dhcp_reply(dhcp); }
|
||||
catch (Dhcp_packet::Option_not_found) {
|
||||
throw Packet_ignored("DHCP client misses DHCP option");
|
||||
|
@ -836,11 +836,16 @@ void Interface::_handle_eth(void *const eth_base,
|
||||
catch (Ethernet_frame::No_ethernet_frame) {
|
||||
error("invalid ethernet frame"); }
|
||||
|
||||
catch (Interface::Bad_network_protocol) {
|
||||
catch (Bad_network_protocol) {
|
||||
if (_config().verbose()) {
|
||||
log("unknown network layer protocol");
|
||||
}
|
||||
}
|
||||
catch (Packet_ignored exception) {
|
||||
if (_config().verbose()) {
|
||||
log("Packet ignored: ", exception.reason);
|
||||
}
|
||||
}
|
||||
catch (Ipv4_packet::No_ip_packet) {
|
||||
error("invalid IP packet"); }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user