Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Sep 2012 20:51:20 GMT
From:      Brooks Davis <brooks@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 217275 for review
Message-ID:  <201209112051.q8BKpKf9072307@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@217275?ac=10

Change 217275 by brooks@brooks_zenith on 2012/09/11 20:50:29

	Apply patch-bsd-netdev.diff from the net/openvswitch port.

Affected files ...

.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/INSTALL#1 add
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/INSTALL.KVM#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/INSTALL.Libvirt#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/INSTALL.Linux#2 delete
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/INSTALL.RHEL#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/INSTALL.SSL#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/INSTALL.XenServer#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/INSTALL.bridge#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/INSTALL.userspace#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/Makefile.am#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/NOTICE#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/README#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/acinclude.m4#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/configure.ac#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/debian/copyright.in.rej#1 add
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/automake.mk#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/netdev-bsd.c#1 add
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/netdev-provider.h#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/netdev.c#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/route-table-bsd.c#1 add
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/route-table.h#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/rtbsd.c#1 add
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/rtbsd.h#1 add
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/socket-util.c#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/vconn.c#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/vconn.h#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/vlandev.c#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/ofproto/ofproto-dpif-sflow.c#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/tests/ofproto-dpif.at#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/tests/ovs-vsctl.at#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/tests/ovsdb-server.at#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/tests/ovsdb-tool.at#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/tests/test-vconn.c#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/utilities/ovs-pki.in#2 edit
.. //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/xenserver/opt_xensource_libexec_interface-reconfigure#2 edit

Differences ...

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/INSTALL.KVM#2 (text+ko) ====

@@ -3,12 +3,12 @@
 
 This document describes how to use Open vSwitch with the Kernel-based
 Virtual Machine (KVM). This document assumes that you have read and
-followed INSTALL.Linux to get Open vSwitch setup on your Linux system.
+followed INSTALL to get Open vSwitch setup on your Linux system.
 
 Setup
 -----
 
-First, follow the setup instructions in INSTALL.Linux to get a working
+First, follow the setup instructions in INSTALL to get a working
 Open vSwitch installation.
 
 KVM uses tunctl to handle various bridging modes, which you can 
@@ -43,7 +43,7 @@
 ovs-vsctl del-port ${switch} $1
 --------------------------------------------------------------------
 
-At the end of INSTALL.Linux, it describes basic usage of creating 
+At the end of INSTALL, it describes basic usage of creating
 bridges and ports. If you haven't already, create a bridge named
 br0 with the following command:
 

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/INSTALL.Libvirt#2 (text+ko) ====

@@ -4,7 +4,7 @@
 This document describes how to use Open vSwitch with Libvirt 0.9.11 or
 later. The Open vSwitch support in Libvirt 0.9.11 eliminates the need to
 use OVS Linux Bridge compatibility layer (brcompatd) and interface up/down
-scripts. This document assumes that you followed INSTALL.Linux or installed
+scripts. This document assumes that you followed INSTALL or installed
 Open vSwitch from distribution packaging such as a .deb or .rpm. The Open
 vSwitch support is included by default in Libvirt 0.9.11. Consult
 www.libvirt.org for instructions on how to build the latest Libvirt, if your

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/INSTALL.RHEL#2 (text+ko) ====

@@ -3,7 +3,7 @@
 
 This document describes how to build and install Open vSwitch on a Red
 Hat Enterprise Linux (RHEL) host.  If you want to install Open vSwitch
-on a generic Linux host, see INSTALL.Linux instead.
+on a generic Linux host, see INSTALL instead.
 
 We have tested these instructions with RHEL 5.6 and RHEL 6.0.
 

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/INSTALL.SSL#2 (text+ko) ====

@@ -7,8 +7,8 @@
 the OpenFlow connections, increasing network security.
 
 This file explains how to configure an Open vSwitch to connect to an
-OpenFlow controller over SSL.  Refer to INSTALL.Linux for instructions
-on building Open vSwitch with SSL support.
+OpenFlow controller over SSL.  Refer to INSTALL for instructions on
+building Open vSwitch with SSL support.
 
 Open vSwitch uses TLS version 1.0 or later (TLSv1), as specified by
 RFC 2246, which is very similar to SSL version 3.0.  TLSv1 was

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/INSTALL.XenServer#2 (text+ko) ====

@@ -3,7 +3,7 @@
 
 This document describes how to build and install Open vSwitch on a
 Citrix XenServer host.  If you want to install Open vSwitch on a
-generic Linux host, see INSTALL.Linux instead.
+generic Linux or BSD host, see INSTALL instead.
 
 These instructions have been tested with XenServer 5.6 FP1.
 
@@ -19,8 +19,8 @@
    ./configure; make dist" in the Git tree.  You cannot run this in
    the DDK VM, because it lacks tools that are necessary to bootstrap
    the Open vSwitch distribution.  Instead, you must run this on a
-   machine that has the tools listed in INSTALL.Linux as prerequisites
-   for building from a Git tree.
+   machine that has the tools listed in INSTALL as prerequisites for
+   building from a Git tree.
 
 2. Copy the distribution tarball into /usr/src/redhat/SOURCES inside
    the DDK VM.

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/INSTALL.bridge#2 (text+ko) ====

@@ -25,7 +25,7 @@
 kernel bridge module.
 
 1. Build, install, and start up the Open vSwitch kernel modules and
-   userspace programs as described in INSTALL.Linux.
+   userspace programs as described in INSTALL.
 
    It is important to run "make install", because some Open vSwitch
    programs expect to find files in locations selected at installation

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/INSTALL.userspace#2 (text+ko) ====

@@ -17,7 +17,7 @@
 -----------------------
 
 The requirements and procedure for building, installing, and
-configuring Open vSwitch are the same as those given in INSTALL.Linux.
+configuring Open vSwitch are the same as those given in INSTALL.
 You may omit configuring, building, and installing the kernel module,
 and the related requirements.
 
@@ -31,6 +31,10 @@
 then create /dev/net (if necessary) with "mkdir /dev/net", then create
 /dev/net/tun with "mknod /dev/net/tun c 10 200".
 
+On FreeBSD, the userspace switch additionally requires the kernel
+tap(4) driver to be available, either built into the kernel or loaded
+as a module.
+
 Using the Userspace Datapath with ovs-vswitchd
 ----------------------------------------------
 

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/Makefile.am#2 (text+ko) ====

@@ -33,9 +33,9 @@
 EXTRA_DIST = \
 	CodingStyle \
 	DESIGN \
+	INSTALL \
 	INSTALL.KVM \
 	INSTALL.Libvirt \
-	INSTALL.Linux \
 	INSTALL.RHEL \
 	INSTALL.SSL \
 	INSTALL.XenServer \

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/NOTICE#2 (text+ko) ====

@@ -4,6 +4,9 @@
 Open vSwitch
 Copyright (c) 2007, 2008, 2009, 2010, 2011 Nicira, Inc.
 
+Open vSwitch BSD port
+Copyright (c) 2011 Gaetano Catalli
+
 Apache Portable Runtime
 Copyright 2008 The Apache Software Foundation.
 

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/README#2 (text+ko) ====

@@ -88,7 +88,7 @@
 What other documentation is available?
 --------------------------------------
 
-To install Open vSwitch on a regular Linux machine, read INSTALL.Linux.
+To install Open vSwitch on a regular Linux machine, read INSTALL.
 
 To use Open vSwitch as a drop-in replacement for the Linux bridge,
 read INSTALL.bridge.
@@ -99,7 +99,7 @@
 To build RPMs for installing Open vSwitch on a Red Hat Enterprise
 Linux host, read INSTALL.RHEL.
 
-To use Open vSwitch with KVM on Linux, read INSTALL.Linux, then
+To use Open vSwitch with KVM on Linux, read INSTALL, then
 INSTALL.KVM.
 
 To use Open vSwitch with Libvirt, read INSTALL.Libvirt.

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/acinclude.m4#2 (text+ko) ====

@@ -287,6 +287,17 @@
                 [Define to 1 if net/if_packet.h is available.])
    fi])
 
+dnl Checks for net/if_dl.h.
+AC_DEFUN([OVS_CHECK_IF_DL],
+  [AC_CHECK_HEADER([net/if_dl.h],
+                   [HAVE_IF_DL=yes],
+                   [HAVE_IF_DL=no])
+   AM_CONDITIONAL([HAVE_IF_DL], [test "$HAVE_IF_DL" = yes])
+   if test "$HAVE_IF_DL" = yes; then
+      AC_DEFINE([HAVE_IF_DL], [1],
+                [Define to 1 if net/if_dl.h is available.])
+   fi])
+
 dnl Checks for buggy strtok_r.
 dnl
 dnl Some versions of glibc 2.7 has a bug in strtok_r when compiling

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/configure.ac#2 (text+ko) ====

@@ -41,6 +41,7 @@
 AC_SEARCH_LIBS([pow], [m])
 AC_SEARCH_LIBS([clock_gettime], [rt])
 AC_SEARCH_LIBS([timer_create], [rt])
+AC_SEARCH_LIBS([pcap_open_live], [pcap])
 
 OVS_CHECK_COVERAGE
 OVS_CHECK_NDEBUG
@@ -52,6 +53,7 @@
 OVS_CHECK_OVSDBMONITOR
 OVS_CHECK_DOT
 OVS_CHECK_IF_PACKET
+OVS_CHECK_IF_DL
 OVS_CHECK_STRTOK_R
 AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec, struct stat.st_mtimensec],
   [], [], [[#include <sys/stat.h>]])

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/automake.mk#2 (text+ko) ====

@@ -230,6 +230,14 @@
 	lib/route-table.h
 endif
 
+if HAVE_IF_DL
+lib_libopenvswitch_a_SOURCES += \
+	lib/netdev-bsd.c \
+	lib/rtbsd.c \
+	lib/rtbsd.h \
+	lib/route-table-bsd.c
+endif
+
 if HAVE_OPENSSL
 lib_libopenvswitch_a_SOURCES += lib/stream-ssl.c
 nodist_lib_libopenvswitch_a_SOURCES += lib/dhparams.c

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/netdev-provider.h#2 (text+ko) ====

@@ -596,6 +596,9 @@
 extern const struct netdev_class netdev_linux_class;
 extern const struct netdev_class netdev_internal_class;
 extern const struct netdev_class netdev_tap_class;
+#ifdef __FreeBSD__
+extern const struct netdev_class netdev_bsd_class;
+#endif
 
 #ifdef  __cplusplus
 }

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/netdev.c#2 (text+ko) ====

@@ -80,6 +80,10 @@
         netdev_register_provider(&netdev_tap_class);
         netdev_vport_register();
 #endif
+#ifdef __FreeBSD__
+        netdev_register_provider(&netdev_tap_class);
+        netdev_register_provider(&netdev_bsd_class);
+#endif
     }
 }
 

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/route-table.h#2 (text+ko) ====

@@ -17,6 +17,7 @@
 #ifndef ROUTE_TABLE_H
 #define ROUTE_TABLE_H 1
 
+#include <sys/socket.h>
 #include <net/if.h>
 #include <stdbool.h>
 #include <stdint.h>

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/socket-util.c#2 (text+ko) ====

@@ -85,12 +85,14 @@
 static int
 set_dscp(int fd, uint8_t dscp)
 {
+    int val;
+
     if (dscp > 63) {
         return EINVAL;
     }
 
-    dscp = dscp << 2;
-    if (setsockopt(fd, IPPROTO_IP, IP_TOS, &dscp, sizeof dscp)) {
+    val = dscp << 2;
+    if (setsockopt(fd, IPPROTO_IP, IP_TOS, &val, sizeof val)) {
         return errno;
     }
 

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/vconn.c#2 (text+ko) ====

@@ -286,13 +286,7 @@
 
     error = vconn_open(name, min_version, &vconn, DSCP_DEFAULT);
     if (!error) {
-        while ((error = vconn_connect(vconn)) == EAGAIN) {
-            vconn_run(vconn);
-            vconn_run_wait(vconn);
-            vconn_connect_wait(vconn);
-            poll_block();
-        }
-        assert(error != EINPROGRESS);
+        error = vconn_connect_block(vconn);
     }
 
     if (error) {
@@ -621,6 +615,24 @@
     return retval;
 }
 
+/* Same as vconn_connect(), except that it waits until the connection on
+ * 'vconn' completes or fails.  Thus, it will never return EAGAIN. */
+int
+vconn_connect_block(struct vconn *vconn)
+{
+    int error;
+
+    while ((error = vconn_connect(vconn)) == EAGAIN) {
+        vconn_run(vconn);
+        vconn_run_wait(vconn);
+        vconn_connect_wait(vconn);
+        poll_block();
+    }
+    assert(error != EINPROGRESS);
+
+    return error;
+}
+
 /* Same as vconn_send, except that it waits until 'msg' can be transmitted. */
 int
 vconn_send_block(struct vconn *vconn, struct ofpbuf *msg)

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/vconn.h#2 (text+ko) ====

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, 2010, 2011 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -55,6 +55,7 @@
 void vconn_run_wait(struct vconn *);
 
 int vconn_open_block(const char *name, int min_version, struct vconn **);
+int vconn_connect_block(struct vconn *);
 int vconn_send_block(struct vconn *, struct ofpbuf *);
 int vconn_recv_block(struct vconn *, struct ofpbuf **);
 

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/lib/vlandev.c#2 (text+ko) ====

@@ -23,13 +23,13 @@
 #include <sys/stat.h>
 
 #include "hash.h"
-#include "rtnetlink-link.h"
 #include "shash.h"
 #include "vlog.h"
 
 VLOG_DEFINE_THIS_MODULE(vlandev);
 
 #ifdef __linux__
+#include "rtnetlink-link.h"
 #include <linux/if_vlan.h>
 #include <linux/sockios.h>
 #include "netdev-linux.h"

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/ofproto/ofproto-dpif-sflow.c#2 (text+ko) ====

@@ -18,6 +18,7 @@
 #include <config.h>
 #include "ofproto-dpif-sflow.h"
 #include <inttypes.h>
+#include <sys/socket.h>
 #include <net/if.h>
 #include <stdlib.h>
 #include "collectors.h"

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/tests/ofproto-dpif.at#2 (text+ko) ====

@@ -962,7 +962,7 @@
 
 AT_CHECK([[sed -e 's/, uptime [0-9]*//
 s/, now [0-9.]*//
-s/time \([0-9]*\)\.\.\.\1\b/time <moment>/
+s/time \([0-9]*\)\.\.\.\1$/time <moment>/
 s/time [0-9]*\.\.\.[0-9]*/time <range>/
 ' netflow.log]], [0],
   [header: v5, seq 0, engine 2,1

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/tests/ovs-vsctl.at#2 (text+ko) ====

@@ -769,7 +769,7 @@
 
 ])
 m4_define([VSCTL_CHECK_FIND],
-  [AT_CHECK([ovs-vsctl --bare --timeout=5 --no-wait -vreconnect:ANY:emer --db=unix:socket -- --columns=name find bridge '$1' | sort | xargs echo], [0], [$2
+  [AT_CHECK([echo `ovs-vsctl --bare --timeout=5 --no-wait -vreconnect:ANY:emer --db=unix:socket -- --columns=name find bridge '$1' | sort`], [0], [$2
 ])])
 
 # Arithmetic relational operators without keys.

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/tests/ovsdb-server.at#2 (text+ko) ====

@@ -322,8 +322,8 @@
 dnl order of the records is not predictable, but there should only be 4 lines
 dnl in it now.
 AT_CAPTURE_FILE([db])
-AT_CHECK([wc -l < db], [0], [4
-], [], [test ! -e pid || kill `cat pid`])
+AT_CHECK([test `wc -l < db` -eq 4], [0], [], [],
+  [test ! -e pid || kill `cat pid`])
 dnl And check that the dumped data is the same too:
 AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore],
   [test ! -e pid || kill `cat pid`])
@@ -348,8 +348,8 @@
   [0], [[[{"count":3}]
 ]], [ignore], [test ! -e pid || kill `cat pid`])
 dnl There should be 6 lines in the log now.
-AT_CHECK([wc -l < db], [0], [6
-], [], [test ! -e pid || kill `cat pid`])
+AT_CHECK([test `wc -l < db` -eq 6], [0], [], [],
+  [test ! -e pid || kill `cat pid`])
 dnl Then check that the dumped data is correct.
 AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore],
   [test ! -e pid || kill `cat pid`])

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/tests/ovsdb-tool.at#2 (text+ko) ====

@@ -121,8 +121,7 @@
 dnl order of the records is not predictable, but there should only be 4 lines
 dnl in it now.
 AT_CAPTURE_FILE([db])
-AT_CHECK([wc -l < db], [0], [4
-])
+AT_CHECK([test `wc -l < db` -eq 4])
 dnl And check that the dumped data is the same too:
 AT_CHECK([[ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]],
   [0], [stdout], [ignore])
@@ -185,8 +184,7 @@
 dnl order of the records is not predictable, but there should only be 4 lines
 dnl in it now.
 AT_CAPTURE_FILE([db])
-AT_CHECK([wc -l < db], [0], [4
-])
+AT_CHECK([test `wc -l < db` -eq 4])
 dnl And check that the dumped data is the same except for the removed column:
 AT_CHECK([[ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]],
   [0], [stdout], [ignore])
@@ -248,8 +246,7 @@
 dnl order of the records is not predictable, but there should only be 4 lines
 dnl in it now.
 AT_CAPTURE_FILE([db])
-AT_CHECK([wc -l < db], [0], [4
-])
+AT_CHECK([test `wc -l < db` -eq 4])
 dnl And check that the dumped data is the same except for the added column:
 AT_CHECK([[ovsdb-server --unixctl="`pwd`"/unixctl --remote=punix:socket --run "ovsdb-client dump unix:socket ordinals" db]],
   [0], [stdout], [ignore])

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/tests/test-vconn.c#2 (text+ko) ====

@@ -140,20 +140,26 @@
 test_refuse_connection(int argc OVS_UNUSED, char *argv[])
 {
     const char *type = argv[1];
-    int expected_error;
     struct fake_pvconn fpv;
     struct vconn *vconn;
+    int error;
 
-    expected_error = (!strcmp(type, "unix") ? EPIPE
-                      : !strcmp(type, "tcp") ? ECONNRESET
-                      : EPROTO);
-
     fpv_create(type, &fpv);
     CHECK_ERRNO(vconn_open(fpv.vconn_name, OFP10_VERSION, &vconn,
                            DSCP_DEFAULT), 0);
     fpv_close(&fpv);
     vconn_run(vconn);
-    CHECK_ERRNO(vconn_connect(vconn), expected_error);
+
+    error = vconn_connect_block(vconn);
+    if (!strcmp(type, "tcp")) {
+        if (error != ECONNRESET && error != EPIPE) {
+            ovs_fatal(0, "unexpected vconn_connect() return value %d (%s)",
+                      error, strerror(error));
+        }
+    } else {
+        CHECK_ERRNO(error, !strcmp(type, "unix") ? EPIPE : EPROTO);
+    }
+
     vconn_close(vconn);
     fpv_destroy(&fpv);
 }
@@ -194,6 +200,7 @@
     struct fake_pvconn fpv;
     struct vconn *vconn;
     struct stream *stream;
+    int error;
 
     fpv_create(type, &fpv);
     CHECK_ERRNO(vconn_open(fpv.vconn_name, OFP10_VERSION, &vconn,
@@ -223,7 +230,11 @@
        poll_block();
     }
     stream_close(stream);
-    CHECK_ERRNO(vconn_connect(vconn), ECONNRESET);
+    error = vconn_connect_block(vconn);
+    if (error != ECONNRESET && error != EPIPE) {
+        ovs_fatal(0, "unexpected vconn_connect() return value %d (%s)",
+                  error, strerror(error));
+    }
     vconn_close(vconn);
 }
 
@@ -313,7 +324,7 @@
        poll_block();
     }
     stream_close(stream);
-    CHECK_ERRNO(vconn_recv(vconn, &msg), EOF);
+    CHECK_ERRNO(vconn_recv_block(vconn, &msg), EOF);
     vconn_close(vconn);
 }
 

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/utilities/ovs-pki.in#2 (text+ko) ====

@@ -24,6 +24,38 @@
 log='@LOGDIR@/ovs-pki.log'
 keytype=rsa
 bits=2048
+
+# OS-specific compatibility routines
+case $(uname -s) in
+FreeBSD)
+    file_mod_epoch()
+    {
+        stat -r "$1" | awk '{print $10}'
+    }
+
+    file_mod_date()
+    {
+        stat -f '%Sm' "$1"
+    }
+
+    sha1sum()
+    {
+        sha1 "$@"
+    }
+    ;;
+*)
+    file_mod_epoch()
+    {
+        date -r "$1" +%s
+    }
+
+    file_mod_date()
+    {
+        date -r "$1"
+    }
+    ;;
+esac
+
 for option; do
     # This option-parsing mechanism borrowed from a Autoconf-generated
     # configure script under the following license:
@@ -365,7 +397,7 @@
 fingerprint() {
     file=$1
     name=${1-$2}
-    date=$(date -r $file)
+    date=$(file_mod_date "$file")
     if grep -e '-BEGIN CERTIFICATE-' "$file" > /dev/null; then
         fingerprint=$(openssl x509 -noout -in "$file" -fingerprint |
                       sed 's/SHA1 Fingerprint=//' | tr -d ':')
@@ -609,7 +641,7 @@
     for type in switch controller; do
         cd "$pkidir/${type}ca/incoming" || exit 1
         for file in $(glob "*"); do
-            time=$(date -r "$file" +%s)
+            time=$(file_mod_epoch "$file")
             if test "$time" -lt "$cutoff"; then
                 rm -f "$file"
             fi

==== //depot/projects/ctsrd/beribsd/src/contrib/openvswitch/xenserver/opt_xensource_libexec_interface-reconfigure#2 (text+ko) ====

@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # Copyright (c) 2008,2009 Citrix Systems, Inc.
 #



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209112051.q8BKpKf9072307>