fixed compiling for various config combinations

This commit is contained in:
sg 2015-09-17 22:19:37 +02:00
parent 4f9bcc5ecc
commit 0454950564
5 changed files with 17 additions and 6 deletions

View File

@ -978,8 +978,10 @@ lwip_sendmsg(int s, const struct msghdr *msg, int flags)
struct netbuf *chain_buf;
u16_t remote_port;
int i;
#if LWIP_TCP
u8_t write_flags;
size_t written;
#endif
int size = 0;
err_t err = ERR_OK;
@ -1848,6 +1850,7 @@ lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *opt
case SOL_SOCKET:
switch (optname) {
#if LWIP_TCP
case SO_ACCEPTCONN:
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB(sock, *optlen, int);
if (NETCONNTYPE_GROUP(sock->conn->type) != NETCONN_TCP) {
@ -1859,6 +1862,7 @@ lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *opt
*(int*)optval = 0;
}
break;
#endif /* LWIP_TCP */
/* The option flags */
case SO_BROADCAST:

View File

@ -77,8 +77,8 @@
#if (!LWIP_UDP && LWIP_DHCP)
#error "If you want to use DHCP, you have to define LWIP_UDP=1 in your lwipopts.h"
#endif
#if (!LWIP_UDP && LWIP_IGMP)
#error "If you want to use IGMP, you have to define LWIP_UDP=1 in your lwipopts.h"
#if (!LWIP_UDP && LWIP_MULTICAST_TX_OPTIONS)
#error "If you want to use IGMP/LWIP_MULTICAST_TX_OPTIONS, you have to define LWIP_UDP=1 in your lwipopts.h"
#endif
#if (!LWIP_UDP && LWIP_SNMP)
#error "If you want to use SNMP, you have to define LWIP_UDP=1 in your lwipopts.h"

View File

@ -88,9 +88,6 @@ Steve Reynolds
#include "lwip/ip.h"
#include "lwip/inet_chksum.h"
#include "lwip/netif.h"
#include "lwip/icmp.h"
#include "lwip/udp.h"
#include "lwip/tcp.h"
#include "lwip/stats.h"
#include "string.h"

View File

@ -336,8 +336,10 @@ ip4_forward(struct pbuf *p, struct ip_hdr *iphdr, struct netif *inp)
/* @todo: send ICMP Destination Unreachable code 13 "Communication administratively prohibited"? */
#endif /* IP_FRAG */
} else {
#if LWIP_ICMP
/* send ICMP Destination Unreachable code 4: "Fragmentation Needed and DF Set" */
icmp_dest_unreach(p, ICMP_DUR_FRAG);
#endif /* LWIP_ICMP */
}
return;
}

View File

@ -108,10 +108,18 @@ void icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t);
#endif /* LWIP_IPV4 && LWIP_ICMP */
#if LWIP_IPV4 && LWIP_IPV6 && LWIP_ICMP6
#if LWIP_IPV4 && LWIP_IPV6
#if LWIP_ICMP && LWIP_ICMP6
#define icmp_port_unreach(isipv6, pbuf) ((isipv6) ? \
icmp6_dest_unreach(pbuf, ICMP6_DUR_PORT) : \
icmp_dest_unreach(pbuf, ICMP_DUR_PORT))
#elif LWIP_ICMP
#define icmp_port_unreach(isipv6, pbuf) do{ if(!(isipv6)) { icmp_dest_unreach(pbuf, ICMP_DUR_PORT);}}while(0)
#elif LWIP_ICMP6
#define icmp_port_unreach(isipv6, pbuf) do{ if(isipv6) { icmp6_dest_unreach(pbuf, ICMP6_DUR_PORT);}}while(0)
#else
#define icmp_port_unreach(isipv6, pbuf)
#endif
#elif LWIP_IPV6 && LWIP_ICMP6
#define icmp_port_unreach(isipv6, pbuf) icmp6_dest_unreach(pbuf, ICMP6_DUR_PORT)
#elif LWIP_IPV4 && LWIP_ICMP