Project

General

Profile

« Previous | Next » 

Revision 9cca1a4f

Added by Ermal LUÇI over 11 years ago

Ticket #3484 Correct the case for GRE tunnels as well since they behave the same. GRE seems to need the prefixlen 128 specified all the time so do it explicitly to be on safe side

View differences:

etc/inc/gwlb.inc
553 553
				$ctype = strtoupper($ifcfg['ipaddrv6']);
554 554
				break;
555 555
			default:
556
				$tunnelif = substr($ifname['if'], 0, 3);
556 557
				if (substr($ifcfg['if'], 0, 4) ==  "ovpn")
557 558
					$ctype = "VPNv6";
558
				else if (substr($ifcfg['if'], 0, 3) ==  "gif")
559
				else if ($tunnelif == "gif" || $tunnelif == "gre")
559 560
					$ctype = "TUNNELv6";
560 561
				break;
561 562
		}
etc/inc/interfaces.inc
859 859
	/* Do not change the order here for more see gre(4) NOTES section. */
860 860
	mwexec("/sbin/ifconfig {$greif} tunnel {$realifip} " . escapeshellarg($gre['remote-addr']));
861 861
	if((is_ipaddrv6($gre['tunnel-local-addr'])) || (is_ipaddrv6($gre['tunnel-remote-addr']))) {
862
		mwexec("/sbin/ifconfig {$greif} inet6 " . escapeshellarg($gre['tunnel-local-addr']) . " " . escapeshellarg($gre['tunnel-remote-addr']) . " prefixlen /" . escapeshellarg($gre['tunnel-remote-net']));
862
		/* XXX: The prefixlen argument for tunnels of ipv6 is useless since it needs to be 128 as enforced by kernel */
863
		//mwexec("/sbin/ifconfig {$greif} inet6 " . escapeshellarg($gre['tunnel-local-addr']) . " " . escapeshellarg($gre['tunnel-remote-addr']) . " prefixlen /" . escapeshellarg($gre['tunnel-remote-net']));
864
		mwexec("/sbin/ifconfig {$greif} inet6 " . escapeshellarg($gre['tunnel-local-addr']) . " " . escapeshellarg($gre['tunnel-remote-addr']) . " prefixlen 128");
863 865
	} else {
864 866
		mwexec("/sbin/ifconfig {$greif} " . escapeshellarg($gre['tunnel-local-addr']) . " " . escapeshellarg($gre['tunnel-remote-addr']) . " netmask " . gen_subnet_mask($gre['tunnel-remote-net']));
865 867
	}
......
953 955
	if((is_ipaddrv6($gif['tunnel-local-addr'])) || (is_ipaddrv6($gif['tunnel-remote-addr']))) {
954 956
		/* XXX: The prefixlen argument for tunnels of ipv6 is useless since it needs to be 128 as enforced by kernel */
955 957
		//mwexec("/sbin/ifconfig {$gifif} inet6 " . escapeshellarg($gif['tunnel-local-addr']) . " " . escapeshellarg($gif['tunnel-remote-addr']) . " prefixlen /" . escapeshellarg($gif['tunnel-remote-net']));
956
		mwexec("/sbin/ifconfig {$gifif} inet6 " . escapeshellarg($gif['tunnel-local-addr']) . " " . escapeshellarg($gif['tunnel-remote-addr']));
958
		mwexec("/sbin/ifconfig {$gifif} inet6 " . escapeshellarg($gif['tunnel-local-addr']) . " " . escapeshellarg($gif['tunnel-remote-addr']) . " prefixlen 128");
957 959
	} else {
958 960
		mwexec("/sbin/ifconfig {$gifif} " . escapeshellarg($gif['tunnel-local-addr']) . " " . escapeshellarg($gif['tunnel-remote-addr']) . " netmask " . gen_subnet_mask($gif['tunnel-remote-net']));
959 961
	}
......
4641 4643
			default:
4642 4644
				if (substr($ifname['if'], 0, 4) ==  "ovpn")
4643 4645
					return true;
4644
				if (substr($ifname['if'], 0, 3) ==  "gif")
4646
				$tunnelif = substr($ifname['if'], 0, 3);
4647
				if ($tunnelif == "gif" || $tunnelif == "gre")
4645 4648
					return true;
4646 4649
				if (!empty($ifname['gatewayv6']))
4647 4650
					return true;

Also available in: Unified diff