diff options
Diffstat (limited to 'ipme.c')
| -rw-r--r-- | ipme.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -56,7 +56,7 @@ int ipme_init() | |||
| 56 | if (!ipalloc_append(&ipme,&ix)) { return 0; } | 56 | if (!ipalloc_append(&ipme,&ix)) { return 0; } |
| 57 | if ((s = socket(AF_INET,SOCK_STREAM,0)) == -1) return -1; | 57 | if ((s = socket(AF_INET,SOCK_STREAM,0)) == -1) return -1; |
| 58 | 58 | ||
| 59 | len = 256; | 59 | len = 8192; /* any value big enough to get all the interfaces in one read is good */ |
| 60 | for (;;) { | 60 | for (;;) { |
| 61 | if (!stralloc_ready(&buf,len)) { close(s); return 0; } | 61 | if (!stralloc_ready(&buf,len)) { close(s); return 0; } |
| 62 | buf.len = 0; | 62 | buf.len = 0; |
| @@ -68,7 +68,7 @@ int ipme_init() | |||
| 68 | break; | 68 | break; |
| 69 | } | 69 | } |
| 70 | if (len > 200000) { close(s); return -1; } | 70 | if (len > 200000) { close(s); return -1; } |
| 71 | len += 100 + (len >> 2); | 71 | len *= 2; |
| 72 | } | 72 | } |
| 73 | x = buf.s; | 73 | x = buf.s; |
| 74 | while (x < buf.s + buf.len) { | 74 | while (x < buf.s + buf.len) { |
