diff options
author | Thomas Haller <thaller@redhat.com> | 2019-12-31 14:09:58 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-01-09 10:42:32 +0100 |
commit | f30ae566087cd3434eb9e32447325142677f33f5 (patch) | |
tree | 4caf4cd76936874f4568759836daaee0d387820b /src/platform/nm-platform.c | |
parent | 1ffdca6331f81122045b9397576378617809b9e1 (diff) | |
download | NetworkManager-f30ae566087cd3434eb9e32447325142677f33f5.tar.gz |
platform: implement link_macvlan_add via nm_platform_link_add()
Diffstat (limited to 'src/platform/nm-platform.c')
-rw-r--r-- | src/platform/nm-platform.c | 42 |
1 files changed, 5 insertions, 37 deletions
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index f152f1b2d4..3d6376b4f7 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -1248,6 +1248,11 @@ nm_platform_link_add (NMPlatform *self, nm_utils_strbuf_append_str (&buf_p, &buf_len, ", "); nm_platform_lnk_macsec_to_string ((const NMPlatformLnkMacsec *) extra_data, buf_p, buf_len); break; + case NM_LINK_TYPE_MACVLAN: + case NM_LINK_TYPE_MACVTAP: + nm_utils_strbuf_append_str (&buf_p, &buf_len, ", "); + nm_platform_lnk_macvlan_to_string ((const NMPlatformLnkMacvlan *) extra_data, buf_p, buf_len); + break; default: nm_assert (!extra_data); break; @@ -2753,43 +2758,6 @@ nm_platform_link_infiniband_get_properties (NMPlatform *self, return TRUE; } -/** - * nm_platform_macvlan_add: - * @self: platform instance - * @name: name of the new interface - * @props: interface properties - * @out_link: on success, the link object - * - * Create a MACVLAN or MACVTAP device. - */ -int -nm_platform_link_macvlan_add (NMPlatform *self, - const char *name, - int parent, - const NMPlatformLnkMacvlan *props, - const NMPlatformLink **out_link) -{ - int r; - NMLinkType type; - - _CHECK_SELF (self, klass, -NME_BUG); - - g_return_val_if_fail (props, -NME_BUG); - g_return_val_if_fail (name, -NME_BUG); - - type = props->tap ? NM_LINK_TYPE_MACVTAP : NM_LINK_TYPE_MACVLAN; - - r = _link_add_check_existing (self, name, type, out_link); - if (r < 0) - return r; - - _LOG2D ("adding link %s", nm_platform_lnk_macvlan_to_string (props, NULL, 0)); - - if (!klass->link_macvlan_add (self, name, parent, props, out_link)) - return -NME_UNSPEC; - return 0; -} - gboolean nm_platform_link_veth_get_properties (NMPlatform *self, int ifindex, int *out_peer_ifindex) { |