mirror of
https://github.com/ipxe/ipxe
synced 2025-12-26 17:42:47 +03:00
[interface] Ignore any attempts to plug in the null interface
Allow intf_plug() and intf_plug_plug() to be called safely on interfaces that may be the null interface. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -81,9 +81,14 @@ struct interface null_intf = INTF_INIT ( null_intf_desc );
|
|||||||
* interface is updated to point to the new destination interface.
|
* interface is updated to point to the new destination interface.
|
||||||
*/
|
*/
|
||||||
void intf_plug ( struct interface *intf, struct interface *dest ) {
|
void intf_plug ( struct interface *intf, struct interface *dest ) {
|
||||||
|
|
||||||
|
if ( intf == &null_intf )
|
||||||
|
return;
|
||||||
|
|
||||||
DBGC ( INTF_COL ( intf ),
|
DBGC ( INTF_COL ( intf ),
|
||||||
"INTF " INTF_INTF_FMT " replug to " INTF_FMT "\n",
|
"INTF " INTF_INTF_FMT " replug to " INTF_FMT "\n",
|
||||||
INTF_INTF_DBG ( intf, intf->dest ), INTF_DBG ( dest ) );
|
INTF_INTF_DBG ( intf, intf->dest ), INTF_DBG ( dest ) );
|
||||||
|
|
||||||
intf_get ( dest );
|
intf_get ( dest );
|
||||||
intf_put ( intf->dest );
|
intf_put ( intf->dest );
|
||||||
intf->dest = dest;
|
intf->dest = dest;
|
||||||
|
|||||||
Reference in New Issue
Block a user