Re: [PATCH 09/39] wimax: provides user space with information needed when opening a WiMAX device

Inaky Perez-Gonzalez
2008-12-03T02:11:29Z

On Thursday 27 November 2008, Johannes Berg wrote:
> On Wed, 2008-11-26 at 15:07 -0800, Inaky Perez-Gonzalez wrote:
> > When user space wants to open a handle to a WiMAX device, it needs
> > information that is provided as a response to an "open" generic
> > netlink message.
>
> Why is this called "open" when it's not actually any opening that would
> be bracketed with "close"? It seems more like "get info" to me?

The naming is a remnant from when I didn't really understand genl
and there was actually a close; then it got reused to do the discovery
part, but now I am going to kill all that using the iw code you pointed
me to as a guide.

> > + result = -ENOMEM;
> > +static
> > +int wimax_gnl_doit_open(struct sk_buff *skb, struct genl_info *info)
> > +{
> > + int result;
> > + struct wimax_dev *wimax_dev;
> > +
> > + d_fnstart(3, NULL, "(skb %p info %p)\n", skb, info);
> > + result = -EPERM;
> > + if (security_netlink_recv(skb, CAP_NET_ADMIN))
> > + goto error_perm;
>
> Ehm, you can do that check by adding the flag below...

This was another consequence (as mentioned somewhere else) of me
not knowning how to use libnl properly; with that fixed, this is not
needed now and it is done with GENL_ADMIN_PERM in the policy flags.

Thanks,

--
Inaky