randomize fake Ethernet address to be used as IPX node number

This commit is contained in:
Masaq- 2015-06-12 01:01:23 +00:00
parent 9fb6b134ec
commit 7091c56ccd

View File

@ -255,12 +255,9 @@ static int sheep_net_open(struct inode *inode, struct file *f)
memset(v, 0, sizeof(struct SheepVars)); memset(v, 0, sizeof(struct SheepVars));
skb_queue_head_init(&v->queue); skb_queue_head_init(&v->queue);
init_waitqueue_head(&v->wait); init_waitqueue_head(&v->wait);
v->fake_addr[0] = 0xfe; v->fake_addr[0] = 'v'; /* "SheepShaver" */
v->fake_addr[1] = 0xfd; v->fake_addr[1] = 'r'; /* ^ ^ */
v->fake_addr[2] = 0xde; get_random_bytes(&v->fake_addr[2], 4);
v->fake_addr[3] = 0xad;
v->fake_addr[4] = 0xbe;
v->fake_addr[5] = 0xef;
/* Put our stuff where we will be able to find it later */ /* Put our stuff where we will be able to find it later */
f->private_data = (void *)v; f->private_data = (void *)v;