diff options
| author | Michael Biebl <biebl@debian.org> | 2019-11-25 18:53:53 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2019-11-25 18:53:53 +0100 |
| commit | e22609983008e1a669196ad64ba3a59ae8c76e0d (patch) | |
| tree | c5b97693244d5004cbe735d507a25159512a753d /shared | |
| parent | 9c642eac191ef0dce49855d8da0a9e9af18d5113 (diff) | |
New upstream version 1.20.8 upstream/1.20.8
Diffstat (limited to 'shared')
| -rw-r--r-- | shared/n-dhcp4/src/n-dhcp4-c-lease.c | 14 | ||||
| -rw-r--r-- | shared/n-dhcp4/src/n-dhcp4.h | 1 | ||||
| -rw-r--r-- | shared/nm-version-macros.h | 2 |
3 files changed, 16 insertions, 1 deletions
diff --git a/shared/n-dhcp4/src/n-dhcp4-c-lease.c b/shared/n-dhcp4/src/n-dhcp4-c-lease.c index 208ad92a..c14a9daf 100644 --- a/shared/n-dhcp4/src/n-dhcp4-c-lease.c +++ b/shared/n-dhcp4/src/n-dhcp4-c-lease.c @@ -204,6 +204,20 @@ _c_public_ void n_dhcp4_client_lease_get_yiaddr(NDhcp4ClientLease *lease, struct } /** + * n_dhcp4_client_lease_get_siaddr() - get the server IP address + * @lease: the lease to operate on + * @siaddr: return argument for the IP address + * + * Gets the server IP address cotained in the lease. Or INADDR_ANY if the + * lease does not contain an IP address. + */ +_c_public_ void n_dhcp4_client_lease_get_siaddr(NDhcp4ClientLease *lease, struct in_addr *siaddr) { + NDhcp4Header *header = n_dhcp4_incoming_get_header(lease->message); + + siaddr->s_addr = header->siaddr; +} + +/** * n_dhcp4_client_lease_get_lifetime() - get the lifetime * @lease: the lease to operate on * @ns_lifetimep: return argument for the lifetime in nano seconds diff --git a/shared/n-dhcp4/src/n-dhcp4.h b/shared/n-dhcp4/src/n-dhcp4.h index 58a3cb80..ef75eca7 100644 --- a/shared/n-dhcp4/src/n-dhcp4.h +++ b/shared/n-dhcp4/src/n-dhcp4.h @@ -156,6 +156,7 @@ NDhcp4ClientLease *n_dhcp4_client_lease_ref(NDhcp4ClientLease *lease); NDhcp4ClientLease *n_dhcp4_client_lease_unref(NDhcp4ClientLease *lease); void n_dhcp4_client_lease_get_yiaddr(NDhcp4ClientLease *lease, struct in_addr *yiaddr); +void n_dhcp4_client_lease_get_siaddr(NDhcp4ClientLease *lease, struct in_addr *siaddr); void n_dhcp4_client_lease_get_lifetime(NDhcp4ClientLease *lease, uint64_t *ns_lifetimep); int n_dhcp4_client_lease_query(NDhcp4ClientLease *lease, uint8_t option, uint8_t **datap, size_t *n_datap); diff --git a/shared/nm-version-macros.h b/shared/nm-version-macros.h index 417d7bfc..f1f44713 100644 --- a/shared/nm-version-macros.h +++ b/shared/nm-version-macros.h @@ -44,7 +44,7 @@ * Evaluates to the micro version number of NetworkManager which this source * compiled against. */ -#define NM_MICRO_VERSION (6) +#define NM_MICRO_VERSION (8) /** * NM_CHECK_VERSION: |