diff options
| author | Michael Brown | 2020-12-07 14:48:35 +0100 |
|---|---|---|
| committer | Michael Brown | 2020-12-07 14:48:35 +0100 |
| commit | cb0ba2f8253bc4ed3b301928c4a84d6ca1e7593b (patch) | |
| tree | 0607add8d15a13cad379cb22a009efff7b903105 /src/core | |
| parent | [efi] Veto the HP XhciDxe Driver (diff) | |
| download | ipxe-cb0ba2f8253bc4ed3b301928c4a84d6ca1e7593b.tar.gz ipxe-cb0ba2f8253bc4ed3b301928c4a84d6ca1e7593b.tar.xz ipxe-cb0ba2f8253bc4ed3b301928c4a84d6ca1e7593b.zip | |
[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>
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/interface.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/interface.c b/src/core/interface.c index 402aa4541..05e7e4777 100644 --- a/src/core/interface.c +++ b/src/core/interface.c @@ -81,9 +81,14 @@ struct interface null_intf = INTF_INIT ( null_intf_desc ); * interface is updated to point to the new destination interface. */ void intf_plug ( struct interface *intf, struct interface *dest ) { + + if ( intf == &null_intf ) + return; + DBGC ( INTF_COL ( intf ), "INTF " INTF_INTF_FMT " replug to " INTF_FMT "\n", INTF_INTF_DBG ( intf, intf->dest ), INTF_DBG ( dest ) ); + intf_get ( dest ); intf_put ( intf->dest ); intf->dest = dest; |
