* [PATCH] rtnl: Add l_rtnl_address_dup
@ 2021-05-29 0:03 Andrew Zaborowski
2021-06-01 14:48 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Zaborowski @ 2021-05-29 0:03 UTC (permalink / raw)
To: ell
[-- Attachment #1: Type: text/plain, Size: 1131 bytes --]
Returns a new l_rtnl_address that is a copy of the one passed in
parameter.
---
ell/rtnl.c | 6 ++++++
ell/rtnl.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/ell/rtnl.c b/ell/rtnl.c
index e2996a6..2f26f6f 100644
--- a/ell/rtnl.c
+++ b/ell/rtnl.c
@@ -146,6 +146,12 @@ LIB_EXPORT struct l_rtnl_address *l_rtnl_address_new(const char *ip,
return addr;
}
+LIB_EXPORT struct l_rtnl_address *l_rtnl_address_dup(
+ const struct l_rtnl_address *orig)
+{
+ return l_memdup(orig, sizeof(struct l_rtnl_address));
+}
+
LIB_EXPORT void l_rtnl_address_free(struct l_rtnl_address *addr)
{
l_free(addr);
diff --git a/ell/rtnl.h b/ell/rtnl.h
index 2735dd2..036db0a 100644
--- a/ell/rtnl.h
+++ b/ell/rtnl.h
@@ -34,6 +34,7 @@ struct l_rtnl_address;
struct l_rtnl_route;
struct l_rtnl_address *l_rtnl_address_new(const char *ip, uint8_t prefix_len);
+struct l_rtnl_address *l_rtnl_address_dup(const struct l_rtnl_address *orig);
void l_rtnl_address_free(struct l_rtnl_address *addr);
bool l_rtnl_address_get_address(const struct l_rtnl_address *addr,
char *out_buf);
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rtnl: Add l_rtnl_address_dup
2021-05-29 0:03 [PATCH] rtnl: Add l_rtnl_address_dup Andrew Zaborowski
@ 2021-06-01 14:48 ` Denis Kenzior
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2021-06-01 14:48 UTC (permalink / raw)
To: ell
[-- Attachment #1: Type: text/plain, Size: 386 bytes --]
Hi Andrew,
On 5/28/21 7:03 PM, Andrew Zaborowski wrote:
> Returns a new l_rtnl_address that is a copy of the one passed in
> parameter.
> ---
> ell/rtnl.c | 6 ++++++
> ell/rtnl.h | 1 +
> 2 files changed, 7 insertions(+)
>
I named this l_rtnl_address_clone to be consistent with some other APIs we have
and added ell.sym entry. Applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-01 14:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-29 0:03 [PATCH] rtnl: Add l_rtnl_address_dup Andrew Zaborowski
2021-06-01 14:48 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.