diff options
author | Arnaud Patard <rtp@mageia.org> | 2011-03-18 21:21:26 +0000 |
---|---|---|
committer | Arnaud Patard <rtp@mageia.org> | 2011-03-18 21:21:26 +0000 |
commit | fc56c220e2f73ad852c2507d4aee26e37b8b2ed1 (patch) | |
tree | a3507f3b193fde9731ecbc49b984faf0da4651e6 /mdk-stage1/network.c | |
parent | d244ccf9730dd4e860734d0ff4115ed3613ac195 (diff) | |
download | drakx-backup-do-not-use-fc56c220e2f73ad852c2507d4aee26e37b8b2ed1.tar drakx-backup-do-not-use-fc56c220e2f73ad852c2507d4aee26e37b8b2ed1.tar.gz drakx-backup-do-not-use-fc56c220e2f73ad852c2507d4aee26e37b8b2ed1.tar.bz2 drakx-backup-do-not-use-fc56c220e2f73ad852c2507d4aee26e37b8b2ed1.tar.xz drakx-backup-do-not-use-fc56c220e2f73ad852c2507d4aee26e37b8b2ed1.zip |
- try to handle the built-in module case before trying to load a module.
Diffstat (limited to 'mdk-stage1/network.c')
-rw-r--r-- | mdk-stage1/network.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/mdk-stage1/network.c b/mdk-stage1/network.c index 85704b805..a1af8af0f 100644 --- a/mdk-stage1/network.c +++ b/mdk-stage1/network.c @@ -31,6 +31,7 @@ #include <sys/ioctl.h> #include <sys/mount.h> #include <stdio.h> +#include <fcntl.h> #include <netdb.h> #include <resolv.h> #include <sys/utsname.h> @@ -568,8 +569,15 @@ static enum return_type bringup_networking(struct interface_info * intf) { static struct interface_info loopback; enum return_type results; - - my_insmod("af_packet", ANY_DRIVER_TYPE, NULL, 1); + int fd; + + /* try to find if module already loaded or built-in to avoid failing */ + /* badly */ + fd = open("/proc/net/packet", O_RDONLY); + if (fd < 0) + my_insmod("af_packet", ANY_DRIVER_TYPE, NULL, 1); + else + close(fd); do { results = configure_wireless(intf->device); |