From ea4d3e2c8c35f2060677c18df45143efd0f9d4df Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 14 Sep 2010 11:17:48 +0000 Subject: [PATCH] * Don't run dhclient on Xen's peth* devices. svn path=/nixos/trunk/; revision=23779 --- modules/services/networking/dhclient.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/services/networking/dhclient.nix b/modules/services/networking/dhclient.nix index 7b334a8e51e2..bd3f781c19a5 100644 --- a/modules/services/networking/dhclient.nix +++ b/modules/services/networking/dhclient.nix @@ -78,9 +78,13 @@ in for i in $(cd /sys/class/net && ls -d *); do # Only run dhclient on interfaces of type ARPHRD_ETHER - # (1), i.e. Ethernet. - if [ "$(cat /sys/class/net/$i/type)" = 1 ]; then - if ! for j in ${toString ignoredInterfaces}; do echo $j; done | grep -F -x -q "$i"; then + # (1), i.e. Ethernet. Ignore peth* devices; on Xen, + # they're renamed physical Ethernet cards used for + # bridging. + if [ "$(cat /sys/class/net/$i/type)" = 1 ]; then + if ! for j in ${toString ignoredInterfaces}; do echo $j; done | grep -F -x -q "$i" && + ! echo "$i" | grep -x -q "peth.*"; + then echo "Running dhclient on $i" interfaces="$interfaces $i" fi