Merge into master from pull request #75:
group table management tests (https://github.com/floodlight/oftest/pull/75)
diff --git a/README b/README
index 669d74c..b5f810a 100644
--- a/README
+++ b/README
@@ -44,7 +44,7 @@
 
     Make sure your switch is running and trying to connect to a
     controller on the machine where you're running oft (normally port
-    6633).  See below regarding run_switch.py for a script that starts 
+    6653).  See below regarding run_switch.py for a script that starts 
     up a software switch on the test host.
 
     Currently, switches must be running version 1.0 of OpenFlow. 
@@ -82,7 +82,7 @@
     2.  Start the switch to test
         The switch must be running and actively attempting to 
         connect to a controller on the test host at the port number
-        used by oft (6633 by default, or specified as --port=<n> as
+        used by oft (6653 by default, or specified as --port=<n> as
         an argument to oft).
 
         If you're new to the test environment and want to check its 
diff --git a/oft b/oft
index a4aa5b4..8a7272b 100755
--- a/oft
+++ b/oft
@@ -65,7 +65,7 @@
 
     # Switch connection options
     "controller_host"    : "0.0.0.0",  # For passive bind
-    "controller_port"    : 6633,
+    "controller_port"    : 6653,
     "switch_ip"          : None,  # If not none, actively connect to switch
     "platform"           : "eth",
     "platform_args"      : None,
@@ -104,7 +104,7 @@
 OFTest is a framework and set of tests for validating OpenFlow switches.
 
 The default configuration assumes that an OpenFlow 1.0 switch is attempting to
-connect to a controller on the machine running OFTest, port 6633. Additionally,
+connect to a controller on the machine running OFTest, port 6653. Additionally,
 the interfaces veth1, veth3, veth5, and veth7 should be connected to the switch's
 dataplane.
 
diff --git a/run_switch.py b/run_switch.py
index d5187b1..fb83bb7 100755
--- a/run_switch.py
+++ b/run_switch.py
@@ -11,7 +11,7 @@
 parser = OptionParser(version="%prog 0.1")
 parser.set_defaults(port_count=4)
 parser.set_defaults(of_dir="../openflow")
-parser.set_defaults(port=6633)
+parser.set_defaults(port=6653)
 parser.add_option("-n", "--port_count", type="int",
                   help="Number of veth pairs to create")
 parser.add_option("-o", "--of_dir", help="OpenFlow root directory for host")
diff --git a/src/python/oftest/controller.py b/src/python/oftest/controller.py
index b23eefa..3bfbcb3 100644
--- a/src/python/oftest/controller.py
+++ b/src/python/oftest/controller.py
@@ -94,7 +94,7 @@
     @var dbg_state Debug indication of state
     """
 
-    def __init__(self, switch=None, host='127.0.0.1', port=6633, max_pkts=1024):
+    def __init__(self, switch=None, host='127.0.0.1', port=6653, max_pkts=1024):
         Thread.__init__(self)
         # Socket related
         self.rcv_size = RCV_SIZE_DEFAULT
@@ -103,6 +103,7 @@
         self.switch_addr = None
         self.connect_cv = Condition()
         self.message_cv = Condition()
+        self.tx_lock = Lock()
 
         # Used to wake up the event loop from another thread
         self.waker = ofutils.EventDescriptor()
@@ -693,8 +694,10 @@
                           msg_len,
                           msg_version,
                           msg_xid)
-        if self.switch_socket.sendall(outpkt) is not None:
-            raise AssertionError("failed to send message to switch")
+
+        with self.tx_lock:
+            if self.switch_socket.sendall(outpkt) is not None:
+                raise AssertionError("failed to send message to switch")
 
         return 0 # for backwards compatibility
 
diff --git a/tools/ovs-ctl/ovs-ctl.py b/tools/ovs-ctl/ovs-ctl.py
index 14bcbfb..9701669 100755
--- a/tools/ovs-ctl/ovs-ctl.py
+++ b/tools/ovs-ctl/ovs-ctl.py
@@ -169,7 +169,7 @@
                      default="127.0.0.1")
 
 gParser.add_argument("--cport", type=int, help="Controller Port", 
-                     default=6633)
+                     default=6653)
 gParser.add_argument("--dpid", help="DPID")
 
 gParser.add_argument("--max_backoff", help="VSwitchD max backoff value",