Hello,

This post has some relavance to a former question , which dealt with getting
the ip of eth0 ;Now I must also get the IP on eth0:1 .

I do have an IP on both eth0 and eth0:1 , as running ifconfig  shows
I try in init method of a module I wrote:

.........
struct net_device* device;

device = dev_get_by_name("eth0:1");
if (device == NULL)
 {
 printk("device is NULL\n");
 }

...

I do get the "device is NULL message" after insmod my module.


I had looked at net/pv4/devinet.c  in dev_get_by_name() implementation:

struct net_device *dev_get_by_name(const char *name)
{
        struct net_device *dev;

        read_lock(&dev_base_lock);
        dev = __dev_get_by_name(name);
        if (dev)
                dev_hold(dev);
        read_unlock(&dev_base_lock);
        return dev;
}

but I don't know what the problem is.

Any idea how can I get the device for eth0:1?

Regards,
Amir

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to