[interface] Provide intf_reinit() to reinitialise nullified interfaces

Provide an abstraction intf_reinit() to restore the descriptor of a
previously nullified interface.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2016-11-16 22:22:13 +00:00
parent b991c67c1d
commit daa8ed9274
3 changed files with 20 additions and 6 deletions

View File

@@ -295,7 +295,6 @@ void intf_shutdown ( struct interface *intf, int rc ) {
* blocked during shutdown.
*/
void intf_restart ( struct interface *intf, int rc ) {
struct interface_descriptor *desc = intf->desc;
/* Shut down the interface */
intf_shutdown ( intf, rc );
@@ -309,7 +308,7 @@ void intf_restart ( struct interface *intf, int rc ) {
* infinite loop as the intf_close() operations on each side
* of the link call each other recursively.
*/
intf->desc = desc;
intf_reinit ( intf );
}
/**