summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2013-12-20 17:16:16 +0200
committerTom Gundersen <teg@jklm.no>2013-12-22 14:28:00 +0100
commit2fba7b03b515b842f5a33d9e1ec46bfa7767d393 (patch)
treef4ab4e5e38345b6b1ea7b758dccba681269b4eb7 /src
parent0c6a3c888abd720b5ab28162d1ba4eadffde5272 (diff)
libsystemd-dhcp: Check test result without casting value
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd-dhcp/test-dhcp-client.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/libsystemd-dhcp/test-dhcp-client.c b/src/libsystemd-dhcp/test-dhcp-client.c
index 7400cc6837..1ff78c1144 100644
--- a/src/libsystemd-dhcp/test-dhcp-client.c
+++ b/src/libsystemd-dhcp/test-dhcp-client.c
@@ -119,13 +119,7 @@ static void test_checksum(void)
0xff, 0xff, 0xff, 0xff
};
- uint8_t check[2] = {
- 0x78, 0xae
- };
-
- uint16_t *val = (uint16_t *)check;
-
- assert(client_checksum(&buf, 20) == *val);
+ assert(client_checksum(&buf, 20) == be16toh(0x78ae));
}
static int check_options(uint8_t code, uint8_t len, const uint8_t *option,