diff options
author | Thomas Haller <thaller@redhat.com> | 2015-06-26 15:58:06 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-06-26 16:04:34 (GMT) |
commit | b4afcadc30f0133135c6f8b062d6e1ca68b645a7 (patch) | |
tree | 1939c622d4dfc1118436885347a64937fa68ea57 /lib | |
parent | 089a28212db9971a0aaa1952183de4f78dab3636 (diff) | |
download | libnl-b4afcadc30f0133135c6f8b062d6e1ca68b645a7.zip libnl-b4afcadc30f0133135c6f8b062d6e1ca68b645a7.tar.gz libnl-b4afcadc30f0133135c6f8b062d6e1ca68b645a7.tar.bz2 |
ipvlan: fix signature of rtnl_link_ipvlan_get_mode() to signal error
http://lists.infradead.org/pipermail/libnl/2015-June/001902.html
Fixes: 7de5be85bf9aa3eb9f022e4813226135e89adec2
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/route/link/ipvlan.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/route/link/ipvlan.c b/lib/route/link/ipvlan.c index 2ad56f8..3e77f70 100644 --- a/lib/route/link/ipvlan.c +++ b/lib/route/link/ipvlan.c @@ -227,19 +227,20 @@ int rtnl_link_ipvlan_set_mode(struct rtnl_link *link, uint16_t mode) /** * Get IPVLAN Mode * @arg link Link object + * @arg out_mode on success, return the mode * - * @return IPVLAN mode, 0 if not set or a negative error code. + * @return 0 on success or a negative error code. */ -uint16_t rtnl_link_ipvlan_get_mode(struct rtnl_link *link) +int rtnl_link_ipvlan_get_mode(struct rtnl_link *link, uint16_t *out_mode) { struct ipvlan_info *ipi = link->l_info; IS_IPVLAN_LINK_ASSERT(link); - if (ipi->ipi_mask & IPVLAN_HAS_MODE) - return ipi->ipi_mode; - else - return 0; + if (!(ipi->ipi_mask & IPVLAN_HAS_MODE)) + return -NLE_OPNOTSUPP; + *out_mode = ipi->ipi_mode; + return 0; } /** @} */ |