Commit 1d997f10 authored by Hangbin Liu's avatar Hangbin Liu Committed by Jakub Kicinski
Browse files

rtnetlink: pass netlink message header and portid to rtnl_configure_link()



This patch pass netlink message header and portid to rtnl_configure_link()
All the functions in this call chain need to add the parameters so we can
use them in the last call rtnl_notify(), and notify the userspace about
the new link info if NLM_F_ECHO flag is set.

- rtnl_configure_link()
  - __dev_notify_flags()
    - rtmsg_ifinfo()
      - rtmsg_ifinfo_event()
        - rtmsg_ifinfo_build_skb()
        - rtmsg_ifinfo_send()
	  - rtnl_notify()

Also move __dev_notify_flags() declaration to net/core/dev.h, as Jakub
suggested.

Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Reviewed-by: default avatarGuillaume Nault <gnault@redhat.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 37fe9b98
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -236,7 +236,7 @@ static int vxcan_newlink(struct net *net, struct net_device *dev,

	netif_carrier_off(peer);

	err = rtnl_configure_link(peer, ifmp);
	err = rtnl_configure_link(peer, ifmp, 0, NULL);
	if (err < 0)
		goto unregister_network_device;

+1 −1
Original line number Diff line number Diff line
@@ -1907,7 +1907,7 @@ struct net_device *geneve_dev_create_fb(struct net *net, const char *name,
	if (err)
		goto err;

	err = rtnl_configure_link(dev, NULL);
	err = rtnl_configure_link(dev, NULL, 0, NULL);
	if (err < 0)
		goto err;

+1 −1
Original line number Diff line number Diff line
@@ -1773,7 +1773,7 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
	veth_disable_gro(peer);
	netif_carrier_off(peer);

	err = rtnl_configure_link(peer, ifmp);
	err = rtnl_configure_link(peer, ifmp, 0, NULL);
	if (err < 0)
		goto err_configure_peer;

+2 −2
Original line number Diff line number Diff line
@@ -3794,7 +3794,7 @@ static int __vxlan_dev_create(struct net *net, struct net_device *dev,
			goto errout;
	}

	err = rtnl_configure_link(dev, NULL);
	err = rtnl_configure_link(dev, NULL, 0, NULL);
	if (err < 0)
		goto unlink;

@@ -4416,7 +4416,7 @@ struct net_device *vxlan_dev_create(struct net *net, const char *name,
		return ERR_PTR(err);
	}

	err = rtnl_configure_link(dev, NULL);
	err = rtnl_configure_link(dev, NULL, 0, NULL);
	if (err < 0) {
		LIST_HEAD(list_kill);

+1 −1
Original line number Diff line number Diff line
@@ -1058,7 +1058,7 @@ static void wwan_create_default_link(struct wwan_device *wwandev,
		goto unlock;
	}

	rtnl_configure_link(dev, NULL); /* Link initialized, notify new link */
	rtnl_configure_link(dev, NULL, 0, NULL); /* Link initialized, notify new link */

unlock:
	rtnl_unlock();
Loading