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
Upstream fixes: prefixlen for routes, support subnet routes, fix inet_pton retval tests #57
Conversation
connman/src/inet.c
Outdated
| * Don't add a routes for link-local or unspecified | ||
| * destination address coupled with unspecified gateway. | ||
| */ | ||
| if ((!host || is_addr_ll(AF_INET, (struct sockaddr *)&addr) || __connman_inet_is_any_addr(host, AF_INET)) |
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.
There is curious inconsistency between this function and ipv6 version. The latter null checks 'host' right at the start vs this one does not -> these added lines null check 'host' after it has already been used (ipv4) or when it has already been established that it is not null (ipv6).
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.
Yeah, I think that has passed upstream review without issues but indeed, that latter !host is unnecessary and could be removed. Not really sure if this particular commit is needed, though, since it had no effect on the issue at hand. And it is not part of any upstream release yet.
A part of testing routine that do these things affect the case at all. I think I'll drop this commit for later on, since the author of the commit experienced the issue only with virtual ethernet. That does not really apply to us.
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.
Dropped that patch. Let it simmer in upstream still. Does not seem to be urgent for us now.
[inet] Add prefixlen to iproute_default_function. JB#61508 Add prefixlen parameter to this function in preparation for using it also in creating subnet route later, e.g. default via 192.168.100.1 dev eth0 192.168.100.0/24 dev eth0
[inet] Implement subnet route creation/deletion in iproute_default_modify. JB#61508 - Calculate subnet address base on gateway address and prefixlen - Differentiate creation of routes to gateway and subnet
[connman] Test return value of inet_pton consistently. JB#61508 inet_pton return 1 on success and 0 or -1 on failure depending on the error it wants to return. Use either '== 1' or '!= 1' consistently to test if the call was succesfull. ConnMan doesn't destinguish between 0 and -1.
c776f52
to
d9ebe55
Compare
This syncs inet.c a bit closer to upstream by applying: