]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
marshal: don't declare serialize/unserialize helper for string
authorVincent Bernat <bernat@luffy.cx>
Thu, 6 Jun 2013 20:48:42 +0000 (22:48 +0200)
committerVincent Bernat <bernat@luffy.cx>
Thu, 6 Jun 2013 20:48:42 +0000 (22:48 +0200)
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.

src/daemon/client.c
src/marshal.h

index 58a3b50e1eff19e49fa916b37c59b430d52af052..5ba9773268aab83470554d0e51685403c8f8457f 100644 (file)
@@ -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);
index 7c4f6310f5fd7360f5287aade0d02876d48a9c54..713d7b9ac13db7f94cd4a2e7521054c5f1aa2535 100644 (file)
@@ -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