mirror of https://github.com/F-Stack/f-stack.git
Fix buf: freebsd sysctl config not work.
This commit is contained in:
parent
3b14d13555
commit
6dbdb4c147
|
@ -73,15 +73,14 @@ net.inet.tcp.fast_finwait2_recycle=1
|
|||
net.inet.tcp.sendspace=16384
|
||||
net.inet.tcp.recvspace=8192
|
||||
net.inet.tcp.nolocaltimewait=1
|
||||
net.inet.tcp.cc.algorithm=htcp
|
||||
net.inet.tcp.cc.algorithm=cubic
|
||||
net.inet.tcp.sendbuf_max=16777216
|
||||
net.inet.tcp.recvbuf_max=16777216
|
||||
net.inet.tcp.sendbuf_auto=1
|
||||
net.inet.tcp.recvbuf_auto=1
|
||||
net.inet.tcp.sendbuf_inc=16384
|
||||
net.inet.tcp.recvbuf_inc=524288
|
||||
net.inet.tcp.inflight.enable=0
|
||||
net.inet.tcp.sack=1
|
||||
net.inet.tcp.sack.enable=1
|
||||
net.inet.tcp.blackhole=1
|
||||
net.inet.tcp.msl=2000
|
||||
net.inet.tcp.delayed_ack=0
|
||||
|
|
|
@ -169,10 +169,17 @@ freebsd_conf_handler(struct ff_config *cfg, const char *section,
|
|||
cur = &cfg->freebsd.sysctl;
|
||||
|
||||
if (is_integer(value)) {
|
||||
int *p = (int *)malloc(sizeof(int));
|
||||
*p = atoi(value);
|
||||
newconf->value = (void *)p;
|
||||
newconf->vlen = sizeof(*p);
|
||||
if (strcmp(name, "kern.ipc.maxsockbuf") == 0) {
|
||||
long *p = (long *)malloc(sizeof(long));
|
||||
*p = atol(value);
|
||||
newconf->value = (void *)p;
|
||||
newconf->vlen = sizeof(*p);
|
||||
} else {
|
||||
int *p = (int *)malloc(sizeof(int));
|
||||
*p = atoi(value);
|
||||
newconf->value = (void *)p;
|
||||
newconf->vlen = sizeof(*p);
|
||||
}
|
||||
} else {
|
||||
newconf->value = (void *)newconf->str;
|
||||
newconf->vlen = strlen(value);
|
||||
|
@ -183,10 +190,11 @@ freebsd_conf_handler(struct ff_config *cfg, const char *section,
|
|||
}
|
||||
|
||||
if (*cur == NULL) {
|
||||
newconf->next = NULL;
|
||||
*cur = newconf;
|
||||
} else {
|
||||
newconf->next = (*cur)->next;
|
||||
(*cur)->next = newconf;
|
||||
newconf->next = NULL;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue