Commit Diff
Diff:
556a6b05116eb2a3098e5d3d2887847ae30bdefb
f9743443dfd8adacceaf5bdbe471a1f7c82e38ef
Commit:
f9743443dfd8adacceaf5bdbe471a1f7c82e38ef
Tree:
e2bf89cba50db0ff8c9450b1912e79851a19132b
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Fri Jul 3 17:47:32 2020 UTC
Message:
close more descriptors in the forward parse engine
blob - b1daf75659d84fe501339977f04856000ff771d0
blob + 20002f112c01eff9e7f879f082b6e936e91a9783
--- delphinusdnsd.c
+++ delphinusdnsd.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: delphinusdnsd.c,v 1.111 2020/07/03 17:15:29 pjp Exp $
+ * $Id: delphinusdnsd.c,v 1.112 2020/07/03 17:47:32 pjp Exp $
*/
@@ -104,7 +104,7 @@ extern void unpack(char *, char *, int);
extern void add_rrlimit(int, u_int16_t *, int, char *);
extern void axfrloop(int *, int, char **, ddDB *, struct imsgbuf *);
-extern void forwardloop(ddDB *, struct cfg *, struct imsgbuf *);
+extern void forwardloop(ddDB *, struct cfg *, struct imsgbuf *, struct imsgbuf *);
extern void replicantloop(ddDB *, struct imsgbuf *);
extern struct question *build_fake_question(char *, int, u_int16_t, char *, int);
extern int check_ent(char *, int);
@@ -1008,8 +1008,10 @@ main(int argc, char *argv[], char *environ[])
cfg->dup[j] = dup[j];
}
+ cfg->sockcount = i;
+
setproctitle("FORWARD engine");
- forwardloop(db, cfg, ibuf);
+ forwardloop(db, cfg, ibuf, &cortex_ibuf);
/* NOTREACHED */
exit(1);
default:
blob - 9faaf07fd88ac4f7b734638628f2e9e7fa589c4e
blob + 8bf2e1c9d53d6d2da70c963c235366cc4d139d81
--- forward.c
+++ forward.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: forward.c,v 1.8 2020/07/03 17:14:03 pjp Exp $
+ * $Id: forward.c,v 1.9 2020/07/03 17:47:32 pjp Exp $
*/
#include <sys/types.h>
@@ -134,7 +134,7 @@ struct fwdpq {
void init_forward(void);
int insert_forward(int, struct sockaddr_storage *, uint16_t, char *);
-void forwardloop(ddDB *, struct cfg *, struct imsgbuf *);
+void forwardloop(ddDB *, struct cfg *, struct imsgbuf *, struct imsgbuf *);
void forwardthis(int, struct sforward *);
void sendit(struct forwardqueue *, struct sforward *);
void returnit(struct cfg *cfg, struct forwardqueue *, char *, int, struct imsgbuf *);
@@ -219,7 +219,7 @@ insert_forward(int family, struct sockaddr_storage *ip
}
void
-forwardloop(ddDB *db, struct cfg *cfg, struct imsgbuf *ibuf)
+forwardloop(ddDB *db, struct cfg *cfg, struct imsgbuf *ibuf, struct imsgbuf *cortex)
{
struct timeval tv;
struct imsg imsg;
@@ -254,6 +254,7 @@ forwardloop(ddDB *db, struct cfg *cfg, struct imsgbuf
close(cfg->dup[i]);
close(ibuf->fd);
+ close(cortex->fd);
close(pi[1]);
imsg_init(&parse_ibuf, pi[0]);
repomaster@centroid.eu