From 874bfe19d23753fd3b9a545e4af6c0ee4ec363aa Mon Sep 17 00:00:00 2001 From: goldsimon Date: Tue, 6 Mar 2007 15:27:58 +0000 Subject: [PATCH] Reduce code size: don't include code in those files if IP_FRAG == 0 and IP_REASSEMBLY == 0 --- CHANGELOG | 4 ++++ src/core/ipv4/ip_frag.c | 4 ++++ src/include/ipv4/lwip/ip_frag.h | 6 ++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index bf72e831..34cff580 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -38,6 +38,10 @@ HISTORY ++ Bug fixes: + 2007-03-06 Simon Goldschmidt + * ip_frag.c, ip_frag.h: Reduce code size: don't include code in those files + if IP_FRAG == 0 and IP_REASSEMBLY == 0 + 2007-03-06 Frédéric Bernon, Simon Goldschmidt * opt.h, ip_frag.h, tcpip.h, tcpip.c, ethernetif.c: add new configuration option named ETHARP_TCPIP_ETHINPUT, which enable the new tcpip_ethinput. diff --git a/src/core/ipv4/ip_frag.c b/src/core/ipv4/ip_frag.c index d5523557..94ec8e2c 100644 --- a/src/core/ipv4/ip_frag.c +++ b/src/core/ipv4/ip_frag.c @@ -37,6 +37,8 @@ * */ +#if (IP_FRAG || IP_REASSEMBLY) + #include #include "lwip/opt.h" @@ -386,3 +388,5 @@ ip_frag(struct pbuf *p, struct netif *netif, struct ip_addr *dest) snmp_inc_ipfragoks(); return ERR_OK; } + +#endif /* IP_FRAG || IP_REASSEMBLY */ diff --git a/src/include/ipv4/lwip/ip_frag.h b/src/include/ipv4/lwip/ip_frag.h index 6153aa13..e9f0a365 100644 --- a/src/include/ipv4/lwip/ip_frag.h +++ b/src/include/ipv4/lwip/ip_frag.h @@ -33,6 +33,8 @@ #ifndef __LWIP_IP_FRAG_H__ #define __LWIP_IP_FRAG_H__ +#if (IP_FRAG || IP_REASSEMBLY) + #include "lwip/opt.h" #include "lwip/err.h" #include "lwip/pbuf.h" @@ -47,6 +49,6 @@ void ip_reass_tmr(void); struct pbuf * ip_reass(struct pbuf *p); err_t ip_frag(struct pbuf *p, struct netif *netif, struct ip_addr *dest); +#endif /* IP_FRAG || IP_REASSEMBLY */ + #endif /* __LWIP_IP_FRAG_H__ */ - -