On 2025-02-08, at 14:49:49 +0100, corubba wrote: > Gone missing in f04bf679. > > Signed-off-by: Corubba Smith <corubba@xxxxxx> > --- > output/ulogd_output_GPRINT.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/output/ulogd_output_GPRINT.c b/output/ulogd_output_GPRINT.c > index 37829fa..d95ca9d 100644 > --- a/output/ulogd_output_GPRINT.c > +++ b/output/ulogd_output_GPRINT.c > @@ -179,9 +179,15 @@ static int gprint_interp(struct ulogd_pluginstance *upi) > if (!inet_ntop(family, addr, buf + size, rem)) > break; > ret = strlen(buf + size); > + rem -= ret; > + size += ret; > > + ret = snprintf(buf+size, rem, ","); > + if (ret < 0) > + break; > rem -= ret; > size += ret; > + > break; > } > default: My suggestion would be to follow ulgod_output_OPRINT.c (completely untested): diff --git a/output/ulogd_output_GPRINT.c b/output/ulogd_output_GPRINT.c index 37829fa49e9d..b18fe3a0838c 100644 --- a/output/ulogd_output_GPRINT.c +++ b/output/ulogd_output_GPRINT.c @@ -155,6 +155,7 @@ static int gprint_interp(struct ulogd_pluginstance *upi) size += ret; break; case ULOGD_RET_IPADDR: { + char addrbuf[INET6_ADDRSTRLEN + 1] = ""; struct in6_addr ipv6addr; struct in_addr ipv4addr; int family; @@ -176,10 +177,11 @@ static int gprint_interp(struct ulogd_pluginstance *upi) addr = &ipv4addr; family = AF_INET; } - if (!inet_ntop(family, addr, buf + size, rem)) + if (!inet_ntop(family, addr, addrbuf, sizeof(addrbuf))) + break; + ret = snprintf(buf + size, rem, "%s,", addrbuf); + if (ret < 0) break; - ret = strlen(buf + size); - rem -= ret; size += ret; break; J.
Attachment:
signature.asc
Description: PGP signature