aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/Webserver/Lib/uip
diff options
context:
space:
mode:
Diffstat (limited to 'Projects/Webserver/Lib/uip')
-rw-r--r--Projects/Webserver/Lib/uip/uip-split.c15
-rw-r--r--Projects/Webserver/Lib/uip/uip.c10
2 files changed, 18 insertions, 7 deletions
diff --git a/Projects/Webserver/Lib/uip/uip-split.c b/Projects/Webserver/Lib/uip/uip-split.c
index 87dbd7e1f..5222a05b6 100644
--- a/Projects/Webserver/Lib/uip/uip-split.c
+++ b/Projects/Webserver/Lib/uip/uip-split.c
@@ -83,7 +83,10 @@ uip_split_output(void)
#if UIP_CONF_IPV6
tcpip_ipv6_output();
#else
- RNDIS_Host_SendPacket(&Ethernet_RNDIS_Interface, uip_buf, uip_len);
+ if (USB_CurrentMode == USB_MODE_Device)
+ RNDIS_Device_SendPacket(&Ethernet_RNDIS_Interface_Device, uip_buf, uip_len);
+ else
+ RNDIS_Host_SendPacket(&Ethernet_RNDIS_Interface_Host, uip_buf, uip_len);
#endif /* UIP_CONF_IPV6 */
/* Now, create the second packet. To do this, it is not enough to
@@ -124,7 +127,10 @@ uip_split_output(void)
#if UIP_CONF_IPV6
tcpip_ipv6_output();
#else
- RNDIS_Host_SendPacket(&Ethernet_RNDIS_Interface, uip_buf, uip_len);
+ if (USB_CurrentMode == USB_MODE_Device)
+ RNDIS_Device_SendPacket(&Ethernet_RNDIS_Interface_Device, uip_buf, uip_len);
+ else
+ RNDIS_Host_SendPacket(&Ethernet_RNDIS_Interface_Host, uip_buf, uip_len);
#endif /* UIP_CONF_IPV6 */
return;
}
@@ -134,7 +140,10 @@ uip_split_output(void)
#if UIP_CONF_IPV6
tcpip_ipv6_output();
#else
- RNDIS_Host_SendPacket(&Ethernet_RNDIS_Interface, uip_buf, uip_len);
+ if (USB_CurrentMode == USB_MODE_Device)
+ RNDIS_Device_SendPacket(&Ethernet_RNDIS_Interface_Device, uip_buf, uip_len);
+ else
+ RNDIS_Host_SendPacket(&Ethernet_RNDIS_Interface_Host, uip_buf, uip_len);
#endif /* UIP_CONF_IPV6 */
}
diff --git a/Projects/Webserver/Lib/uip/uip.c b/Projects/Webserver/Lib/uip/uip.c
index afa19f750..94171adad 100644
--- a/Projects/Webserver/Lib/uip/uip.c
+++ b/Projects/Webserver/Lib/uip/uip.c
@@ -904,10 +904,12 @@ uip_process(u8_t flag)
#if UIP_BROADCAST
DEBUG_PRINTF("UDP IP checksum 0x%04x\n", uip_ipchksum());
if(BUF->proto == UIP_PROTO_UDP &&
- uip_ipaddr_cmp(&BUF->destipaddr, &uip_broadcast_addr)
- /*&&
- uip_ipchksum() == 0xffff*/) {
- goto udp_input;
+ uip_ipaddr_cmp(&BUF->destipaddr, &uip_broadcast_addr))
+ {
+ if (uip_ipaddr_cmp(&BUF->srcipaddr, &uip_all_zeroes_addr))
+ uip_ipaddr_copy(&BUF->srcipaddr, &uip_broadcast_addr);
+
+ goto udp_input;
}
#endif /* UIP_BROADCAST */