lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] lwip on linux


From: Jeff Barber
Subject: Re: [lwip-users] lwip on linux
Date: Mon, 11 May 2009 05:47:36 -0400

On Mon, May 11, 2009 at 2:06 AM, Simon Goldschmidt <address@hidden> wrote:
>
>> Im able to run the simhost application on my Ubuntu 8.04 system. while
>> trying to debug the code, im not able to location the code that sets the
>> MAC address for the tap0 device.
>> Can anyone help me as in which file to look for this?
>
> It's been a while since I last worked with the linux port, but isn't the 
> address of the tap0 device set when you create/set up the interface in linux? 
> It shouldn't be set up by the lwIP code: if I remember correctly, there are 2 
> addresses involved, one for the tap device and one for lwIP?

That's right.  The tap device's MAC address is created by the kernel
as a result of this line in contrib/ports/unix/netif/tapif.c:
    if (ioctl(tapif->fd, TUNSETIFF, (void *) &ifr) < 0) {

The kernel code can be found in <linux_src_root>/drivers/net/tun.c.
The MAC address is created with a call to random_ether_addr().

Jeff




reply via email to

[Prev in Thread] Current Thread [Next in Thread]