Alter the AVRISP-MKII clone project code to report a different serial number in libUS...
[pub/USBasp.git] / Projects / Webserver / Lib / uip / uip.c
index afa19f7..fead757 100644 (file)
@@ -53,7 +53,7 @@
  * 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
@@ -330,7 +330,7 @@ upper_layer_chksum(u8_t proto)
   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;
@@ -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 */
 
@@ -1887,7 +1889,7 @@ uip_process(u8_t flag)
   /* 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