Commit bc6355f5 authored by Leigh Stoller's avatar Leigh Stoller

Quick change to previous revision; we do not want to block port 111 in

elabinelab experiments cause it messes up geni rack builds. Revisit this
later, but elabinelab is mostly a Utah thing, and we already block port
111 at the firewall.
parent 48f1bf55
......@@ -77,13 +77,14 @@ my $ARPING = "/usr/bin/arping";
my $VIFROUTING = ((-e "$ETCDIR/xenvifrouting") ? 1 : 0);
usage()
if (@ARGV < 5);
if (@ARGV < 6);
my $vmid = shift(@ARGV);
my $host_ip = shift(@ARGV);
my $vnode_id = shift(@ARGV);
my $vnode_ip = shift(@ARGV);
my $vnode_mac = shift(@ARGV);
my $elabinelab= shift(@ARGV);
# The caller (xmcreate) puts this into the environment.
my $vif = $ENV{'vif'};
......@@ -350,7 +351,7 @@ sub Online()
# these cases. Note the -I; these need to go at the beginning of
# the chain (and note that the rules are reversed cause of that).
#
if (isRoutable($vnode_ip)) {
if (isRoutable($vnode_ip) && !$elabinelab) {
push(@rules,
"-I $INCOMING_CHAIN ".
" -p udp --dport 111 -j DROP");
......@@ -515,7 +516,7 @@ sub Offline()
#
# Remove rpcbind port restrictions
#
if (isRoutable($vnode_ip)) {
if (isRoutable($vnode_ip) && !$elabinelab) {
push(@rules,
"-D $INCOMING_CHAIN -s $network/$cnet_mask -p tcp ".
" --dport 111 -j ACCEPT");
......
......@@ -334,7 +334,7 @@ sub subDHCP($$);
sub restartDHCP();
sub formatDHCP($$$);
sub fixupMac($);
sub createControlNetworkScript($$$);
sub createControlNetworkScript($$$$);
sub createExpNetworkScript($$$$$$$$);
sub createTunnelScript($$$$$);
sub createExpBridges($$$);
......@@ -1927,7 +1927,7 @@ sub vnodePreConfigControlNetwork($$$$$$$$$$$$)
'hip' => $gw,
'fqdn', => $longdomain,
'mac' => $fmac};
createControlNetworkScript($vmid, $stuff, $cscript);
createControlNetworkScript($vmid, $vnconfig, $stuff, $cscript);
#
# Set up the chains. We always create them, and if there is no
......@@ -4138,13 +4138,15 @@ sub fixupMac($)
#
# XXX can we get rid of this stub by using environment variables?
#
sub createControlNetworkScript($$$)
sub createControlNetworkScript($$$$)
{
my ($vmid,$data,$file) = @_;
my ($vmid,$vnconfig,$data,$file) = @_;
my $host_ip = $data->{'hip'};
my $name = $data->{'name'};
my $ip = $data->{'ip'};
my $mac = $data->{'mac'};
my $elabinelab = (exists($vnconfig->{'config'}->{'ELABINELAB'}) ?
$vnconfig->{'config'}->{'ELABINELAB'} : 0);
open(FILE, ">$file") or die $!;
print FILE "#!/bin/sh\n";
......@@ -4157,7 +4159,7 @@ sub createControlNetworkScript($$$)
print FILE "if [ -e \"$file.debug\" ]; then ".
"mv -f $file.debug $file.debug.0; fi\n";
print FILE "/etc/xen/scripts/emulab-cnet.pl ".
"$vmid $host_ip $name $ip $mac \$* >$file.debug 2>&1\n";
"$vmid $host_ip $name $ip $mac $elabinelab \$* >$file.debug 2>&1\n";
print FILE "exit \$?\n";
close(FILE);
chmod(0555, $file);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment