* statement. While it would be possible to break the uip_process()
* function into many smaller functions, this would increase the code
* size because of the overhead of parameter passing and the fact that
- * the optimiser would not be as efficient.
+ * the optimizer would not be as efficient.
*
* The principle is that we have a small buffer, called the uip_buf,
* in which the device driver puts an incoming packet. The TCP/IP
upper_layer_len = (((u16_t)(BUF->len[0]) << 8) + BUF->len[1]) - UIP_IPH_LEN;
#endif /* UIP_CONF_IPV6 */
- /* First sum pseudoheader. */
+ /* First sum pseudo-header. */
/* IP protocol and length fields. This addition cannot carry. */
sum = upper_layer_len + proto;
#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 */
/* Calculate IP checksum. */
BUF->ipchksum = 0;
BUF->ipchksum = ~(uip_ipchksum());
- DEBUG_PRINTF("uip ip_send_nolen: chkecum 0x%04x\n", uip_ipchksum());
+ DEBUG_PRINTF("uip ip_send_nolen: checksum 0x%04x\n", uip_ipchksum());
#endif /* UIP_CONF_IPV6 */
UIP_STAT(++uip_stat.tcp.sent);
#if UIP_CONF_IPV6