Thanks to Markus Stenberg for debugging and testing.
Signed-off-by: Steven Barth <steven@midlink.org>
static void
cmdline(void)
{
static void
cmdline(void)
{
int r, fd = open("/proc/cmdline", O_RDONLY);
regex_t pat_cmdline;
regmatch_t matches[2];
int r, fd = open("/proc/cmdline", O_RDONLY);
regex_t pat_cmdline;
regmatch_t matches[2];
void hotplug(char *rules)
{
struct sockaddr_nl nls;
void hotplug(char *rules)
{
struct sockaddr_nl nls;
+ int nlbufsize = 512 * 1024;
rule_file = strdup(rules);
memset(&nls,0,sizeof(struct sockaddr_nl));
rule_file = strdup(rules);
memset(&nls,0,sizeof(struct sockaddr_nl));
+ if (setsockopt(hotplug_fd.fd, SOL_SOCKET, SO_RCVBUFFORCE, &nlbufsize, sizeof(nlbufsize))) {
+ ERROR("Failed to resize receive buffer: %s\n", strerror(errno));
+ exit(1);
+ }
+
json_script_init(&jctx);
queue_proc.cb = queue_proc_cb;
uloop_fd_add(&hotplug_fd, ULOOP_READ);
json_script_init(&jctx);
queue_proc.cb = queue_proc_cb;
uloop_fd_add(&hotplug_fd, ULOOP_READ);