mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-19 05:10:40 +00:00
fixed bug #41680 raw socket can not receive IPv6 packet when IP_SOF_BROADCAST_RECV==1
This commit is contained in:
parent
c60635855d
commit
d9d0c52770
@ -96,6 +96,10 @@ HISTORY
|
|||||||
|
|
||||||
++ Bugfixes:
|
++ Bugfixes:
|
||||||
|
|
||||||
|
2014-02-27: Simon Goldschmidt
|
||||||
|
* raw.c: fixed bug #41680 raw socket can not receive IPv6 packet when
|
||||||
|
IP_SOF_BROADCAST_RECV==1
|
||||||
|
|
||||||
2014-02-27: Simon Goldschmidt
|
2014-02-27: Simon Goldschmidt
|
||||||
* api_msg.c, sockets.c: fixed bug #38404 getpeeraddr returns success on
|
* api_msg.c, sockets.c: fixed bug #38404 getpeeraddr returns success on
|
||||||
unconnected/listening TCP sockets
|
unconnected/listening TCP sockets
|
||||||
|
@ -82,18 +82,15 @@ raw_input(struct pbuf *p, struct netif *inp)
|
|||||||
struct ip_hdr *iphdr;
|
struct ip_hdr *iphdr;
|
||||||
s16_t proto;
|
s16_t proto;
|
||||||
u8_t eaten = 0;
|
u8_t eaten = 0;
|
||||||
#if LWIP_IPV6
|
|
||||||
struct ip6_hdr *ip6hdr;
|
|
||||||
#endif /* LWIP_IPV6 */
|
|
||||||
|
|
||||||
|
|
||||||
LWIP_UNUSED_ARG(inp);
|
LWIP_UNUSED_ARG(inp);
|
||||||
|
|
||||||
iphdr = (struct ip_hdr *)p->payload;
|
iphdr = (struct ip_hdr *)p->payload;
|
||||||
#if LWIP_IPV6
|
#if LWIP_IPV6
|
||||||
if (IPH_V(iphdr) == 6) {
|
if (IPH_V(iphdr) == 6) {
|
||||||
ip6hdr = (struct ip6_hdr *)p->payload;
|
struct ip6_hdr *ip6hdr = (struct ip6_hdr *)p->payload;
|
||||||
proto = IP6H_NEXTH(ip6hdr);
|
proto = IP6H_NEXTH(ip6hdr);
|
||||||
|
iphdr = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif /* LWIP_IPV6 */
|
#endif /* LWIP_IPV6 */
|
||||||
@ -113,7 +110,7 @@ raw_input(struct pbuf *p, struct netif *inp)
|
|||||||
/* broadcast filter? */
|
/* broadcast filter? */
|
||||||
if ((ip_get_option(pcb, SOF_BROADCAST) || !ip_addr_isbroadcast(ip_current_dest_addr(), inp))
|
if ((ip_get_option(pcb, SOF_BROADCAST) || !ip_addr_isbroadcast(ip_current_dest_addr(), inp))
|
||||||
#if LWIP_IPV6
|
#if LWIP_IPV6
|
||||||
&& !PCB_ISIPV6(pcb)
|
|| PCB_ISIPV6(pcb)
|
||||||
#endif /* LWIP_IPV6 */
|
#endif /* LWIP_IPV6 */
|
||||||
)
|
)
|
||||||
#endif /* IP_SOF_BROADCAST_RECV */
|
#endif /* IP_SOF_BROADCAST_RECV */
|
||||||
@ -124,7 +121,14 @@ raw_input(struct pbuf *p, struct netif *inp)
|
|||||||
void* old_payload = p->payload;
|
void* old_payload = p->payload;
|
||||||
#endif
|
#endif
|
||||||
/* the receive callback function did not eat the packet? */
|
/* the receive callback function did not eat the packet? */
|
||||||
|
#if LWIP_IPV6
|
||||||
|
if (PCB_ISIPV6(pcb)) {
|
||||||
|
eaten = pcb->recv.ip6(pcb->recv_arg, pcb, p, ip6_current_src_addr());
|
||||||
|
} else
|
||||||
|
#endif /* LWIP_IPV6 */
|
||||||
|
{
|
||||||
eaten = pcb->recv.ip4(pcb->recv_arg, pcb, p, ip_current_src_addr());
|
eaten = pcb->recv.ip4(pcb->recv_arg, pcb, p, ip_current_src_addr());
|
||||||
|
}
|
||||||
if (eaten != 0) {
|
if (eaten != 0) {
|
||||||
/* receive function ate the packet */
|
/* receive function ate the packet */
|
||||||
p = NULL;
|
p = NULL;
|
||||||
@ -282,7 +286,6 @@ raw_sendto(struct raw_pcb *pcb, struct pbuf *p, ip_addr_t *ipaddr)
|
|||||||
|
|
||||||
#if IP_SOF_BROADCAST
|
#if IP_SOF_BROADCAST
|
||||||
#if LWIP_IPV6
|
#if LWIP_IPV6
|
||||||
/* @todo: why does IPv6 not filter broadcast with SOF_BROADCAST enabled? */
|
|
||||||
if (!PCB_ISIPV6(pcb))
|
if (!PCB_ISIPV6(pcb))
|
||||||
#endif /* LWIP_IPV6 */
|
#endif /* LWIP_IPV6 */
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user