[DRBD-cvs] user by phil; quiten and fix verify_ips. maybe it work...

drbd-user@lists.linbit.com drbd-user@lists.linbit.com
Tue, 4 May 2004 13:55:51 +0200 (CEST)


DRBD CVS committal

Author  : phil
Project : drbd
Module  : user

Dir     : drbd/user


Modified Files:
      Tag: rel-0_7-branch
	drbdadm_main.c 


Log Message:
quiten and fix verify_ips. maybe it works now generically as intended? --lge
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/user/Attic/drbdadm_main.c,v
retrieving revision 1.1.2.47
retrieving revision 1.1.2.48
diff -u -3 -r1.1.2.47 -r1.1.2.48
--- drbdadm_main.c	3 May 2004 08:46:14 -0000	1.1.2.47
+++ drbdadm_main.c	4 May 2004 11:55:46 -0000	1.1.2.48
@@ -622,7 +622,7 @@
 	"  ifconfig | grep -qE ' inet addr:'$IP' ';"
 	"else"
 	"  echo >&2 $0: 'neither ip nor ifconfig found!';"
-	"fi",
+	"fi >/dev/null",
 	my_ip);
   if (ex < 0) { perror("asprintf"); exit(E_thinko); }
   ex = m_system(1,argv);
@@ -643,7 +643,7 @@
     return;
   }
 
-#if 0
+#if 1
 /* seems to not work as expected with aliases.
  * maybe drop it completely and trust the admin.
  */
@@ -652,11 +652,11 @@
 	"peerIP=%s; peerIPQ=${peerIP//./\\\\.};"
 	"LANG=; PATH=/sbin/:$PATH;"
 	"if type -p ip ; then "
-	"  ip -o route get to $peerIP 2>/dev/null |"
-	"    grep -qE $peerIPQ' dev .* src '$IPQ' ';"
+	"  ip -o route get to $peerIP from $IP 2>/dev/null |"
+	"    grep -qE ^$peerIPQ' from '$IPQ' ';"
 	"else"
-	"  echo >&2 $0: 'cannot check route to peer';"
-	"fi",
+	"  # echo >&2 $0: 'cannot check route to peer';"
+	"fi >/dev/null",
 	my_ip,his_ip);
   if (ex < 0) { perror("asprintf"); exit(E_thinko); }
   ex = m_system(1,argv);