diff options
author | Baruch Siach | 2011-09-07 17:52:37 +0200 |
---|---|---|
committer | Denys Vlasenko | 2011-09-07 17:55:40 +0200 |
commit | e8f36330d9bb27f9f7e66aa6f01ff92c07d86f62 (patch) | |
tree | 863018163a166cc690902d8027a3f04f9f812dd3 /networking/udhcp/dhcpc.c | |
parent | 8c84f7545cf08925edb23d94d9f6519b338267c6 (diff) | |
download | busybox-e8f36330d9bb27f9f7e66aa6f01ff92c07d86f62.zip busybox-e8f36330d9bb27f9f7e66aa6f01ff92c07d86f62.tar.gz |
networking: consolidate the IP checksum code. -129 bytes.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r-- | networking/udhcp/dhcpc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index 4d755e6..3be09f4 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c @@ -739,7 +739,7 @@ static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd) /* verify IP checksum */ check = packet.ip.check; packet.ip.check = 0; - if (check != udhcp_checksum(&packet.ip, sizeof(packet.ip))) { + if (check != inet_cksum((uint16_t *)&packet.ip, sizeof(packet.ip))) { log1("Bad IP header checksum, ignoring"); return -2; } @@ -750,7 +750,7 @@ static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd) packet.ip.tot_len = packet.udp.len; /* yes, this is needed */ check = packet.udp.check; packet.udp.check = 0; - if (check && check != udhcp_checksum(&packet, bytes)) { + if (check && check != inet_cksum((uint16_t *)&packet, bytes)) { log1("Packet with bad UDP checksum received, ignoring"); return -2; } |