chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0c6a3c8
)
libsystemd-dhcp: Check test result without casting value
author
Patrik Flykt
<patrik.flykt@linux.intel.com>
Fri, 20 Dec 2013 15:16:16 +0000
(17:16 +0200)
committer
Tom Gundersen
<teg@jklm.no>
Sun, 22 Dec 2013 13:28:00 +0000
(14:28 +0100)
src/libsystemd-dhcp/test-dhcp-client.c
patch
|
blob
|
history
diff --git
a/src/libsystemd-dhcp/test-dhcp-client.c
b/src/libsystemd-dhcp/test-dhcp-client.c
index 7400cc6837e72b48fd22692d031f7beab871cab9..1ff78c11440cec7a1db19efeeec367bf1bb20d3d 100644
(file)
--- 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
};
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,
}
static int check_options(uint8_t code, uint8_t len, const uint8_t *option,