100 Commits
Author SHA1 Message Date
Ben Pfaff 662cf794d6 Update prerequisite Autoconf version to 2.60 (from 2.59).
We use the MKDIR_P variable that only Autoconf 2.60 and
later supports, but we were only requiring Autoconf 2.59
or later.  This fixes the problem.

Also, we were not explicitly invoking AC_PROG_MKDIR_P from
configure.ac, even though we were using $(MKDIR_P).  Some
other macro must have been internally invoking
AC_PROG_MKDIR_P, but it's not good to depend on that, so
this commit adds an explicit call to it.
2008-12-02 08:28:51 -08:00
Ben Pfaff 33f163a76e Add missing "%s" to VLOG_WARN_RL call.
Thanks to Justin for pointing out the problem.
2008-12-01 21:26:57 -08:00
Ben Pfaff 72ce961ebb Add DATAPATH_ID to switch packaging, to enable persistent DPIDs. 2008-11-26 22:26:42 -08:00
Ben Pfaff e21567dc0d Allow the datapath ID to be configured by changing the ofX MAC address.
Previously, you could change the MAC address but that had no effect on
the datapath ID, so that there was no way to change the datapath ID at all.
2008-11-26 22:26:42 -08:00
Ben Pfaff ca2e44b48d Simplify code in stream_recv().
There is no need to test whether retval is nonzero at this point in the
code: we already know that it is negative from the two previous "if"
branches.
2008-11-26 22:25:39 -08:00
Ben Pfaff 12333d6650 Make dpif_close() accept a null pointer.
It's customary for destructor functions to accept and ignore null pointers.

This commit does not fix any known bug.
2008-11-26 22:25:39 -08:00
Ben Pfaff 58b3bc45e4 rconn_destroy() should close monitoring connections, to avoid a leak.
Our current code base never closes an rconn that has a monitoring
connection, so this does not fix any larger problem.
2008-11-26 22:25:39 -08:00
Ben Pfaff 0ae1bf3ac4 Free txbuf, rxbuf in vconn-ssl and vconn-stream destructors.
This bug was causing secchan to leak a little bit of memory on almost every
connection close.  This is most visible when openflow-monitor is running,
because openflow-monitor connects to secchan once per second.
2008-11-26 22:25:39 -08:00
Ben Pfaff 14439fa80c Maintain separate async and sync connections to nl:0 in secchan.
When a network link is flooded with traffic, secchan's OpenFlow socket
queue becomes congested with traffic.  This leaves no room for replies
to OpenFlow requests relayed to that socket by secchan.

This commit modifies secchan to use separate sockets for asynchronous
traffic and for OpenFlow requests/replies, which should avoid the problem.
2008-11-21 13:05:37 -08:00
Ben Pfaff c3a7107e9e Dynamically allocate switch status categories.
I got tired of increasing the statically allocated number of categories
whenever we exceeded it, so this will make things simpler.
2008-11-21 12:39:24 -08:00
Ben Pfaff 92500deb63 Get rid of unused parameter to rate_limit_start(). 2008-11-21 12:23:01 -08:00
Ben Pfaff bd9bd56036 Don't rate-limit packet_ins from flows that the controller set up. 2008-11-21 10:48:00 -08:00
Ben Pfaff be4da39131 Prevent accidentally passing an integer value to IP_ARGS. 2008-11-20 10:10:59 -08:00
Ben Pfaff cd120a03be Fix printing of IP addresses in ofp_print_action().
IP_ARGS takes a pointer, not a raw IP address.

Thanks to kk yap for reporting the problem.
2008-11-20 10:07:22 -08:00
Ben Pfaff dd373c4f79 Use "%zu" to print size_t, not "%"PRIu16. 2008-11-20 09:53:27 -08:00
Ben Pfaff 304ff22391 Copy skbs when we save them. 2008-11-13 12:50:04 -08:00
Ben Pfaff 61c2760e8f Simplify code for constructing skb in recv_packet_out(). 2008-11-13 12:50:03 -08:00
Ben Pfaff ad27c8ac82 Fix double-free: NF_HOOK sometimes frees the sk_buff passed in.
NF_HOOK is supposed to *always* consume the sk_buff passed in, either
internally or through the okfn argument.  We assumed that it never
consumed its sk_buff, which was OK in the case where it called okfn,
since our okfn (snat_pre_route_finish) never freed its sk_buff, but
not when one of the netfilter hooks dropped or stole the packet, because
then we'd assume that it still existed and free it a second time.

The other users of NF_HOOK in this file, in snat_skb() and
snat_skb_finish(), do not need to be fixed because they always pass a
copy of their sk_buff argument to NF_HOOK and expect it to be freed.
2008-11-13 12:45:38 -08:00
Ben Pfaff 2d82ee4e58 No need to test argument of kfree_skb() for non-null. 2008-11-13 12:45:38 -08:00
Ben Pfaff fba83e4033 Never free an skb that has been passed to genlmsg_reply().
genlmsg_reply() always consumes its argument, not just in the success case.
2008-11-13 12:45:38 -08:00
Ben Pfaff f1439fb895 Pull arp header before grabbing the pointer to it. 2008-11-13 12:45:38 -08:00
Ben Pfaff 7d5bd14ebd Pull data into headers properly, and checksum ICMP replies correctly. 2008-11-13 12:45:38 -08:00
Ben Pfaff b4181aef87 Reset mac header in flow_extract(), because it might initially be null.
__alloc_skb() sets the mac header to null, and not all call chains
reset it.
2008-11-13 12:44:04 -08:00
Ben Pfaff 8c1c06ba95 Use skb_copy_bits() to copy data that might not be pulled into headers. 2008-11-13 12:44:04 -08:00
Ben Pfaff e4f77b2543 Verify in fwd_port_input() that 'skb' has no destructor. 2008-11-13 12:44:04 -08:00
Ben Pfaff fd6c80d47c Verify in execute_actions() that 'skb' is not shared. 2008-11-13 12:44:04 -08:00
Ben Pfaff 4a5396937e Fix datapath make_writable() function.
- We weren't necessarily pulling enough into the headers in the non-shared
  case, since the IP header by itself can be longer than 40 bytes.

- The skb is guaranteed not to have a destructor at this point.
2008-11-13 12:44:04 -08:00
Ben Pfaff 182138487f Make datapath's flow_extract() properly pull data into the headers.
Otherwise we might be reading headers that aren't really there.
2008-11-13 12:44:04 -08:00
Ben Pfaff 9171f24160 Add comment. 2008-11-13 12:44:04 -08:00
Ben Pfaff 42841a1a87 Don't oops in dp_output_control() for skbs with null ->dev.
This shouldn't ordinarily happen, since normal packets are received from
a real device, but some packets can be spontaneously generated within
the switch and thus have null ->dev.  (Possibly that is itself a bug
that we should track down; not sure.)
2008-11-13 12:44:04 -08:00
Ben Pfaff ae0af9b03d Verify in fwd_port_input() that we are not passed packets that are shared. 2008-11-13 12:44:04 -08:00
Ben Pfaff cdbc9a4a81 When a packet arrives via bridging, clone it if it is shared.
Otherwise we will mangle the packet for anyone who came before us
(e.g. tcpdump via AF_PACKET).
2008-11-13 12:44:04 -08:00
Ben Pfaff dac4f19861 Make sure that do_port_input() always puts a MAC header on packets.
Prompted by persistent oopses on packets received by e1000e, in which
skb_mac_header() for the packet always returned null.
2008-11-13 12:44:04 -08:00
Ben Pfaff 288d2171a6 In handle_arp_snat() and snat_pre_route() pull enough payload into the headers.
There is no guarantee that the device put any data at all into the header.
The e1000 device, for example, appears to not put any data into the header
when the packet is longer than its configured copybreak value, which is
256 bytes by default.  So we need to do it ourselves.
2008-11-13 12:44:04 -08:00
Ben Pfaff 0b8ccdf977 In update_mapping(), update m->hw_addr unconditionally.
There is no benefit to comparing it first, since we already know that that
cache line will be dirtied by the assignment to m->used.
2008-11-13 12:44:04 -08:00
Ben Pfaff 9dc896a69c Factor common SNAT code into new functions. 2008-11-13 12:44:04 -08:00
Ben Pfaff 490098aa4d Make snat_skb() skb argument const.
After all, it doesn't modify it.
2008-11-13 12:38:45 -08:00
Ben Pfaff aad1311495 Don't process packets in NAT that aren't destined for us.
This time for sure!
2008-11-13 12:38:45 -08:00
Ben Pfaff c8833cd642 Orphan and clone packets transmitted on dp_dev (proper fix for bug #478).
We need to orphan packets transmitted on dp_dev so that any socket that
the packets came from is no longer charged for them.  If we don't do
this, then the sk_buff will be destructed eventually, but it is
harder to predict when.

We need to clone packets because we are sticking them on
&dp_dev->xmit_queue, which is done by modifying the sk_buff, which we
can only do if it is not shared.
2008-11-13 12:38:44 -08:00
Ben Pfaff 28bbd8e364 Always compile openflow modules with debug information. 2008-11-13 12:38:44 -08:00
Ben Pfaff 2371dd3d67 Check kmalloc() return value. 2008-11-11 12:31:26 -08:00
Ben Pfaff 3a5cc3f9e7 Fix typo: = should be == 2008-11-11 12:31:26 -08:00
Ben Pfaff f7e9953b8d Stopgap fix for bug #478, where kernel panics on SNAT to input port. 2008-11-10 17:45:23 -08:00
Ben Pfaff 8d19e7aebf Fix " is running" and " is not running" messages from openflow-switch init.d
With the "secchan" name in there it makes a lot more sense!
2008-11-10 13:56:11 -08:00
Ben Pfaff d1a5df56c0 Make openflow-switch depend on dmidecode, procps instead of acpi-support.
acpi-support pulls in a lot of stuff we really don't want or need, such
as various X11-related stuff.  Being more specific reduces our
dependencies.
2008-11-10 10:43:18 -08:00
Ben Pfaff 81c64138e7 Add build number to kernel modules built via Debian packaging. 2008-11-10 10:10:02 -08:00
Ben Pfaff 9c13939e18 Add --with-build-number configure argument and support in debian/rules. 2008-11-07 09:22:05 -08:00
Ben Pfaff 67e15579a7 New package openflow-dbg for debugging symbols for the rest of OpenFlow. 2008-11-06 10:25:08 -08:00
Ben Pfaff 40840f6a54 Fix typo in code to set core limit that broke the openflow-switch init script. 2008-11-06 10:07:41 -08:00
Ben Pfaff 91bdbe0c01 Add openflow-switch settings for the limit on core files. 2008-11-05 15:48:59 -08:00
Ben Pfaff 08ce9884b9 Add new Debian package "corekeeper" to centralize and reap core files. 2008-11-05 15:48:59 -08:00
Ben Pfaff 623db5c2ca Ignore openflow-monitor and openflow-wdt build directories. 2008-11-05 14:07:15 -08:00
Ben Pfaff 0e061502c9 When a new OpenFlow kernel module package is installed, restart the switch.
This helps to ensure that the secchan and the kernel module are exactly
the same version.
2008-11-05 10:22:41 -08:00
Ben Pfaff 8798af6e81 Unload kernel module when stopping switch, in Debian init scripts.
This way, we have a better chance at ensuring that the secchan and the
kernel module are exactly the same version.
2008-11-05 10:20:04 -08:00
Ben Pfaff a4d3f61b0a Add required "subst" script to EXTRA_DIST. 2008-11-05 10:08:47 -08:00
Ben Pfaff 9953943475 Move "update" remote command from base secchan into Debian packaging.
The update command only works with Debian anyway, so there's no point
in installing it elsewhere.
2008-11-05 10:04:31 -08:00
Ben Pfaff 45fd544a07 New switch remote command for setting configuration parameters. 2008-11-05 10:03:49 -08:00
Ben Pfaff ce2ff80d67 Make ofp-switch-setup preserve config variables that it does not set itself.
Before, it would delete them.  This probably kept ofp-switch-setup from
working at all given the changes in openflow-switch.default.  Now, it
should do better (but it has not been tested).
2008-11-05 10:03:07 -08:00
Ben Pfaff f2c6ec1f77 Add "execute" to dpctl usage message. 2008-11-04 16:45:21 -08:00
Ben Pfaff 7f33221139 Fix openflow-switch log rotation.
The vlogconf command syntax was wrong.  The pidfile also didn't contain
the right pid (which was fixed in the previous commit).
2008-11-04 16:14:00 -08:00
Ben Pfaff fe6988251d Create vlog sockets after daemonizing, so that pidfiles can be used.
Otherwise, pidfiles contain the process ID of the process that forked
and exited, so that "vlogconf --target <program.pid>" will fail.
2008-11-04 16:14:00 -08:00
Ben Pfaff 70ebdff4f8 Use "set -e" command instead of "#! /bin/sh -e" magic.
Otherwise, running the script through an explicit shell invocation, such
as "sh -x <script>" for debugging, will fail to set -e and therefore the
script's behavior will change.
2008-11-04 14:26:38 -08:00
Ben Pfaff 67d31bee42 Add missing dependency on openssl to openflow-pki.
Otherwise the ofp-pki script cannot execute it.
2008-11-04 14:24:18 -08:00
Ben Pfaff af26d107aa Add build number to datapath version and --version output from programs. 2008-11-04 14:10:00 -08:00
Ben Pfaff a660f93e18 In reboot script, send SIGUSR1 to ofp-switchmon to make it display "Rebooting". 2008-11-04 09:34:26 -08:00
Ben Pfaff 0202d2c761 Call VLOG_WARN before send_child_message(), to get correct errno value.
Otherwise we end up with nonsense like "failed to stat...: Success" in
the log.
2008-11-03 17:04:22 -08:00
Ben Pfaff 72c1cf8277 Fix location of installed commands. 2008-11-03 17:03:22 -08:00
Ben Pfaff 3eeebb50aa Pass --enable-snat to configure for datapath module also. 2008-11-03 16:26:51 -08:00
Ben Pfaff 8872d86328 Make COMMANDS option in openflow-switch defaults file work.
The setting was being accidentally ignored, so commands like "reboot", etc.
would not work at all.
2008-11-03 10:45:38 -08:00
Ben Pfaff f314a833ae Add libncurses5-dev as build dependency for openflow. 2008-10-31 14:14:22 -07:00
Ben Pfaff b5a4509474 Implement log rotation in openflow-switch. 2008-10-31 14:09:53 -07:00
Ben Pfaff 02074909ec Make secchan log to file by default. 2008-10-31 14:09:53 -07:00
Ben Pfaff 77d9bc9026 Add /var/log/openflow directory to openflow-common.
This ensures that every system with OpenFlow packages will have this
directory available for logging.
2008-10-31 14:09:53 -07:00
Ben Pfaff ca7265a956 Send openssl output to logfile on "ofp-pki self-sign" also. 2008-10-31 14:09:53 -07:00
Ben Pfaff bceb2c3912 Don't make ofp-pki --log option relative to log directory.
That behavior may have made sense, but it was too surprising.
2008-10-31 14:09:53 -07:00
Ben Pfaff 8dee5029d8 Put ofp-pki logfile in log directory instead of in pki directory.
This should fix problems with trying to log on a machine that doesn't have
openflow-pki installed (because such machines didn't have the pki
directory).  Every machine needs the log directory.
2008-10-31 14:09:53 -07:00
Ben Pfaff 2e424547ff Fix openflow-datapath-source bugs added in "Simplify debian/rules..." commit. 2008-10-31 14:09:53 -07:00
Ben Pfaff aaab8d4cf0 Add settings for switch netmask and gateway for in-band mode to init script.
Previously we supported setting a switch IP address but not those
parameters, which are obviously required also.
2008-10-31 14:09:53 -07:00
Ben Pfaff 4f76bd3121 Add extension hooks to debian/rules. 2008-10-31 14:09:53 -07:00
Ben Pfaff 480d4a9a7b Move ofp-switch-config into new package openflow-switch-config.
This reduces the openflow-switch package's number of dependencies, making
it easier to install.
2008-10-31 14:09:53 -07:00
Ben Pfaff a662402bac Improve the error message when vconn gets an unexpected version. 2008-10-31 14:09:53 -07:00
Ben Pfaff 6fc8bc9f20 In openflow-switch init script, correct secchan option name. 2008-10-31 14:09:53 -07:00
Ben Pfaff 77171d02d6 In openflow-switch init script, do not re-load openflow_mod if already loaded. 2008-10-31 14:09:53 -07:00
Ben Pfaff 3e2e9b420b Ignore openflow-pki-server directory. 2008-10-31 14:09:53 -07:00
Ben Pfaff b1822e1ff8 Add missing header file to datapath/Modules.mk.
This fixes the generated Debian openflow-datapath-source package.
2008-10-31 14:09:53 -07:00
Ben Pfaff 949a799037 Fix vconn_transact() bug introduced in commit 65ac65a6d2,
"Improve the command interface so that it sends back acks or errors."

Oops.  That was dumb.

Thanks to Justin for reporting the problem.
2008-10-30 10:38:03 -07:00
Ben Pfaff 42992b0468 Simplify debian/rules by adding new openflow-datapath-source.install file. 2008-10-30 10:24:36 -07:00
Ben Pfaff 686cd5c3d8 Break HTTP parts of openflow-pki package into new openflow-pki-server package. 2008-10-30 10:24:02 -07:00
Ben Pfaff 60bcda0381 Fix support for out-of-band control in Debian switch init script.
Not tested.
2008-10-29 16:19:43 -07:00
Ben Pfaff 6b617bac12 Move exported headers to include/openflow, private headers to lib/.
This makes it easier to install the headers, or to use them directly from
another software package with -I$(openflow)/include, without invading
the top-level include file namespace.
2008-10-29 15:15:45 -07:00
Ben Pfaff b4518e78a0 New function netdev_set_etheraddr(). 2008-10-29 13:46:54 -07:00
Ben Pfaff 69133a6b68 Fix parsing of logging options in OpenFlow controller.
Oops.
2008-10-29 13:46:34 -07:00
Ben Pfaff a657b91410 Add "self-sign" command to ofp-pki. 2008-10-29 11:27:57 -07:00
Ben Pfaff 1e777f3381 Fix typo in manpage. 2008-10-29 10:30:36 -07:00
Ben Pfaff 65ac65a6d2 Improve the command interface so that it sends back acks or errors. 2008-10-28 12:46:18 -07:00
Ben Pfaff 4fee3e8e11 Delete ununsed file Make.vars. 2008-10-27 16:37:00 -07:00
Ben Pfaff bf3e778844 Add a warning when secchan is invoked with a controller specified as the datapath. 2008-10-27 15:13:11 -07:00
Ben Pfaff b2aec952c7 Add Nicira extension for remote command execution. 2008-10-27 12:58:27 -07:00
Ben Pfaff de5caa4906 Change the secchan "hook" mechanism to be easier to add new callbacks. 2008-10-27 12:58:27 -07:00
Ben Pfaff 9abe7b6f19 Fix typo in default switch config. 2008-10-27 12:58:27 -07:00