site_archiver@lists.apple.com Delivered-To: Darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=Q69hiyS6fAfIajb2rEiDUCBTXbLSNn774+wpZaCpWPY=; b=gEpd+IYrZThs11s0hedMHGK9EU+jIlA5W3+kRI/XgS92dph7U0g3ZLO8yqJs6BhM6J c9mqmuPJfwrxDzNSPdW6R3f8LcYEfnQiHZP1RyK6oPWUstlNt5NUq6m7HOrUpQducZDF ydOamZX3F5uSXpbdd1d2FGcD+2LaAv5/xkLU4= Hello, I am working on a Network Kernel Extension that re-injects packets after they have been captured with an IP Filter. However, the re-injection doesn't work. ipf_inject_input always returns error code 45, which means "Operation not supported". What am I doing wrong? Here is my setup and (simplified) code: mbuf_t *saved_packet = NULL; // function called by ip filter when new ip packet arrives errno_t input_fn(void *cookie, mbuf_t *data, int offset, u_int8_t protocol) { // test, if packet is interesting for us // [...] if (saved_packet != NULL) { // Drop return -1; } // keep reference to packet for later injection saved_packet = data; // send packet to usermode for further processing mbuf_t new_mbuf; mbuf_dup(*data, MBUF_WAITOK, &new_mbuf); if (ctl_enqueuembuf(ctlref, ctrl_unit, new_mbuf, 0) != 0) { // error, drop packet saved_packet = NULL; retrun -1; } // EJUSTRETURN = the packet will not be freed return EJUSTRETURN; } // function called when usermode sends processing result back errno_t ctl_send_fn(kern_ctl_ref kctlref, u_int32_t unit, void *unitinfo, mbuf_t m, int flags) { int result; mbuf_copydata(m, 0, sizeof(result), &result); if (result == 1) { // the following call returns 45 ("Operation not supported") - WHY?? errno_t errno = ipf_inject_input(*saved_packet, installed_filter); saved_packet = NULL; } else { // [...] } return 0; } Where is my mistake? Your help is greatly appreciated! Mike _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com