Am Sonntag, 10. Dezember 2006 13:15 schrieb Thomas Graf: > > Please send me the list of bugs you've spotted. Of course I want to fix > > them. > > Sure... > > static void nl_handlemsg(struct nlmsghdr *msg, unsigned int len) { > if (len < sizeof(*msg)) return; > > while(NLMSG_OK(msg,len)) { > if (nlcb_run && > nlcb_pid == msg->nlmsg_pid && > nlcb_seq == msg->nlmsg_seq) { > nlcb_function(msg, nlcb_args); > > Missing check for sufficient payload, family specific header > and attributes are accessed directly, you've only made sure > a netlink message header is present so far.
Yes, the code has quite some trust into the kernel that if it answers the asked question the answer is semantically correct. But to be fair, if you issue a write(), you also expect the number of bytes written in return and not the msec taken ;-) Will fix that and the other stuff you pointed out, thanks! Stefan - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html