First of all, identify the client

This commit is contained in:
Job Snijders
2019-12-30 02:24:19 +00:00
parent e3d00a8e5f
commit d97ced248a

View File

@@ -827,6 +827,13 @@ bgpq_expand(struct bgpq_expander* b)
exit(1);
};
if(b->identify) {
char ident[128];
snprintf(ident,sizeof(ident),"!n" PACKAGE_STRING "\n");
write(fd, ident, strlen(ident));
read(fd, ident, sizeof(ident));
};
if(b->sources && b->sources[0]!=0) {
int slen = strlen(b->sources)+4;
if (slen < 128)
@@ -845,13 +852,6 @@ bgpq_expand(struct bgpq_expander* b)
};
};
if(b->identify) {
char ident[128];
snprintf(ident,sizeof(ident),"!n" PACKAGE_STRING "\n");
write(fd, ident, strlen(ident));
read(fd, ident, sizeof(ident));
};
if (pipelining)
fcntl(fd, F_SETFL, O_NONBLOCK|(fcntl(fd, F_GETFL)));