From 878532a30de6d3a958a69ea7397a06d84933c8a1 Mon Sep 17 00:00:00 2001 From: jifl Date: Wed, 28 Jan 2009 23:58:15 +0000 Subject: [PATCH] * ipv4/inet_chksum.c, ipv4/lwip/inet_chksum.h: inet_chksum_pseudo_partial() is only used by UDPLITE at present, so conditionalise it. --- CHANGELOG | 4 ++++ src/core/ipv4/inet_chksum.c | 3 +++ src/include/ipv4/lwip/inet_chksum.h | 2 ++ 3 files changed, 9 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 61946841..4f2804fc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -19,6 +19,10 @@ HISTORY ++ New features: + 2009-01-28 Jonathan Larmour (suggested by Bill Bauerbach) + * ipv4/inet_chksum.c, ipv4/lwip/inet_chksum.h: inet_chksum_pseudo_partial() + is only used by UDPLITE at present, so conditionalise it. + 2008-12-03 Simon Goldschmidt (base on patch from Luca Ceresoli) * autoip.c: checked in (slightly modified) patch #6683: Customizable AUTOIP "seed" address. This should reduce AUTOIP conflicts if diff --git a/src/core/ipv4/inet_chksum.c b/src/core/ipv4/inet_chksum.c index de7b49d1..439c9760 100644 --- a/src/core/ipv4/inet_chksum.c +++ b/src/core/ipv4/inet_chksum.c @@ -327,6 +327,8 @@ inet_chksum_pseudo(struct pbuf *p, * @param proto_len length of the ip data part (used for checksum of pseudo header) * @return checksum (as u16_t) to be saved directly in the protocol header */ +/* Currently only used by UDPLITE, although this could change in the future. */ +#if LWIP_UDPLITE u16_t inet_chksum_pseudo_partial(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, @@ -377,6 +379,7 @@ inet_chksum_pseudo_partial(struct pbuf *p, LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): pbuf chain lwip_chksum()=%"X32_F"\n", acc)); return (u16_t)~(acc & 0xffffUL); } +#endif /* LWIP_UDPLITE */ /* inet_chksum: * diff --git a/src/include/ipv4/lwip/inet_chksum.h b/src/include/ipv4/lwip/inet_chksum.h index d7c74926..5cae59cb 100644 --- a/src/include/ipv4/lwip/inet_chksum.h +++ b/src/include/ipv4/lwip/inet_chksum.h @@ -46,9 +46,11 @@ u16_t inet_chksum_pbuf(struct pbuf *p); u16_t inet_chksum_pseudo(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, u8_t proto, u16_t proto_len); +#if LWIP_UDPLITE u16_t inet_chksum_pseudo_partial(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, u8_t proto, u16_t proto_len, u16_t chksum_len); +#endif #ifdef __cplusplus }