Skip to contentSkip to conversation

NL80211_ATTR_PAD question

DISCUSSION Ben Greear 3 participants 6 messages Jun 10, 2016 – Jun 21, 2016

lore
Share & tools
lore

Ben Greear

author
#0 lore raw

I see this was added sometime recently: NL80211_ATTR_PAD

If another enum member is added, should it replace the PAD enum?

At the least, I think we need some comments about how this is to be dealt with.

Thanks,
Ben

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
#1 lore raw
Quoted 3 lines · Ben Greear

I see this was added sometime recently: NL80211_ATTR_PAD

If another enum member is added, should it replace the PAD enum?

Nope. This attribute is used as padattr by 64-bit aligned netlink functions, ie. nla_put_u64_64bit().

Quoted 4 lines

At the least, I think we need some comments about how this is to be dealt with.

* @NL80211_ATTR_PAD: attribute used for padding for 64-bit alignment

This could indeed use a bit more explanation.

Regards,
Arend

#2 lore raw
In reply to Ben Greear
Quoted 3 lines · Ben Greear

I see this was added sometime recently:  NL80211_ATTR_PAD

If another enum member is added, should it replace the PAD enum?

No.

Quoted 3 lines

At the least, I think we need some comments about how this is to be dealt with.

You simply ignore it :)

johannes

author
#3 lore raw
Quoted 5 lines · Johannes Berg
Quoted 3 lines · Ben Greear

I see this was added sometime recently: NL80211_ATTR_PAD

If another enum member is added, should it replace the PAD enum?

Quoted 7 lines

No.

Quoted 3 lines

At the least, I think we need some comments about how this is to be dealt with.

You simply ignore it :)

Please add a comment...it is normal behaviour to fill in 'pads' when possible, and even when I looked up the commit message it wasn't exactly clear what this member was for.

Even reading nla_put_u64_64bit offers no useful clues...I didn't follow the call chain longer, probably somewhere it would start making sense, but then again, this is netlink code, so who knows!

Thanks,
Ben

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
#4 lore raw
In reply to Johannes Berg
Quoted 5 lines · Johannes Berg
Quoted 3 lines · Ben Greear

I see this was added sometime recently: NL80211_ATTR_PAD

If another enum member is added, should it replace the PAD enum?

Quoted 7 lines

No.

Quoted 3 lines

At the least, I think we need some comments about how this is to be dealt with.

You simply ignore it :)

So do you know why the caller of nla_put_u64_64bit() would need to specify the padattr. I mean, why is this not an generic attribute that netlink deals with internally. It has probably been discussed on the netdev list but I could not find the right thread.

Regards,
Arend

#5 lore raw
Quoted 14 lines · Arend van Spriel
Quoted 12 lines · Johannes Berg
Quoted 3 lines · Ben Greear

I see this was added sometime recently:  NL80211_ATTR_PAD

If another enum member is added, should it replace the PAD enum?

No.

Quoted 4 lines

At the least, I think we need some comments about how this is to be
dealt with.

Quoted 8 lines
Quoted 1 line

You simply ignore it :)

So do you know why the caller of nla_put_u64_64bit() would need to specify the padattr. I mean, why is this not an generic attribute that
netlink deals with internally. It has probably been discussed on the netdev list but I could not find the right thread.

Netlink attribute numbers are always specific to the (generic) netlink family used. There was a discussion about using the attribute number 0 since that's reserved, but unfortunately it's only reserved in *most* families, some actually use it (despite that being broken with libnl.)

johannes