[systemd-devel] [PATCH 01/11] libsystemd-dhcp: Use be32_t for IP addresses in network order.

Patrik Flykt patrik.flykt at linux.intel.com
Fri Dec 20 07:16:10 PST 2013


---
 src/libsystemd-dhcp/dhcp-client.c   |   10 +++++-----
 src/libsystemd-dhcp/dhcp-protocol.h |    8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/libsystemd-dhcp/dhcp-client.c b/src/libsystemd-dhcp/dhcp-client.c
index c0c348c..fe41067 100644
--- a/src/libsystemd-dhcp/dhcp-client.c
+++ b/src/libsystemd-dhcp/dhcp-client.c
@@ -36,10 +36,10 @@ struct DHCPLease {
         uint32_t t1;
         uint32_t t2;
         uint32_t lifetime;
-        uint32_t address;
-        uint32_t server_address;
-        uint32_t subnet_mask;
-        uint32_t router;
+        be32_t address;
+        be32_t server_address;
+        be32_t subnet_mask;
+        be32_t router;
 };
 
 typedef struct DHCPLease DHCPLease;
@@ -54,7 +54,7 @@ struct sd_dhcp_client {
         sd_event_source *receive_message;
         uint8_t *req_opts;
         size_t req_opts_size;
-        uint32_t last_addr;
+        be32_t last_addr;
         struct ether_addr mac_addr;
         uint32_t xid;
         usec_t start_time;
diff --git a/src/libsystemd-dhcp/dhcp-protocol.h b/src/libsystemd-dhcp/dhcp-protocol.h
index 1e59965..76621f5 100644
--- a/src/libsystemd-dhcp/dhcp-protocol.h
+++ b/src/libsystemd-dhcp/dhcp-protocol.h
@@ -36,10 +36,10 @@ struct DHCPMessage {
         be32_t xid;
         be16_t secs;
         be16_t flags;
-        uint32_t ciaddr;
-        uint32_t yiaddr;
-        uint32_t siaddr;
-        uint32_t giaddr;
+        be32_t ciaddr;
+        be32_t yiaddr;
+        be32_t siaddr;
+        be32_t giaddr;
         uint8_t chaddr[16];
         uint8_t sname[64];
         uint8_t file[128];
-- 
1.7.10.4



More information about the systemd-devel mailing list