> On Tue, Aug 06, 2013 at 10:31:57PM +0000, YAMAMOTO Takashi wrote: >> > not build-tested any of the changes in this series outside of a >> > GNU/Linux environment. >> >> i can try a build on netbsd more easily if you can provide >> a git repo url i can pull from. > > As always, the patches I post are available in the repository at > https://github.com/blp/ovs-reviews.git. These particular patches are in > the "netdev" branch.
thanks. it seems to work fine on NetBSD with the following fixes. YAMAMOTO Takashi > > Thanks, > > Ben. >From 9f4ca612e1542fe18c1abd0a41d8a9a4097bd788 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi <y...@mwd.biglobe.ne.jp> Date: Thu, 8 Aug 2013 09:02:24 +0900 Subject: [PATCH 1/2] netdev-bsd: make this buildable again Signed-off-by: YAMAMOTO Takashi <y...@mwd.biglobe.ne.jp> --- lib/netdev-bsd.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/netdev-bsd.c b/lib/netdev-bsd.c index 95edbb5..159ac96 100644 --- a/lib/netdev-bsd.c +++ b/lib/netdev-bsd.c @@ -147,12 +147,12 @@ static void ifr_set_flags(struct ifreq *, int flags); static int af_link_ioctl(int command, const void *arg); #endif -static int netdev_bsd_init(void); +static void netdev_bsd_run(void); static bool is_netdev_bsd_class(const struct netdev_class *netdev_class) { - return netdev_class->init == netdev_bsd_init; + return netdev_class->run == netdev_bsd_run; } static struct netdev_bsd * @@ -240,7 +240,7 @@ netdev_bsd_cache_cb(const struct rtbsd_change *change, dev = netdev_bsd_cast(netdev); dev->cache_valid = 0; netdev_bsd_changed(dev); - netdev_close(dev); + netdev_close(&dev->up); } shash_destroy(&device_shash); } @@ -317,6 +317,7 @@ netdev_bsd_construct_tap(struct netdev *netdev_) struct netdev_bsd *netdev = netdev_bsd_cast(netdev_); int error = 0; struct ifreq ifr; + const char *name = netdev_->name; char *kernel_name = NULL; error = cache_notifier_ref(); @@ -328,7 +329,7 @@ netdev_bsd_construct_tap(struct netdev *netdev_) /* Create a tap device by opening /dev/tap. The TAPGIFNAME ioctl is used * to retrieve the name of the tap device. */ - ovs_mutex_init(&netdev->mutex); + ovs_mutex_init(&netdev->mutex, PTHREAD_MUTEX_NORMAL); netdev->tap_fd = open("/dev/tap", O_RDWR); netdev->change_seq = 1; if (netdev->tap_fd < 0) { @@ -714,7 +715,7 @@ netdev_bsd_send(struct netdev *netdev_, const void *data, size_t size) } } - ovs_mutex_unlock(&netdev->mutex); + ovs_mutex_unlock(&dev->mutex); return error; } @@ -1425,8 +1426,10 @@ const struct netdev_class netdev_bsd_class = { NULL, /* init */ netdev_bsd_run, netdev_bsd_wait, - netdev_bsd_create_system, - netdev_bsd_destroy, + netdev_bsd_alloc, + netdev_bsd_construct_system, + netdev_bsd_destruct, + netdev_bsd_dealloc, NULL, /* get_config */ NULL, /* set_config */ NULL, /* get_tunnel_config */ @@ -1486,14 +1489,14 @@ const struct netdev_class netdev_tap_class = { NULL, /* init */ netdev_bsd_run, netdev_bsd_wait, - netdev_bsd_create_tap, - netdev_bsd_destroy, + netdev_bsd_alloc, + netdev_bsd_construct_tap, + netdev_bsd_destruct, + netdev_bsd_dealloc, NULL, /* get_config */ NULL, /* set_config */ NULL, /* get_tunnel_config */ - netdev_bsd_rx_open, - netdev_bsd_send, netdev_bsd_send_wait, -- 1.8.1.5 >From 0c7638b137e3a92c118a4374d7ab131c2a5179af Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi <y...@mwd.biglobe.ne.jp> Date: Thu, 8 Aug 2013 09:02:46 +0900 Subject: [PATCH 2/2] socket-util: don't truncate ioctl cmd to int it's unsigned long on NetBSD. Signed-off-by: YAMAMOTO Takashi <y...@mwd.biglobe.ne.jp> --- lib/socket-util.c | 4 ++-- lib/socket-util.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/socket-util.c b/lib/socket-util.c index 7ae6d1f..5320b86 100644 --- a/lib/socket-util.c +++ b/lib/socket-util.c @@ -1358,7 +1358,7 @@ error: /* Calls ioctl() on an AF_INET sock, passing the specified 'command' and * 'arg'. Returns 0 if successful, otherwise a positive errno value. */ int -af_inet_ioctl(int command, const void *arg) +af_inet_ioctl(unsigned long command, const void *arg) { static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; static int sock; @@ -1378,7 +1378,7 @@ af_inet_ioctl(int command, const void *arg) } int -af_inet_ifreq_ioctl(const char *name, struct ifreq *ifr, int cmd, +af_inet_ifreq_ioctl(const char *name, struct ifreq *ifr, unsigned long cmd, const char *cmd_name) { int error; diff --git a/lib/socket-util.h b/lib/socket-util.h index 937e6b9..19fed4c 100644 --- a/lib/socket-util.h +++ b/lib/socket-util.h @@ -99,8 +99,8 @@ int recv_data_and_fds(int sock, /* Helpers for calling ioctl() on an AF_INET socket. */ struct ifreq; -int af_inet_ioctl(int command, const void *arg); +int af_inet_ioctl(unsigned long command, const void *arg); int af_inet_ifreq_ioctl(const char *name, struct ifreq *, - int cmd, const char *cmd_name); + unsigned long cmd, const char *cmd_name); #endif /* socket-util.h */ -- 1.8.1.5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev