diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-02-24 18:43:26 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2021-02-24 18:43:26 +0100 |
commit | e0310d7e1d1f5a8b3b083442d56a1d5485880303 (patch) | |
tree | 41610d377a02b32c4f73e4cd68deb89ff30c71df /nDPIsrvd.c | |
parent | 0b5b177c14582dcaff854dda98db93c8d001682d (diff) |
Finalized examples/c-captured to dump packet bytes to PCAP for further analysis.
* Fixed memory holes in nDPId structs.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'nDPIsrvd.c')
-rw-r--r-- | nDPIsrvd.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/nDPIsrvd.c b/nDPIsrvd.c index 2e19c115a..030393bfd 100644 --- a/nDPIsrvd.c +++ b/nDPIsrvd.c @@ -61,7 +61,9 @@ static int log_to_stderr = 0; static char * pidfile = NULL; static char * json_sockpath = NULL; static char * serv_optarg = NULL; -static struct nDPIsrvd_address serv_address = { .raw.sa_family = 0xFFFF, }; +static struct nDPIsrvd_address serv_address = { + .raw.sa_family = 0xFFFF, +}; static int json_sockfd; static int serv_sockfd; static char * user = NULL; @@ -96,14 +98,16 @@ static int create_listen_sockets(void) if (bind(json_sockfd, (struct sockaddr *)&json_addr, sizeof(json_addr)) < 0) { unlink(json_sockpath); - syslog(LOG_DAEMON | LOG_ERR, "Error on binding UNIX socket (collector) to %s: %s", json_sockpath, strerror(errno)); + syslog(LOG_DAEMON | LOG_ERR, + "Error on binding UNIX socket (collector) to %s: %s", + json_sockpath, + strerror(errno)); return 1; } if (bind(serv_sockfd, &serv_address.raw, serv_address.size) < 0) { - syslog(LOG_DAEMON | LOG_ERR, - "Error on binding socket (distributor) to %s: %s", serv_optarg, strerror(errno)); + syslog(LOG_DAEMON | LOG_ERR, "Error on binding socket (distributor) to %s: %s", serv_optarg, strerror(errno)); unlink(json_sockpath); return 1; } @@ -326,7 +330,8 @@ int main(int argc, char ** argv) } errno = 0; - if (change_user_group(user, group, pidfile, json_sockpath, (serv_address.raw.sa_family == AF_UNIX ? serv_optarg : NULL)) != 0) + if (change_user_group( + user, group, pidfile, json_sockpath, (serv_address.raw.sa_family == AF_UNIX ? serv_optarg : NULL)) != 0) { if (errno != 0) { |