From: Simon Kuenzer Date: Tue, 12 Oct 2021 15:22:01 +0000 (+0200) Subject: Print network device hardware address X-Git-Tag: RELEASE-0.8.0~1 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7315e429ed819630892e8c8e82856500bb66852f;p=unikraft%2Flibs%2Flwip.git Print network device hardware address During network device initialization, print the hardware address of the network device to the info kernel console. This should simplify first-level of diagnosis. Signed-off-by: Simon Kuenzer Reviewed-by: Sergiu Moga Approved-by: Marc Rittinghaus Tested-by: Unikraft CI GitHub-Pull-Request: #10 --- diff --git a/init.c b/init.c index 584c0a5..3e054d4 100644 --- a/init.c +++ b/init.c @@ -253,6 +253,14 @@ no_conf: continue; } + /* Print hardware address */ + if (nf->hwaddr_len == 6) { + uk_pr_info("%c%c%u: Hardware address: %02"PRIx8":%02"PRIx8":%02"PRIx8":%02"PRIx8":%02"PRIx8":%02"PRIx8"\n", + nf->name[0], nf->name[1], nf->num, + nf->hwaddr[0], nf->hwaddr[1], nf->hwaddr[2], + nf->hwaddr[3], nf->hwaddr[4], nf->hwaddr[5]); + } + /* Declare the first network device as default interface */ if (is_first_nf) { uk_pr_info("%c%c%u: Set as default interface\n",