about summary refs log tree commit diff
path: root/shared
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2019-11-25 18:54:42 +0100
committerMichael Biebl <biebl@debian.org>2019-11-25 18:54:42 +0100
commit56e2e0e97cd4786bf3b1f7fd607d4a9e4fc6bc8d (patch)
tree43de6f27b10e23ff907dbe4e2c8fe0e52f01b13b /shared
parent85b54c33239239aa9ec8ff2f128f25a72dd587e1 (diff)
parente22609983008e1a669196ad64ba3a59ae8c76e0d (diff)
Update upstream source from tag 'upstream/1.20.8'
Update to upstream version '1.20.8'
with Debian dir 5fbac145116049621c01e7eb75da24ed4f79d25e
Diffstat (limited to 'shared')
-rw-r--r--shared/n-dhcp4/src/n-dhcp4-c-lease.c14
-rw-r--r--shared/n-dhcp4/src/n-dhcp4.h1
-rw-r--r--shared/nm-version-macros.h2
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: