From: Vincent Bernat Date: Thu, 6 Jun 2013 20:48:42 +0000 (+0200) Subject: marshal: don't declare serialize/unserialize helper for string X-Git-Tag: 0.7.4~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a8da18644b178a095ca6d555b55e9190a8199b8b;p=thirdparty%2Flldpd.git marshal: don't declare serialize/unserialize helper for string When using convenience library, this may lead to multiple definition of this function. We are better off not defining it and using `marshal_unserialize()` in `client.c` instead. --- diff --git a/src/daemon/client.c b/src/daemon/client.c index 58a3b50e..5ba97732 100644 --- a/src/daemon/client.c +++ b/src/daemon/client.c @@ -159,12 +159,14 @@ client_handle_get_interface(struct lldpd *cfg, enum hmsg_type *type, { char *name; struct lldpd_hardware *hardware; + void *p; /* Get name of the interface */ - if (string_unserialize(input, input_len, &name) <= 0) { + if (marshal_unserialize(string, input, input_len, &p) <= 0) { *type = NONE; return 0; } + name = p; /* Search appropriate hardware */ log_debug("rpc", "client request interface %s", name); diff --git a/src/marshal.h b/src/marshal.h index 7c4f6310..713d7b9a 100644 --- a/src/marshal.h +++ b/src/marshal.h @@ -137,6 +137,4 @@ size_t marshal_unserialize_(struct marshal_info *, void *, size_t, void **, voi #define marshal_unserialize(type, o, l, input) \ marshal_unserialize_(&MARSHAL_INFO(type), o, l, input, NULL, 0, 0) -MARSHAL_HELPER_FUNCTIONS(string, char) - #endif