$ip_forward = 0;
// Look up the node
-$interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
+// backwards compatibility with the old 4.2 API
+global $__PLC_API_VERSION;
+if ( ! method_exists ($adm,"GetInterfaces"))
+ $__PLC_API_VERSION = 4.2;
+else
+ $__PLC_API_VERSION = 4.3;
+
+if ($__PLC_API_VERSION==4.2)
+ $interfaces = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
+else
+ $interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
+
if (!empty($interfaces)) {
$nodes = $adm->GetNodes(array($interfaces[0]['node_id']));
if (!empty($nodes)) {
$node = $nodes[0];
- $interfaces = $adm->GetInterfaces($node['interface_ids']);
+ if ($__PLC_API_VERSION==4.2)
+ $interfaces = $adm->GetInterfaces($node['nodenetwork_ids']);
+ else
+ $interfaces = $adm->GetInterfaces($node['interface_ids']);
+
foreach ($interfaces as $interface) {
// Nodes with proxy socket interfaces need to be able to forward
// between the fake proxy0 interface and the real interface.
# TCP window scaling and broken routers
net.ipv4.tcp_moderate_rcvbuf=0
net.ipv4.tcp_default_win_scale=0
-net.ipv4.tcp_window_scaling=0
+net.ipv4.tcp_window_scaling=1
# Mark only out of window RST segments as INVALID. This setting, among
# other things, allows data to be sent with SYN packets.
# Fixes dst cache overflow bug
net.ipv4.route.max_size=262144
+
+
+net.ipv4.tcp_congestion_control = cubic
+net.ipv4.tcp_moderate_rcvbuf = 0
+net.core.rmem_max = 131071
+net.core.wmem_max = 131071
+net.ipv4.tcp_rmem = 4096 87380 4194304
+net.ipv4.tcp_wmem = 4096 16384 4194304
+net.netfilter.nf_conntrack_icmp_timeout = 60
+