Fix udev netif_rename problem

This commit is contained in:
Arne Fitzenreiter
2009-04-29 11:39:56 +02:00
parent 3519a7b9dd
commit 9c7b8b4550
6 changed files with 51 additions and 1 deletions

View File

@@ -1,2 +1,3 @@
etc/ipsec.conf
etc/ipsec.secrets
etc/udev/rules.d/30-persistent-network.rules

View File

@@ -1,6 +1,7 @@
bin/probenic.sh
etc/ntp
etc/rc.d/init.d/snort
etc/rc.d/init.d/networking/red
etc/ssh/moduli
etc/ssh/ssh_config
etc/ssh/sshd_config

View File

@@ -0,0 +1 @@
../../../common/udev

View File

@@ -67,7 +67,7 @@
* centerim-4.22.1
* clamav-0.94.2
* cmake-2.4.8
* collectd-4.5.1
* collectd-4.5.3
* compat-wireless-2009-03-30-kmod-2.6.27.21-ipfire
* compat-wireless-2009-03-30-kmod-2.6.27.21-ipfire-xen
* coreutils-5.96
@@ -241,6 +241,7 @@
* openssl-0.9.8k
* openswan-2.6.21
* openswan-2.6.21-kmod-2.6.27.21-ipfire
* openswan-2.6.21-kmod-2.6.27.21-ipfire-xen
* openvpn-2.0.9
* p7zip_4.65
* pam_mysql-0.7RC1

View File

@@ -80,6 +80,7 @@ $(subst %,%_MD5,$(objects)) :
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/udev-096-netif_rename.patch
ifeq "$(LFS_PASS)" "install"
cd $(DIR_APP) && make DESTDIR=/install/initrd sbindir=/sbin udevdir=/dev
cd $(DIR_APP) && make DESTDIR=/install/initrd sbindir=/sbin udevdir=/dev install

View File

@@ -0,0 +1,45 @@
diff -Naur udev-096.org/udev_device.c udev-096/udev_device.c
--- udev-096.org/udev_device.c 2006-07-09 21:48:19.000000000 +0200
+++ udev-096/udev_device.c 2009-04-28 22:04:56.000000000 +0200
@@ -102,40 +102,8 @@
strlcpy(ifr.ifr_newname, udev->name, IFNAMSIZ);
retval = ioctl(sk, SIOCSIFNAME, &ifr);
if (retval != 0) {
- int loop;
-
- /* see if the destination interface name already exists */
- if (errno != EEXIST) {
- err("error changing netif name: %s", strerror(errno));
- goto exit;
- }
-
- /* free our own name, another process may wait for us */
- strlcpy(ifr.ifr_newname, udev->dev->kernel_name, IFNAMSIZ);
- strlcat(ifr.ifr_newname, "_rename", IFNAMSIZ);
- retval = ioctl(sk, SIOCSIFNAME, &ifr);
- if (retval != 0) {
- err("error changing netif name: %s", strerror(errno));
- goto exit;
- }
-
- /* wait 30 seconds for our target to become available */
- strlcpy(ifr.ifr_name, ifr.ifr_newname, IFNAMSIZ);
- strlcpy(ifr.ifr_newname, udev->name, IFNAMSIZ);
- loop = 30 * 20;
- while (loop--) {
- retval = ioctl(sk, SIOCSIFNAME, &ifr);
- if (retval != 0) {
- if (errno != EEXIST) {
- err("error changing net interface name: %s", strerror(errno));
- break;
- }
- dbg("wait for netif '%s' to become free, loop=%i", udev->name, (30 * 20) - loop);
- usleep(1000 * 1000 / 20);
- }
- }
+ err("error changing netif name: %s", strerror(errno));
}
-
exit:
close(sk);
return retval;