Changing pf to use kmalloc instead of zalloc

看板DFBSD_kernel作者時間15年前 (2011/01/21 17:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/7 (看更多)
I created a patch set that will convert pf to use kmalloc instead of zalloc (with an intermediate step to use objcache). The module with kmalloc compiles and loads fine so far, just I can't load the ruleset anymore, pfctl chokes on df386devel# pfctl -ef /etc/pf.conf pfctl: DIOCSETLIMIT pfctl: DIOCSETLIMIT The relevant parts are in pfctl.c: int pfctl_load_limit(struct pfctl *pf, unsigned int his_index, unsigned int limit) { struct pfioc_limit pl; memset(&pl, 0, sizeof(pl)); pl.index = his_index; pl.limit = limit; if (ioctl(pf->dev, DIOCSETLIMIT, &pl)) { if (errno == EBUSY) warnx("Current pool size exceeds requested hard limit"); else warnx("DIOCSETLIMIT"); return (1); } return (0); } in pf_ioctl.c: case DIOCSETLIMIT: { struct pfioc_limit *pl = (struct pfioc_limit *)addr; int old_limit; if (pl->index < 0 || pl->index >= PF_LIMIT_MAX || pf_pool_limits[pl->index].pp == NULL) { error = EINVAL; goto fail; } /* XXX Get an API to set limits on the zone/pool */ old_limit = pf_pool_limits[pl->index].limit; pf_pool_limits[pl->index].limit = pl->limit; pl->limit = old_limit; break; } and in pfvar.h: #define DIOCSETLIMIT _IOWR('D', 40, struct pfioc_limit) I am at a loss here on how to proceed. Would it be ok to have DIOCSETLIMIT always return true because I am not using pools anymore? Or just don't call pfctl_load_limit() in pfctl anymore? Need help! :) Jan -- professional: http://www.oscar-consult.de private: http://neslonek.homeunix.org/drupal/
文章代碼(AID): #1DEKjLYM (DFBSD_kernel)
討論串 (同標題文章)
文章代碼(AID): #1DEKjLYM (DFBSD_kernel)