-
Notifications
You must be signed in to change notification settings - Fork 2.1k
lwip: add support for common netif API #9343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9a91dc6
to
17aed2a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not some change requests but rather request for explanation 😉
pkg/lwip/contrib/netif/lwip_netif.c
Outdated
res = dev->driver->get(dev, opt, netif->hwaddr, | ||
sizeof(netif->hwaddr)); | ||
if (res > 0) { | ||
netif->hwaddr_len = res; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this actually be different then the one reported by the get above? I would rather think that if this get fails the hwaddr_len should be set to 0
to indicate an error, as we cannot do so due to void function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, I guess this is copy-pasta from the GNRC version (where I did it a little differently). Will do as you proposed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, error-checking isn't necessary here at all, since this function is only called if the address was set on the driver. If the driver doesn't allow for this, netif->hwaddr
and netif->hwaddr_len
shouldn't be changed anyway (which they wouldn't if get()/set()
are implemented correctly by the driver ;-).
case NETOPT_IPV6_ADDR_REMOVE: | ||
return sizeof(ip6_addr_t); | ||
case NETOPT_IPV6_ADDR_FLAGS: | ||
return sizeof(uint8_t); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe its too early, but can these are no-ops, right? Can you please explain the reasoning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the WIP part of this PR ;-) the proper functions will be called here later.
switch (opt) { | ||
#if LWIP_IPV6 | ||
case NETOPT_IPV6_IID: | ||
return sizeof(eui64_t); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as for the set_opt
, I don't understand this - and I also think this is wrong because the docu says:
* @return Number of bytes written to @p value.
but here nothing is written to value
, or did I miss something?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and if this assumes value
is 0
: I would rather not count on that, and explicitly set the default value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the WIP part of this PR ;-) the proper functions will be called here later.
Dito
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
|
Contribution description
This adds support for our common netif API for lwIP. It is still WIP. TODOs:
Issues/PRs references
Addresses #9287