-netdev_pltap_rx_open(struct netdev *netdev_, struct netdev_rx **rxp)
-{
- struct netdev_dev_pltap *netdev_dev =
- netdev_dev_pltap_cast(netdev_get_dev(netdev_));
- struct netdev_rx_pltap *rx;
- int err;
-
- rx = xmalloc(sizeof *rx);
- netdev_rx_init(&rx->up, netdev_get_dev(netdev_), &netdev_rx_pltap_class);
- rx->fd = netdev_dev->fd;
- *rxp = &rx->up;
- if (!netdev_pltap_finalized(netdev_dev))
- return 0;
- err = netdev_pltap_up(netdev_dev);
- if (err) {
- free(rx);
- *rxp = NULL;
- return err;
+netdev_pltap_rx_construct(struct netdev_rx *rx_)
+{
+ struct netdev_rx_pltap *rx = netdev_rx_pltap_cast(rx_);
+ struct netdev *netdev_ = rx->up.netdev;
+ struct netdev_pltap *netdev =
+ netdev_pltap_cast(netdev_);
+ int error = 0;
+
+ ovs_mutex_lock(&netdev->mutex);
+ rx->fd = netdev->fd;
+ if (!netdev_pltap_finalized(netdev))
+ goto out;
+ error = netdev_pltap_up(netdev);
+ if (error) {
+ goto out;