mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-03 21:14:40 +08:00
added proper accessor functions for pcb->multicast_ip (previously used by get/setsockopt only)
This commit is contained in:
parent
ec5cf8593e
commit
03159254ce
@ -202,6 +202,10 @@ HISTORY
|
|||||||
|
|
||||||
++ Bugfixes:
|
++ Bugfixes:
|
||||||
|
|
||||||
|
2015-02-22: Simon Goldschmidt
|
||||||
|
* udp.h, sockets.c: added proper accessor functions for pcb->multicast_ip
|
||||||
|
(previously used by get/setsockopt only)
|
||||||
|
|
||||||
2015-02-18: Simon Goldschmidt
|
2015-02-18: Simon Goldschmidt
|
||||||
* sockets.c: Fixed select not reporting received FIN as 'readable' in certain
|
* sockets.c: Fixed select not reporting received FIN as 'readable' in certain
|
||||||
rare cases (bug #43779: select(), close(), and TCP retransmission error)
|
rare cases (bug #43779: select(), close(), and TCP retransmission error)
|
||||||
@ -209,7 +213,7 @@ HISTORY
|
|||||||
2015-02-17: Simon Goldschmidt
|
2015-02-17: Simon Goldschmidt
|
||||||
* err.h, sockets.c, api_msg.c: fixed bug #38853 "connect() use a wrong errno":
|
* err.h, sockets.c, api_msg.c: fixed bug #38853 "connect() use a wrong errno":
|
||||||
return ERR_ALREADY/EALRADY during connect, ERR_ISCONN/EISCONN when already
|
return ERR_ALREADY/EALRADY during connect, ERR_ISCONN/EISCONN when already
|
||||||
connected
|
connected
|
||||||
|
|
||||||
2015-02-17: Simon Goldschmidt
|
2015-02-17: Simon Goldschmidt
|
||||||
* tcp_impl.h, tcp_out.c, tcp.c, api_msg.c: fixed bug #37614 "Errors from
|
* tcp_impl.h, tcp_out.c, tcp.c, api_msg.c: fixed bug #37614 "Errors from
|
||||||
|
@ -1784,7 +1784,7 @@ lwip_getsockopt_impl(int s, int level, int optname, void *optval, socklen_t *opt
|
|||||||
if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_UDP) {
|
if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_UDP) {
|
||||||
return ENOPROTOOPT;
|
return ENOPROTOOPT;
|
||||||
}
|
}
|
||||||
inet_addr_from_ipaddr((struct in_addr*)optval, &sock->conn->pcb.udp->multicast_ip);
|
inet_addr_from_ipaddr((struct in_addr*)optval, udp_get_multicast_netif_addr(sock->conn->pcb.udp));
|
||||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IP, IP_MULTICAST_IF) = 0x%"X32_F"\n",
|
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_getsockopt(%d, IPPROTO_IP, IP_MULTICAST_IF) = 0x%"X32_F"\n",
|
||||||
s, *(u32_t *)optval));
|
s, *(u32_t *)optval));
|
||||||
break;
|
break;
|
||||||
@ -2135,8 +2135,12 @@ lwip_setsockopt_impl(int s, int level, int optname, const void *optval, socklen_
|
|||||||
sock->conn->pcb.udp->ttl = (u8_t)(*(u8_t*)optval);
|
sock->conn->pcb.udp->ttl = (u8_t)(*(u8_t*)optval);
|
||||||
break;
|
break;
|
||||||
case IP_MULTICAST_IF:
|
case IP_MULTICAST_IF:
|
||||||
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, struct in_addr, NETCONN_UDP);
|
{
|
||||||
inet_addr_to_ipaddr(&sock->conn->pcb.udp->multicast_ip, (struct in_addr*)optval);
|
ip_addr_t if_addr;
|
||||||
|
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, struct in_addr, NETCONN_UDP);
|
||||||
|
inet_addr_to_ipaddr(&if_addr, (struct in_addr*)optval);
|
||||||
|
udp_set_multicast_netif_addr(sock->conn->pcb.udp, &if_addr);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case IP_MULTICAST_LOOP:
|
case IP_MULTICAST_LOOP:
|
||||||
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, u8_t, NETCONN_UDP);
|
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, u8_t, NETCONN_UDP);
|
||||||
|
@ -206,6 +206,11 @@ struct udp_pcb * udp_new_ip6(void);
|
|||||||
#endif /*LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */
|
#endif /*LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */
|
||||||
#endif /* LWIP_IPV6 */
|
#endif /* LWIP_IPV6 */
|
||||||
|
|
||||||
|
#if LWIP_IGMP
|
||||||
|
#define udp_set_multicast_netif_addr(pcb, ip4addr) ((pcb)->multicast_ip = *(ip4addr))
|
||||||
|
#define udp_get_multicast_netif_addr(pcb) (&(pcb)->multicast_ip)
|
||||||
|
#endif /* LWIP_IGMP */
|
||||||
|
|
||||||
#if UDP_DEBUG
|
#if UDP_DEBUG
|
||||||
void udp_debug_print(struct udp_hdr *udphdr);
|
void udp_debug_print(struct udp_hdr *udphdr);
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user