summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndi Kleen <andi@firstfloor.org>2000-08-14 07:57:19 +0000
committerAndi Kleen <andi@firstfloor.org>2000-08-14 07:57:19 +0000
commitda306a2c93da2687c7c40ca97529927054078d23 (patch)
tree4765d1a9520434f3a5e357976ed21047069dacbd /include
parent510362ea645a843641606cfe0b416b53b448b452 (diff)
downloadnet-tools-da306a2c93da2687c7c40ca97529927054078d23.tar.gz
net-tools-da306a2c93da2687c7c40ca97529927054078d23.tar.bz2
net-tools-da306a2c93da2687c7c40ca97529927054078d23.zip
Speed up list operations by exploiting that the interface list is ordered,
and the kernel list is normally ordered to. This allows to list 7000 aliases in a reasonable time. Also be a bit smarter on when to read SIOCGIFCONF. The stupid IPv6 /proc parsing on every address still burns a lot of CPU time.
Diffstat (limited to 'include')
-rw-r--r--include/interface.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/interface.h b/include/interface.h
index bd1b948..45d4ac2 100644
--- a/include/interface.h
+++ b/include/interface.h
@@ -28,8 +28,7 @@ struct user_net_device_stats {
};
struct interface {
- struct interface *next;
-
+ struct interface *next, *prev;
char name[IFNAMSIZ]; /* interface name */
short type; /* if type */
short flags; /* various flags */
@@ -66,7 +65,7 @@ extern int if_fetch(struct interface *ife);
extern int for_all_interfaces(int (*)(struct interface *, void *), void *);
extern int free_interface_list(void);
-extern struct interface *lookup_interface(char *name, int readlist);
+extern struct interface *lookup_interface(char *name);
extern int if_readlist(void);
extern int do_if_fetch(struct interface *ife);