Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Jul 2007 09:40:47 GMT
From:      Matus Harvan <mharvan@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 123260 for review
Message-ID:  <200707100940.l6A9el1D040230@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=123260

Change 123260 by mharvan@mharvan_twoflower on 2007/07/10 09:39:53

	use #ifdef to run the proper ifconfig commands on FreeBSD and Linux

Affected files ...

.. //depot/projects/soc2007/mharvan-mtund/mtund.src/tunneld.c#7 edit

Differences ...

==== //depot/projects/soc2007/mharvan-mtund/mtund.src/tunneld.c#7 (text+ko) ====

@@ -418,13 +418,19 @@
 
     /* setup the tun interface */
     if (server) {
-	system("ifconfig tun0 mtu 1400 192.168.0.1 192.168.0.2");
+	#ifdef __FreeBSD__
+	ssystem("ifconfig tun0 mtu 1400 192.168.0.1 192.168.0.2");
+	#endif
+	
     } else {
 	/* FeeBSD */
-	system("ifconfig tun0 mtu 1400 192.168.0.2 192.168.0.1");
+	#ifdef __FreeBSD__
+	ssystem("ifconfig tun0 mtu 1400 192.168.0.2 192.168.0.1");
+	#else
 	/* Linux */
-	//system("ifconfig tun0 mtu 1400 192.168.0.2");
-	//system("route add 192.168.0.1 tun0");
+	ssystem("ifconfig tun0 mtu 1400 192.168.0.2");
+	ssystem("route add 192.168.0.1 tun0");
+	#endif
     }
 
     signal(SIGHUP, sigcb);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707100940.l6A9el1D040230>