Veth stands for Virtual ETHernet. It is a simple tunnel driver
that works at the link layer and looks like a pair of ethernet
devices interconnected with each other.
Mainly it allows to communicate between network namespaces but
it can be used as is as well.
The newlink callback is organized tha
Pavel Emelianov wrote:
> Patrick McHardy wrote:
>
>> You don't have a struct ifinfomsg for the peer device. At some
>> point we might want to add support for specifying initial flags
>> for the device (some easily supportable ones are IFF_PROMISC,
>> IFF_ALLMULTI, IFF_NOARP) and ideally that shoul
Patrick McHardy wrote:
Pavel Emelianov wrote:
Patrick McHardy wrote:
Pavel Emelianov wrote:
+ if (data != NULL && data[VETH_INFO_PEER] != NULL) {
+ err = nla_parse_nested(tb, IFLA_INFO_MAX,
+ data[VETH_INFO_PEER], ifla_policy);
+
Patrick McHardy wrote:
Pavel Emelianov wrote:
Patrick McHardy wrote:
+
+ if (tb[IFLA_IFNAME])
+ nla_strlcpy(ifname, tb[IFLA_IFNAME], IFNAMSIZ);
+ else
+ snprintf(ifname, IFNAMSIZ, DRV_NAME "%%d");
Does this work? The other device is not registered at t
Pavel Emelianov wrote:
> Patrick McHardy wrote:
>
>>Pavel Emelianov wrote:
>>
>>>+if (data != NULL && data[VETH_INFO_PEER] != NULL) {
>>>+err = nla_parse_nested(tb, IFLA_INFO_MAX,
>>>+data[VETH_INFO_PEER], ifla_policy);
>>>+if (err < 0)
>>>+
Patrick McHardy wrote:
> Pavel Emelianov wrote:
>> +if (data != NULL && data[VETH_INFO_PEER] != NULL) {
>> +err = nla_parse_nested(tb, IFLA_INFO_MAX,
>> +data[VETH_INFO_PEER], ifla_policy);
>> +if (err < 0)
>> +return err;
Patrick McHardy wrote:
> Pavel Emelianov wrote:
>> Patrick McHardy wrote:
>>
>>> No, to get unique names the sequence has to be:
>>>
>>> dev_alloc_name
>>> register_netdevice
>>> dev_alloc_name
>>> register_netdevice
>>>
>>> But you have:
>>>
>>> dev_alloc_name
>>> dev_alloc_name (<- might allocate
Pavel Emelianov wrote:
> + if (data != NULL && data[VETH_INFO_PEER] != NULL) {
> + err = nla_parse_nested(tb, IFLA_INFO_MAX,
> + data[VETH_INFO_PEER], ifla_policy);
> + if (err < 0)
> + return err;
> + }
One more sugg
Pavel Emelianov wrote:
> Patrick McHardy wrote:
>
>>No, to get unique names the sequence has to be:
>>
>>dev_alloc_name
>>register_netdevice
>>dev_alloc_name
>>register_netdevice
>>
>>But you have:
>>
>>dev_alloc_name
>>dev_alloc_name (<- might allocate same name as first call)
>>register_netdevic
Patrick McHardy wrote:
> Pavel Emelianov wrote:
>> Patrick McHardy wrote:
>>
>>> Pavel Emelianov wrote:
>>>
+static int veth_newlink(struct net_device *dev,
+ struct nlattr *tb[], struct nlattr *data[])
+{
+ int err;
+ struct net_device *peer;
+ st
Pavel Emelianov wrote:
> Patrick McHardy wrote:
>
>>>+
>>>+if (tb[IFLA_IFNAME])
>>>+nla_strlcpy(ifname, tb[IFLA_IFNAME], IFNAMSIZ);
>>>+else
>>>+snprintf(ifname, IFNAMSIZ, DRV_NAME "%%d");
>>
>>
>>Does this work? The other device is not registered at this time, so I
Pavel Emelianov wrote:
> Patrick McHardy wrote:
>
>>Pavel Emelianov wrote:
>>
>>>+static int veth_newlink(struct net_device *dev,
>>>+ struct nlattr *tb[], struct nlattr *data[])
>>>+{
>>>+int err;
>>>+struct net_device *peer;
>>>+struct veth_priv *priv;
>>>+cha
Patrick McHardy wrote:
> Pavel Emelianov wrote:
>> +static int veth_newlink(struct net_device *dev,
>> + struct nlattr *tb[], struct nlattr *data[])
>> +{
>> +int err;
>> +struct net_device *peer;
>> +struct veth_priv *priv;
>> +char ifname[IFNAMSIZ];
>> +
>> +
Patrick McHardy wrote:
> Pavel Emelianov wrote:
>> +static int veth_newlink(struct net_device *dev,
>> + struct nlattr *tb[], struct nlattr *data[])
>> +{
>> +int err;
>> +struct net_device *peer;
>> +struct veth_priv *priv;
>> +char ifname[IFNAMSIZ];
>> +
>> +
Pavel Emelianov wrote:
> +static int veth_newlink(struct net_device *dev,
> + struct nlattr *tb[], struct nlattr *data[])
> +{
> + int err;
> + struct net_device *peer;
> + struct veth_priv *priv;
> + char ifname[IFNAMSIZ];
> +
> + /*
> + * prepare the
Veth stands for Virtual ETHernet. It is a simple tunnel driver
that works at the link layer and looks like a pair of ethernet
devices interconnected with each other.
Mainly it allows to communicate between network namespaces but
it can be used as is as well.
The newlink callback is organized that
16 matches
Mail list logo