nfq: fix HW address output in nfq_snprintf_xml()
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 11 Jul 2010 13:00:13 +0000 (15:00 +0200)
committerr.kubiak <r.kubiak@samsung.com>
Mon, 16 Nov 2015 13:12:05 +0000 (14:12 +0100)
This patch fixes the output of the HW address in XML files:

<src>800:800:800:800:800:</src>

now it looks fine:

<src>0019a917a400</src>

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/libnetfilter_queue.c

index 7da16be..7269042 100644 (file)
@@ -1095,9 +1095,9 @@ int nfq_snprintf_xml(char *buf, size_t rem, struct nfq_data *tb, int flags)
                        size = snprintf(buf + offset, rem, "<src>");
                        SNPRINTF_FAILURE(size, rem, offset, len);
 
-                       for (i=0; i<hlen-1; i++) {
-                               size = snprintf(buf + offset, rem, "%02x:",
-                                               ntohs(ph->hw_protocol));
+                       for (i=0; i<hlen; i++) {
+                               size = snprintf(buf + offset, rem, "%02x",
+                                               hwph->hw_addr[i]);
                                SNPRINTF_FAILURE(size, rem, offset, len);
                        }