mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-09 02:40:26 +01:00
network: add sd_dhcp_route_get_option() accessor
Since sd_dhcp_lease_get_routes() returns the list of all routes, the caller may need to differenciate whether the route was option 33 (static-routes) or 121 (classless-static-route). Add an accessor for the internal field. systemd-pull-request: #10951
This commit is contained in:
parent
b05ebd54b7
commit
795facc2ba
2 changed files with 7 additions and 0 deletions
|
|
@ -1301,3 +1301,9 @@ int sd_dhcp_route_get_gateway(sd_dhcp_route *route, struct in_addr *gateway) {
|
|||
*gateway = route->gw_addr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sd_dhcp_route_get_option(sd_dhcp_route *route) {
|
||||
assert_return(route, -EINVAL);
|
||||
|
||||
return route->option;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ int sd_dhcp_lease_get_timezone(sd_dhcp_lease *lease, const char **timezone);
|
|||
int sd_dhcp_route_get_destination(sd_dhcp_route *route, struct in_addr *destination);
|
||||
int sd_dhcp_route_get_destination_prefix_length(sd_dhcp_route *route, uint8_t *length);
|
||||
int sd_dhcp_route_get_gateway(sd_dhcp_route *route, struct in_addr *gateway);
|
||||
int sd_dhcp_route_get_option(sd_dhcp_route *route);
|
||||
|
||||
_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_dhcp_lease, sd_dhcp_lease_unref);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue