Unable to build openconnect-3.16 in Solaris 10 (x86)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2012-04-19 at 11:43 +0800, chua wei yang wrote:
> I think all is good now, my original problem has been resolved.

I think you'll still need something like this, to make things actually
work on Solaris 10. I'm hoping the experts will provide a proper fix and
a coherent explanation.

diff --git a/tun.c b/tun.c
index b3a7fb2..7d47be9 100644
--- a/tun.c
+++ b/tun.c
@@ -360,10 +360,13 @@ int script_config_tun(struct openconnect_info *vpninfo, const char *reason)
 }
 
 #ifdef __sun__
+#include <sys/utsname.h>
+
 static int link_proto(int unit_nr, const char *devname, uint64_t flags)
 {
 	int ip_fd, mux_id, tun2_fd;
 	struct lifreq ifr;
+	struct utsname un;
 
 	tun2_fd = open("/dev/tun", O_RDWR);
 	if (tun2_fd < 0) {
@@ -393,7 +396,11 @@ static int link_proto(int unit_nr, const char *devname, uint64_t flags)
 		close(tun2_fd);
 		return -1;
 	}
-	if (ioctl(ip_fd, I_PUSH, "arp") < 0) {
+
+	/* This doesn't work on Solaris 10. And presumably before */
+	uname (&un);
+	if (atof(un.release) >= 5.11 &&
+	    ioctl(ip_fd, I_PUSH, "arp") < 0) {
 		perror(_("Can't push ARP"));
 		close(tun2_fd);
 		close(ip_fd);

> 
-- 
dwmw2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5818 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openconnect-devel/attachments/20120419/c0b06b05/attachment-0001.bin>


[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux