[ipxe-devel] [PATCH] rndis: register netdev with MAC filled

Geert Stappers stappers at stappers.nl
Fri Jun 8 10:14:00 UTC 2018


On Fri, Jun 01, 2018 at 09:59:01AM +0300, Roman Kagan wrote:
> register_netdev expects ->hw_addr and ->ll_addr to be already filled, so
> move it towards the end of register_rndis, after the respective fields
> have been successfully queried from the underlying device.
> 
> Signed-off-by: Roman Kagan <rkagan at virtuozzo.com>
> ---
>  src/net/rndis.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/src/net/rndis.c b/src/net/rndis.c
> index 8c4fe8b3..f8a9f829 100644
> --- a/src/net/rndis.c
> +++ b/src/net/rndis.c
> @@ -973,13 +973,6 @@ int register_rndis ( struct rndis_device *rndis ) {
>  	/* Assign device name (for debugging) */
>  	rndis->name = netdev->dev->name;
>  
>  [ ... seven lines ... ]
>  	/* Open RNDIS device to read MAC addresses */
>  	if ( ( rc = rndis->op->open ( rndis ) ) != 0 ) {
>  		DBGC ( rndis, "RNDIS %s could not open: %s\n",
> @@ -1012,6 +1005,13 @@ int register_rndis ( struct rndis_device *rndis ) {
>  	/* Close RNDIS device */
>  	rndis->op->close ( rndis );
>  
>  [ ... seven lines ... ]
>  	return 0;
>  
>   err_query_link:
> @@ -1021,7 +1021,6 @@ int register_rndis ( struct rndis_device *rndis ) {
>   err_initialise:
>  	rndis->op->close ( rndis );
>   err_open:
> -	unregister_netdev ( netdev );

Why the remove of that line?

>   err_register:
>  	return rc;
>  }


Groeten
Geert Stappers
-- 
Leven en laten leven



More information about the ipxe-devel mailing list