From: Patrick McHardy <kaber@trash.net>
To: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2005@gmx.net>
Cc: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Subject: Re: struct nf_sockopt_ops
Date: Mon, 18 Apr 2005 00:05:05 +0200 [thread overview]
Message-ID: <4262DD91.20203@trash.net> (raw)
In-Reply-To: <426121BC.2040808@gmx.net>
Carl-Daniel Hailfinger wrote:
> Forgive me if that has already been discussed.
>
> I'm wondering why the get and set members of the struct take
> some form of int as last parameter. Wouldn't be a long be the
> more logical choice? I can see changing the type here wouldn't
> help because nf_sockopt also accepting only an int for len.
>
> struct nf_sockopt_ops
> {
> /* snip */
> int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len);
> /* snip */
> int (*get)(struct sock *sk, int optval, void __user *user, int *len);
> /* snip */
> };
>
> Or at least the last parameter of the set member being a
> signed int to match the parameter to nf_sockopt.
>
> Any insight into why the parameters were chosen that way
> would be truly appreciated.
For compatibility. setsockopt(2):
The fifth argument of getsockopt and setsockopt is in reality an int
[*] (and this is what BSD 4.* and libc4 and libc5 have). Some POSIX
confusion resulted in the present socklen_t, also used by glibc. See
also accept(2).
Regards
Patrick
prev parent reply other threads:[~2005-04-17 22:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-16 14:31 struct nf_sockopt_ops Carl-Daniel Hailfinger
2005-04-17 22:05 ` Patrick McHardy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4262DD91.20203@trash.net \
--to=kaber@trash.net \
--cc=c-d.hailfinger.devel.2005@gmx.net \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.