link: call rtnl_link_set_type() in link_msg_parser()

We need to call link-specific ->io_alloc() to alloc
addtional structures.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
veth: implement ->io_alloc

Users don't have to call rtnl_link_veth_alloc(), instead
use generic rtnl_link_set_type().

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
veth: implement ->io_free

So that veth link can be just put by rtnl_link_put()

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
veth: use nl_object_clone() to deep copy rtnl_link object

Currently we use memcpy() to copy the peer rtnl_link for veth device,
this is wrong, we should do deep copy by calling nl_object_clone()
recursively. We should be careful and need to make sure we only call
it once.

Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
add NLM_F_EXCL to rtnl_link_veth_add()

rtnl_link_veth_add() is a helper API we provide, it makes sense to
set NLM_F_EXCL for it since it doesn't accept flags as a parameter.

BTW, correct an indention too.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
python: fix wrongly passing argument to function in ObjIterator.next()

self.__next__() bound method does not take an extra argument.

https://github.com/thom311/libnl/pull/57

Signed-off-by: Hiroaki KAWAI <kawai@stratosphere.co.jp>
Signed-off-by: Thomas Haller <thaller@redhat.com>