mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-22 02:16:44 +00:00
nic_router: do link garbage collect on each packet
Previously, garbage collect was only done when an incoming packet passed the Ethernet checks. Now it is really done first when receiving a packet at an interface. Ref #2490
This commit is contained in:
parent
215937ff0f
commit
03144093b3
@ -306,9 +306,6 @@ void Interface::_handle_ip(Ethernet_frame ð,
|
|||||||
Genode::size_t const eth_size,
|
Genode::size_t const eth_size,
|
||||||
Packet_descriptor const &pkt)
|
Packet_descriptor const &pkt)
|
||||||
{
|
{
|
||||||
_destroy_closed_links<Udp_link>(_closed_udp_links, _alloc);
|
|
||||||
_destroy_closed_links<Tcp_link>(_closed_tcp_links, _alloc);
|
|
||||||
|
|
||||||
/* read packet information */
|
/* read packet information */
|
||||||
Ipv4_packet &ip = *new (eth.data<void>())
|
Ipv4_packet &ip = *new (eth.data<void>())
|
||||||
Ipv4_packet(eth_size - sizeof(Ethernet_frame));
|
Ipv4_packet(eth_size - sizeof(Ethernet_frame));
|
||||||
@ -542,6 +539,11 @@ void Interface::_handle_eth(void *const eth_base,
|
|||||||
size_t const eth_size,
|
size_t const eth_size,
|
||||||
Packet_descriptor const &pkt)
|
Packet_descriptor const &pkt)
|
||||||
{
|
{
|
||||||
|
/* do garbage collection over transport-layer links */
|
||||||
|
_destroy_closed_links<Udp_link>(_closed_udp_links, _alloc);
|
||||||
|
_destroy_closed_links<Tcp_link>(_closed_tcp_links, _alloc);
|
||||||
|
|
||||||
|
/* inspect and handle ethernet frame */
|
||||||
try {
|
try {
|
||||||
Ethernet_frame * const eth = new (eth_base) Ethernet_frame(eth_size);
|
Ethernet_frame * const eth = new (eth_base) Ethernet_frame(eth_size);
|
||||||
if (_config().verbose()) {
|
if (_config().verbose()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user