Re: link state

From: Nelson (tanginhw@comp.nus.edu.sg)
Date: Sat Feb 26 2000 - 12:40:28 EST


correct me if i'm mistaken... but i thought that IFF_UP is set
when the interface is ifconfig to be up and running. it doesn't really
reflect the link state as ifconfig could always bring up an interface
(and thus IFF_UP is on) even if there is no network cable connected
(i.e. no link state) to the interface.

thanx for any clarifications.

Nelson
-------------------------------------------
"You will never walk alone"

On Sat, 26 Feb 2000, [ISO-8859-1] Janne Pänkälä wrote:

> > does linux kernel keep tracks of the link state of network
> > cards/interfaces?
> sure ... I think :)
>
> -- include/linux/netdevice.h --
> struct device
> {
> ...
> unsigned short flags; /* interface flags (a la BSD) */
> ...
> }
>
> to check this up thing.
> -- net/core/dev.c --
> int dev_open(struct device *dev)
> {
> ...
> if (dev->flags&IFF_UP)
> return 0;
> ...
> }
>
> -- to get the dev --
> extern struct device *dev_get(const char *name);
> extern struct device *dev_get_by_index(int ifindex);
>
> --
> Janne
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-net" in
> the body of a message to majordomo@vger.rutgers.edu
>

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.rutgers.edu



This archive was generated by hypermail 2b29 : Tue Feb 29 2000 - 21:00:27 EST