X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fkernel%2Fsamples%2Fnetdev%2F.git;a=blobdiff_plain;f=ndeth.c;h=802ec1137968b9dcba62eb1c870e28bd08ee01f5;hp=c9402c432e10f05e8af26ba9136eb4a62d5a24ff;hb=e9aacd4c8b0a859e014e7ccc0c91199c303318fe;hpb=4582c6dc1f10642ebecbe9fdebc241a265ad4516 diff --git a/ndeth.c b/ndeth.c index c9402c4..802ec11 100644 --- a/ndeth.c +++ b/ndeth.c @@ -62,10 +62,13 @@ struct net_device *ndeth; static __init int ndeth_init(void) { int r = -ENOMEM; + char addr[ETH_ALEN]; ndeth = alloc_etherdev(0); if (!ndeth) goto out; ndeth->netdev_ops = &ndeth_ops; + random_ether_addr(addr); + memcpy(ndeth->dev_addr, addr, ETH_ALEN); r = register_netdev(ndeth); if (r) goto reg_out;