Dear hackers, I have a case, when I need to pass a small argument to kernel, and receive large reply using getsockopt().
First I get the argument: char var[MAX]; ... if ((error = sooptcopyin(sopt, var, MAX, 2)) ... Then I push reply to it using sooptcopyout(). But userland receives it truncated to MAX. The problem lives in sooptcopyin() implementation, which changes sopt->sopt_valsize. Now, in my patch I solve this using bare copyin(). Another approach may be saving sopt->sopt_valsize before call to sooptcopyin(), and then restoring it. Not a nice solution however... The questions are: 1) Is it OK to use bare copyin()? Which hidden problems can arise? 2) Is that correct that soopcopy[in|out]() changes sopt's fields? -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE _______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"