3

To configure netconsole you should pass IP-address and MAC-address of destination host. If you don't pass MAC as a parameter - netconsole packs IP packet to ethernet frame with broadcast address as a destination. Why does netconsole not search for route to host at routing table?

Is it a netpoll limitation? Or is it fault tolerance feature, if something wrong with network stack? Or is it done for faster work? Or it's just hard to implement?

What is the main reason?

3

Netconsole was designed to work as soon as possible after a reboot. From the kernel documentation:

Netconsole was designed to be as instantaneous as possible, to enable the logging of even the most critical kernel bugs. It works from IRQ contexts as well, and does not enable interrupts while sending packets. Due to these unique needs, configuration cannot be more automatic, and some fundamental limitations will remain: only IP networks, UDP packets and ethernet devices are supported.

As you can see, netconsole is intended to be a debugging feature, not for daily use. For this purpose the designers wanted it to be as simple and robust as possible, even if configuring it is a but crude.

If the feature had been designed automiatically find out where to send the packet, the code would have to query the routing table to see if the destination host is in the same subnet, but routing is probably not set up when the first messages are to be sent. Even if we can assume the destination host is in the same subnet, without knowledge of the destination MAC address, the implementation would first have to make an ARP query. While waiting for the response, the kernel crashes and the crash message is lost.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.