Fixed creation of GIF tunnel with an outer IPv6 remote address (remote-addr)

This commit is contained in:
noctarius 2018-04-10 17:51:39 +02:00 committed by Franco Fichtner
parent 6fb26f989b
commit a68e1deeb3

View File

@ -849,7 +849,11 @@ function interface_gif_configure(&$gif, $gifkey = "")
}
/* Do not change the order here for more see gif(4) NOTES section. */
mwexec("/sbin/ifconfig {$gifif} tunnel {$realifip} " . escapeshellarg($gif['remote-addr']));
if (is_ipaddrv6($gif['remote-addr'])) {
mwexec("/sbin/ifconfig {$gifif} inet6 tunnel {$realifip} " . escapeshellarg($gif['remote-addr']));
} else {
mwexec("/sbin/ifconfig {$gifif} tunnel {$realifip} " . escapeshellarg($gif['remote-addr']));
}
if ((is_ipaddrv6($gif['tunnel-local-addr'])) || (is_ipaddrv6($gif['tunnel-remote-addr']))) {
/* XXX: The prefixlen argument for tunnels of ipv6 is useless since it needs to be 128 as enforced by kernel */
//mwexec("/sbin/ifconfig {$gifif} inet6 " . escapeshellarg($gif['tunnel-local-addr']) . " " . escapeshellarg($gif['tunnel-remote-addr']) . " prefixlen /" . escapeshellarg($gif['tunnel-remote-net']));