Skip to content

Commit a544976

Browse files
authored
Merge pull request #245 from cisco/bhudson-dev
Added IPv6 support to Joy code base. Some things still lack IPv6 support. These are: NFv9 IPFix collection and export Anonymization Labeled subnets In order for labeled subnets and Anonymization to support IPv6, the Radix Trie will need to be modified to support IPv6 as well. NFv9 and IPFix both need the proper templates and CANA numbers for processing.
2 parents d8d1558 + f891278 commit a544976

30 files changed

+1305
-288
lines changed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ This package was written by David McGrew, Blake Anderson, Philip Perricone
8989
and Bill Hudson {mcgrew,blaander,phperric,bhudson}@cisco.com of Cisco Systems
9090
Advanced Security Research Group (ASRG) and Security and Trust Organization (STO).
9191

92+
### Release 4.3.0
93+
* Add IPv6 support to Joy and libjoy
94+
* IPFix collection and export only support IPv4
95+
* NFv9 only supports IPv4
96+
* Anonymization only supports IPv4 addresses
97+
* Subnet labeling only supports IPv4 addresses
98+
9299
### Release 4.2.0
93100
* Re-write joy.c to use libjoy library
94101
* Updated joy.c to utilize multi-threads for flow processing

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.2.1
1+
4.3.0

configure

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for joy 4.2.1.
3+
# Generated by GNU Autoconf 2.69 for joy 4.3.0.
44
#
55
# Report bugs to <https://github.com/cisco/joy/issues>.
66
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
590590
# Identity of this package.
591591
PACKAGE_NAME='joy'
592592
PACKAGE_TARNAME='joy'
593-
PACKAGE_VERSION='4.2.1'
594-
PACKAGE_STRING='joy 4.2.1'
593+
PACKAGE_VERSION='4.3.0'
594+
PACKAGE_STRING='joy 4.3.0'
595595
PACKAGE_BUGREPORT='https://github.com/cisco/joy/issues'
596596
PACKAGE_URL='https://github.com/cisco/joy/'
597597

@@ -1342,7 +1342,7 @@ if test "$ac_init_help" = "long"; then
13421342
# Omit some internal or obsolete options to make the list less imposing.
13431343
# This message is too long to be a string in the A/UX 3.1 sh.
13441344
cat <<_ACEOF
1345-
\`configure' configures joy 4.2.1 to adapt to many kinds of systems.
1345+
\`configure' configures joy 4.3.0 to adapt to many kinds of systems.
13461346

13471347
Usage: $0 [OPTION]... [VAR=VALUE]...
13481348

@@ -1412,7 +1412,7 @@ fi
14121412

14131413
if test -n "$ac_init_help"; then
14141414
case $ac_init_help in
1415-
short | recursive ) echo "Configuration of joy 4.2.1:";;
1415+
short | recursive ) echo "Configuration of joy 4.3.0:";;
14161416
esac
14171417
cat <<\_ACEOF
14181418

@@ -1531,7 +1531,7 @@ fi
15311531
test -n "$ac_init_help" && exit $ac_status
15321532
if $ac_init_version; then
15331533
cat <<\_ACEOF
1534-
joy configure 4.2.1
1534+
joy configure 4.3.0
15351535
generated by GNU Autoconf 2.69
15361536

15371537
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2205,7 +2205,7 @@ cat >config.log <<_ACEOF
22052205
This file contains any messages produced by compilers while
22062206
running configure, to aid debugging if configure makes a mistake.
22072207

2208-
It was created by joy $as_me 4.2.1, which was
2208+
It was created by joy $as_me 4.3.0, which was
22092209
generated by GNU Autoconf 2.69. Invocation command line was
22102210

22112211
$ $0 $@
@@ -3073,7 +3073,7 @@ fi
30733073

30743074
# Define the identity of the package.
30753075
PACKAGE='joy'
3076-
VERSION='4.2.1'
3076+
VERSION='4.3.0'
30773077

30783078

30793079
cat >>confdefs.h <<_ACEOF
@@ -6822,16 +6822,16 @@ fi
68226822
done
68236823

68246824
######################## PKG Versioning #######################
6825-
PKG_VERSION_NUMBER="4:2:1"
6825+
PKG_VERSION_NUMBER="4:3:0"
68266826

68276827

68286828
$as_echo "#define JOY_MAJOR_VERSION 4" >>confdefs.h
68296829

68306830

6831-
$as_echo "#define JOY_MINOR_VERSION 2" >>confdefs.h
6831+
$as_echo "#define JOY_MINOR_VERSION 3" >>confdefs.h
68326832

68336833

6834-
$as_echo "#define JOY_MICRO_VERSION 1" >>confdefs.h
6834+
$as_echo "#define JOY_MICRO_VERSION 0" >>confdefs.h
68356835

68366836

68376837
######################## Library Versioning ####################
@@ -6840,7 +6840,7 @@ $as_echo "#define JOY_MICRO_VERSION 1" >>confdefs.h
68406840
# For each shared library
68416841
#
68426842
#joy.so age for version
6843-
JOY_LIBRARY_VERSION="4:2:0"
6843+
JOY_LIBRARY_VERSION="4:3:0"
68446844

68456845

68466846
case `pwd` in
@@ -18543,7 +18543,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1854318543
# report actual input values of CONFIG_FILES etc. instead of their
1854418544
# values after options handling.
1854518545
ac_log="
18546-
This file was extended by joy $as_me 4.2.1, which was
18546+
This file was extended by joy $as_me 4.3.0, which was
1854718547
generated by GNU Autoconf 2.69. Invocation command line was
1854818548

1854918549
CONFIG_FILES = $CONFIG_FILES
@@ -18610,7 +18610,7 @@ _ACEOF
1861018610
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1861118611
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1861218612
ac_cs_version="\\
18613-
joy config.status 4.2.1
18613+
joy config.status 4.3.0
1861418614
configured by $0, generated by GNU Autoconf 2.69,
1861518615
with options \\"\$ac_cs_config\\"
1861618616

configure.ac

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# Shared objects are named library.so.Major.age.Minor by autotools
1313
#
1414
m4_define([joy_major_version], [4])
15-
m4_define([joy_minor_version], [2])
16-
m4_define([joy_micro_version], [1])
15+
m4_define([joy_minor_version], [3])
16+
m4_define([joy_micro_version], [0])
1717

1818

1919
m4_define([joy_version],[joy_major_version.joy_minor_version.joy_micro_version])

doc/Joy-Library-User-Guide.pdf

-39 Bytes
Binary file not shown.

lib/Makefile.am

+5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ libjoy_la_SOURCES = \
3232
../src/ppi.c \
3333
../src/utils.c \
3434
../src/dhcp.c \
35+
../src/dhcpv6.c \
3536
../src/payload.c \
3637
../src/config.c \
3738
../src/proto_identify.c \
@@ -45,6 +46,7 @@ libjoy_la_SOURCES = \
4546
../src/include/classify.h \
4647
../src/include/config.h \
4748
../src/include/dhcp.h \
49+
../src/include/dhcpv6.h \
4850
../src/include/dns.h \
4951
../src/include/err.h \
5052
../src/include/example.h \
@@ -111,6 +113,7 @@ libjoy_la_SOURCES = \
111113
../src/ppi.c \
112114
../src/utils.c \
113115
../src/dhcp.c \
116+
../src/dhcpv6.c \
114117
../src/payload.c \
115118
../src/config.c \
116119
../src/proto_identify.c \
@@ -126,6 +129,7 @@ libjoy_la_SOURCES = \
126129
../src/include/classify.h \
127130
../src/include/config.h \
128131
../src/include/dhcp.h \
132+
../src/include/dhcpv6.h \
129133
../src/include/dns.h \
130134
../src/include/err.h \
131135
../src/include/example.h \
@@ -175,6 +179,7 @@ library_include_HEADERS= \
175179
../src/include/classify.h \
176180
../src/include/config.h \
177181
../src/include/dhcp.h \
182+
../src/include/dhcpv6.h \
178183
../src/include/dns.h \
179184
../src/include/err.h \
180185
../src/include/example.h \

lib/Makefile.in

+39-20
Original file line numberDiff line numberDiff line change
@@ -134,30 +134,32 @@ am__libjoy_la_SOURCES_DIST = ../src/joy_api.c ../src/p2f.c \
134134
../src/str_match.c ../src/acsm.c ../src/dns.c ../src/example.c \
135135
../src/ipfix.c ../src/ssh.c ../src/ike.c ../src/salt.c \
136136
../src/parson.c ../src/fingerprint.c ../src/ppi.c \
137-
../src/utils.c ../src/dhcp.c ../src/payload.c ../src/config.c \
138-
../src/proto_identify.c ../src/fp.c ../src/extractor.c \
139-
../src/updater.c ../safe_c_stub/src/safe_str_stub.c \
137+
../src/utils.c ../src/dhcp.c ../src/dhcpv6.c ../src/payload.c \
138+
../src/config.c ../src/proto_identify.c ../src/fp.c \
139+
../src/extractor.c ../src/updater.c \
140+
../safe_c_stub/src/safe_str_stub.c \
140141
../safe_c_stub/src/safe_mem_stub.c ../src/include/acsm.h \
141142
../src/include/addr_attr.h ../src/include/addr.h \
142143
../src/include/anon.h ../src/include/classify.h \
143144
../src/include/config.h ../src/include/dhcp.h \
144-
../src/include/dns.h ../src/include/err.h \
145-
../src/include/example.h ../src/include/feature.h \
146-
../src/include/fingerprint.h ../src/include/hdr_dsc.h \
147-
../src/include/http.h ../src/include/ike.h \
148-
../src/include/ipfix.h ../src/include/joy_api.h \
149-
../src/include/joy_api_private.h ../src/include/map.h \
150-
../src/include/modules.h ../src/include/nfv9.h \
151-
../src/include/osdetect.h ../src/include/output.h \
152-
../src/include/p2f.h ../src/include/parson.h \
153-
../src/include/payload.h ../src/include/pkt.h \
154-
../src/include/pkt_proc.h ../src/include/ppi.h \
155-
../src/include/procwatch.h ../src/include/proto_identify.h \
156-
../src/include/radix_trie.h ../src/include/salt.h \
157-
../src/include/ssh.h ../src/include/str_match.h \
158-
../src/include/tls.h ../src/include/updater.h \
159-
../src/include/utils.h ../src/include/fp.h \
160-
../src/include/extractor.h ../src/include/wht.h
145+
../src/include/dhcpv6.h ../src/include/dns.h \
146+
../src/include/err.h ../src/include/example.h \
147+
../src/include/feature.h ../src/include/fingerprint.h \
148+
../src/include/hdr_dsc.h ../src/include/http.h \
149+
../src/include/ike.h ../src/include/ipfix.h \
150+
../src/include/joy_api.h ../src/include/joy_api_private.h \
151+
../src/include/map.h ../src/include/modules.h \
152+
../src/include/nfv9.h ../src/include/osdetect.h \
153+
../src/include/output.h ../src/include/p2f.h \
154+
../src/include/parson.h ../src/include/payload.h \
155+
../src/include/pkt.h ../src/include/pkt_proc.h \
156+
../src/include/ppi.h ../src/include/procwatch.h \
157+
../src/include/proto_identify.h ../src/include/radix_trie.h \
158+
../src/include/salt.h ../src/include/ssh.h \
159+
../src/include/str_match.h ../src/include/tls.h \
160+
../src/include/updater.h ../src/include/utils.h \
161+
../src/include/fp.h ../src/include/extractor.h \
162+
../src/include/wht.h
161163
am__dirstamp = $(am__leading_dot)dirstamp
162164
@BUILD_WITH_SAFEC_FALSE@am_libjoy_la_OBJECTS = \
163165
@BUILD_WITH_SAFEC_FALSE@ ../src/libjoy_la-joy_api.lo \
@@ -188,6 +190,7 @@ am__dirstamp = $(am__leading_dot)dirstamp
188190
@BUILD_WITH_SAFEC_FALSE@ ../src/libjoy_la-ppi.lo \
189191
@BUILD_WITH_SAFEC_FALSE@ ../src/libjoy_la-utils.lo \
190192
@BUILD_WITH_SAFEC_FALSE@ ../src/libjoy_la-dhcp.lo \
193+
@BUILD_WITH_SAFEC_FALSE@ ../src/libjoy_la-dhcpv6.lo \
191194
@BUILD_WITH_SAFEC_FALSE@ ../src/libjoy_la-payload.lo \
192195
@BUILD_WITH_SAFEC_FALSE@ ../src/libjoy_la-config.lo \
193196
@BUILD_WITH_SAFEC_FALSE@ ../src/libjoy_la-proto_identify.lo \
@@ -225,6 +228,7 @@ am__dirstamp = $(am__leading_dot)dirstamp
225228
@BUILD_WITH_SAFEC_TRUE@ ../src/libjoy_la-ppi.lo \
226229
@BUILD_WITH_SAFEC_TRUE@ ../src/libjoy_la-utils.lo \
227230
@BUILD_WITH_SAFEC_TRUE@ ../src/libjoy_la-dhcp.lo \
231+
@BUILD_WITH_SAFEC_TRUE@ ../src/libjoy_la-dhcpv6.lo \
228232
@BUILD_WITH_SAFEC_TRUE@ ../src/libjoy_la-payload.lo \
229233
@BUILD_WITH_SAFEC_TRUE@ ../src/libjoy_la-config.lo \
230234
@BUILD_WITH_SAFEC_TRUE@ ../src/libjoy_la-proto_identify.lo \
@@ -459,6 +463,7 @@ lib_LTLIBRARIES = libjoy.la
459463
@BUILD_WITH_SAFEC_FALSE@ ../src/ppi.c \
460464
@BUILD_WITH_SAFEC_FALSE@ ../src/utils.c \
461465
@BUILD_WITH_SAFEC_FALSE@ ../src/dhcp.c \
466+
@BUILD_WITH_SAFEC_FALSE@ ../src/dhcpv6.c \
462467
@BUILD_WITH_SAFEC_FALSE@ ../src/payload.c \
463468
@BUILD_WITH_SAFEC_FALSE@ ../src/config.c \
464469
@BUILD_WITH_SAFEC_FALSE@ ../src/proto_identify.c \
@@ -474,6 +479,7 @@ lib_LTLIBRARIES = libjoy.la
474479
@BUILD_WITH_SAFEC_FALSE@ ../src/include/classify.h \
475480
@BUILD_WITH_SAFEC_FALSE@ ../src/include/config.h \
476481
@BUILD_WITH_SAFEC_FALSE@ ../src/include/dhcp.h \
482+
@BUILD_WITH_SAFEC_FALSE@ ../src/include/dhcpv6.h \
477483
@BUILD_WITH_SAFEC_FALSE@ ../src/include/dns.h \
478484
@BUILD_WITH_SAFEC_FALSE@ ../src/include/err.h \
479485
@BUILD_WITH_SAFEC_FALSE@ ../src/include/example.h \
@@ -540,6 +546,7 @@ lib_LTLIBRARIES = libjoy.la
540546
@BUILD_WITH_SAFEC_TRUE@ ../src/ppi.c \
541547
@BUILD_WITH_SAFEC_TRUE@ ../src/utils.c \
542548
@BUILD_WITH_SAFEC_TRUE@ ../src/dhcp.c \
549+
@BUILD_WITH_SAFEC_TRUE@ ../src/dhcpv6.c \
543550
@BUILD_WITH_SAFEC_TRUE@ ../src/payload.c \
544551
@BUILD_WITH_SAFEC_TRUE@ ../src/config.c \
545552
@BUILD_WITH_SAFEC_TRUE@ ../src/proto_identify.c \
@@ -553,6 +560,7 @@ lib_LTLIBRARIES = libjoy.la
553560
@BUILD_WITH_SAFEC_TRUE@ ../src/include/classify.h \
554561
@BUILD_WITH_SAFEC_TRUE@ ../src/include/config.h \
555562
@BUILD_WITH_SAFEC_TRUE@ ../src/include/dhcp.h \
563+
@BUILD_WITH_SAFEC_TRUE@ ../src/include/dhcpv6.h \
556564
@BUILD_WITH_SAFEC_TRUE@ ../src/include/dns.h \
557565
@BUILD_WITH_SAFEC_TRUE@ ../src/include/err.h \
558566
@BUILD_WITH_SAFEC_TRUE@ ../src/include/example.h \
@@ -600,6 +608,7 @@ library_include_HEADERS = \
600608
../src/include/classify.h \
601609
../src/include/config.h \
602610
../src/include/dhcp.h \
611+
../src/include/dhcpv6.h \
603612
../src/include/dns.h \
604613
../src/include/err.h \
605614
../src/include/example.h \
@@ -771,6 +780,8 @@ clean-libLTLIBRARIES:
771780
../src/$(DEPDIR)/$(am__dirstamp)
772781
../src/libjoy_la-dhcp.lo: ../src/$(am__dirstamp) \
773782
../src/$(DEPDIR)/$(am__dirstamp)
783+
../src/libjoy_la-dhcpv6.lo: ../src/$(am__dirstamp) \
784+
../src/$(DEPDIR)/$(am__dirstamp)
774785
../src/libjoy_la-payload.lo: ../src/$(am__dirstamp) \
775786
../src/$(DEPDIR)/$(am__dirstamp)
776787
../src/libjoy_la-config.lo: ../src/$(am__dirstamp) \
@@ -818,6 +829,7 @@ distclean-compile:
818829
@AMDEP_TRUE@@am__include@ @am__quote@../src/$(DEPDIR)/libjoy_la-classify.Plo@am__quote@
819830
@AMDEP_TRUE@@am__include@ @am__quote@../src/$(DEPDIR)/libjoy_la-config.Plo@am__quote@
820831
@AMDEP_TRUE@@am__include@ @am__quote@../src/$(DEPDIR)/libjoy_la-dhcp.Plo@am__quote@
832+
@AMDEP_TRUE@@am__include@ @am__quote@../src/$(DEPDIR)/libjoy_la-dhcpv6.Plo@am__quote@
821833
@AMDEP_TRUE@@am__include@ @am__quote@../src/$(DEPDIR)/libjoy_la-dns.Plo@am__quote@
822834
@AMDEP_TRUE@@am__include@ @am__quote@../src/$(DEPDIR)/libjoy_la-example.Plo@am__quote@
823835
@AMDEP_TRUE@@am__include@ @am__quote@../src/$(DEPDIR)/libjoy_la-extractor.Plo@am__quote@
@@ -1066,6 +1078,13 @@ distclean-compile:
10661078
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
10671079
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjoy_la_CFLAGS) $(CFLAGS) -c -o ../src/libjoy_la-dhcp.lo `test -f '../src/dhcp.c' || echo '$(srcdir)/'`../src/dhcp.c
10681080

1081+
../src/libjoy_la-dhcpv6.lo: ../src/dhcpv6.c
1082+
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjoy_la_CFLAGS) $(CFLAGS) -MT ../src/libjoy_la-dhcpv6.lo -MD -MP -MF ../src/$(DEPDIR)/libjoy_la-dhcpv6.Tpo -c -o ../src/libjoy_la-dhcpv6.lo `test -f '../src/dhcpv6.c' || echo '$(srcdir)/'`../src/dhcpv6.c
1083+
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../src/$(DEPDIR)/libjoy_la-dhcpv6.Tpo ../src/$(DEPDIR)/libjoy_la-dhcpv6.Plo
1084+
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../src/dhcpv6.c' object='../src/libjoy_la-dhcpv6.lo' libtool=yes @AMDEPBACKSLASH@
1085+
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
1086+
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjoy_la_CFLAGS) $(CFLAGS) -c -o ../src/libjoy_la-dhcpv6.lo `test -f '../src/dhcpv6.c' || echo '$(srcdir)/'`../src/dhcpv6.c
1087+
10691088
../src/libjoy_la-payload.lo: ../src/payload.c
10701089
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjoy_la_CFLAGS) $(CFLAGS) -MT ../src/libjoy_la-payload.lo -MD -MP -MF ../src/$(DEPDIR)/libjoy_la-payload.Tpo -c -o ../src/libjoy_la-payload.lo `test -f '../src/payload.c' || echo '$(srcdir)/'`../src/payload.c
10711090
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../src/$(DEPDIR)/libjoy_la-payload.Tpo ../src/$(DEPDIR)/libjoy_la-payload.Plo

src/anon.c

+11-8
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ static unsigned int addr_is_in_set (const struct in_addr *a) {
242242
}
243243
return 0;
244244
}
245+
245246
/* determines number of bits in the subnet mask */
246247
static unsigned int bits_in_mask (void *a, unsigned int bytes) {
247248
unsigned int n = 0;
@@ -348,25 +349,27 @@ joy_status_e anon_init (const char *pathname, FILE *logfile) {
348349
return s;
349350
}
350351

351-
/** buffer used for anonymized data */
352-
static char hexout[33];
353-
354352
/**
355-
* \fn char *addr_get_anon_hexstring (const struct in_addr *a)
353+
* \fn char *addr_get_anon_hexstring (const struct in_addr *a, char *buffer, int size)
356354
* \param a address to be anonymized
355+
* \param buffer used to store anonymized data
356+
* \param size of buffer
357357
* \return pointer to the anonymized output
358358
*/
359-
char *addr_get_anon_hexstring (const struct in_addr *a) {
359+
void addr_get_anon_hexstring (const struct in_addr *a, char *buffer, int size) {
360360
unsigned char pt[16] = { 0, };
361361
unsigned char c[16];
362362

363+
/* must be IPV4_ANON_LEN bytes in length */
364+
if (size < IPV4_ANON_LEN)
365+
return;
366+
367+
memset_s(buffer, size, 0x00, size);
363368
memcpy_s(pt, sizeof(struct in_addr), a, sizeof(struct in_addr));
364369
AES_encrypt(pt, c, &key.enc_key);
365-
snprintf(hexout, 33, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
370+
snprintf(buffer, IPV4_ANON_LEN, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
366371
c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7],
367372
c[8], c[9], c[10], c[11], c[12], c[13], c[14], c[15]);
368-
369-
return hexout;
370373
}
371374

372375
/**

0 commit comments

Comments
 (0)