From c61c8f3766ae83abae998caf6bb72eec0acd948a Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Tue, 16 Aug 2016 08:08:06 +0200 Subject: [PATCH] Use udp_get_multicast_ttl/udp_set_multicast_ttl accessors where applicable --- src/api/sockets.c | 4 ++-- src/core/udp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/sockets.c b/src/api/sockets.c index db90e16c..440c446e 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -2019,7 +2019,7 @@ lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *opt if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_UDP) { return ENOPROTOOPT; } - *(u8_t*)optval = sock->conn->pcb.udp->mcast_ttl; + *(u8_t*)optval = udp_get_multicast_ttl(sock->conn->pcb.udp); LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IP, IP_MULTICAST_TTL) = %d\n", s, *(int *)optval)); break; @@ -2386,7 +2386,7 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_ #if LWIP_MULTICAST_TX_OPTIONS case IP_MULTICAST_TTL: LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, u8_t, NETCONN_UDP); - sock->conn->pcb.udp->mcast_ttl = (u8_t)(*(const u8_t*)optval); + udp_set_multicast_ttl(sock->conn->pcb.udp, (u8_t)(*(const u8_t*)optval)); break; case IP_MULTICAST_IF: { diff --git a/src/core/udp.c b/src/core/udp.c index 1e7766fc..9fc35876 100644 --- a/src/core/udp.c +++ b/src/core/udp.c @@ -852,7 +852,7 @@ udp_sendto_if_src_chksum(struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *d /* Determine TTL to use */ #if LWIP_MULTICAST_TX_OPTIONS - ttl = (ip_addr_ismulticast(dst_ip) ? pcb->mcast_ttl : pcb->ttl); + ttl = (ip_addr_ismulticast(dst_ip) ? udp_get_multicast_ttl(pcb) : pcb->ttl); #else /* LWIP_MULTICAST_TX_OPTIONS */ ttl = pcb->ttl; #endif /* LWIP_MULTICAST_TX_OPTIONS */ @@ -1134,7 +1134,7 @@ udp_new(void) memset(pcb, 0, sizeof(struct udp_pcb)); pcb->ttl = UDP_TTL; #if LWIP_MULTICAST_TX_OPTIONS - pcb->mcast_ttl = UDP_TTL; + udp_set_multicast_ttl(pcb, UDP_TTL); #endif /* LWIP_MULTICAST_TX_OPTIONS */ } return pcb;