| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | #include <linux/etherdevice.h> |
|---|
| 2 | 3 | #include <linux/if_macvlan.h> |
|---|
| 3 | 4 | #include <linux/if_tap.h> |
|---|
| .. | .. |
|---|
| 132 | 133 | dev->tx_queue_len = TUN_READQ_SIZE; |
|---|
| 133 | 134 | } |
|---|
| 134 | 135 | |
|---|
| 136 | +static struct net *macvtap_link_net(const struct net_device *dev) |
|---|
| 137 | +{ |
|---|
| 138 | + return dev_net(macvlan_dev_real_dev(dev)); |
|---|
| 139 | +} |
|---|
| 140 | + |
|---|
| 135 | 141 | static struct rtnl_link_ops macvtap_link_ops __read_mostly = { |
|---|
| 136 | 142 | .kind = "macvtap", |
|---|
| 137 | 143 | .setup = macvtap_setup, |
|---|
| 138 | 144 | .newlink = macvtap_newlink, |
|---|
| 139 | 145 | .dellink = macvtap_dellink, |
|---|
| 146 | + .get_link_net = macvtap_link_net, |
|---|
| 140 | 147 | .priv_size = sizeof(struct macvtap_dev), |
|---|
| 141 | 148 | }; |
|---|
| 142 | 149 | |
|---|