Index: api/api_lib.c
===================================================================
RCS file: /sources/lwip/lwip/src/api/api_lib.c,v
retrieving revision 1.108
diff -u -r1.108 api_lib.c
--- api/api_lib.c	13 Feb 2010 17:08:40 -0000	1.108
+++ api/api_lib.c	14 Feb 2010 14:56:30 -0000
@@ -388,7 +388,7 @@
     buf->p = p;
     buf->ptr = p;
     buf->port = 0;
-    buf->addr = NULL;
+    ip_addr_set_any(&buf->addr);
 
     if (!netconn_get_noautorecved(conn) || (buf == NULL)) {
       /* Let the stack know that we have taken the data. */
@@ -472,7 +472,7 @@
 netconn_sendto(struct netconn *conn, struct netbuf *buf, ip_addr_t *addr, u16_t port)
 {
   if (buf != NULL) {
-    buf->addr = addr;
+    buf->addr = *addr;
     buf->port = port;
     return netconn_send(conn, buf);
   }
Index: api/api_msg.c
===================================================================
RCS file: /sources/lwip/lwip/src/api/api_msg.c,v
retrieving revision 1.141
diff -u -r1.141 api_msg.c
--- api/api_msg.c	13 Feb 2010 17:08:40 -0000	1.141
+++ api/api_msg.c	14 Feb 2010 14:56:53 -0000
@@ -112,7 +112,7 @@
 
       buf->p = q;
       buf->ptr = q;
-      buf->addr = &(((struct ip_hdr*)(q->payload))->src);
+      buf->addr = ((struct ip_hdr*)(q->payload))->src;
       buf->port = pcb->protocol;
 
       len = q->tot_len;
@@ -173,14 +173,14 @@
   } else {
     buf->p = p;
     buf->ptr = p;
-    buf->addr = addr;
+    buf->addr = *addr;
     buf->port = port;
 #if LWIP_NETBUF_RECVINFO
     {
       const struct ip_hdr* iphdr = ip_current_header();
       /* get the UDP header - always in the first pbuf, ensured by udp_input */
       const struct udp_hdr* udphdr = (void*)(((char*)iphdr) + IPH_LEN(iphdr));
-      buf->toaddr = (ip_addr_t*)&iphdr->dest;
+      buf->toaddr = iphdr->dest;
       buf->toport = udphdr->dest;
     }
 #endif /* LWIP_NETBUF_RECVINFO */
@@ -1069,19 +1069,19 @@
       switch (NETCONNTYPE_GROUP(msg->conn->type)) {
 #if LWIP_RAW
       case NETCONN_RAW:
-        if (msg->msg.b->addr == NULL) {
+        if (ip_addr_isany(&msg->msg.b->addr)) {
           msg->err = raw_send(msg->conn->pcb.raw, msg->msg.b->p);
         } else {
-          msg->err = raw_sendto(msg->conn->pcb.raw, msg->msg.b->p, msg->msg.b->addr);
+          msg->err = raw_sendto(msg->conn->pcb.raw, msg->msg.b->p, &msg->msg.b->addr);
         }
         break;
 #endif
 #if LWIP_UDP
       case NETCONN_UDP:
-        if (msg->msg.b->addr == NULL) {
+        if (ip_addr_isany(&msg->msg.b->addr)) {
           msg->err = udp_send(msg->conn->pcb.udp, msg->msg.b->p);
         } else {
-          msg->err = udp_sendto(msg->conn->pcb.udp, msg->msg.b->p, msg->msg.b->addr, msg->msg.b->port);
+          msg->err = udp_sendto(msg->conn->pcb.udp, msg->msg.b->p, &msg->msg.b->addr, msg->msg.b->port);
         }
         break;
 #endif /* LWIP_UDP */
Index: api/netbuf.c
===================================================================
RCS file: /sources/lwip/lwip/src/api/netbuf.c,v
retrieving revision 1.5
diff -u -r1.5 netbuf.c
--- api/netbuf.c	25 Jan 2010 08:24:30 -0000	1.5
+++ api/netbuf.c	14 Feb 2010 14:57:00 -0000
@@ -61,10 +61,10 @@
   if (buf != NULL) {
     buf->p = NULL;
     buf->ptr = NULL;
-    buf->addr = NULL;
+    ip_addr_set_any(&buf->addr);
     buf->port = 0;
 #if LWIP_NETBUF_RECVINFO
-    buf->toaddr = NULL;
+    ip_addr_set_any(&buf->addr);
     buf->toport = 0;
 #endif /* LWIP_NETBUF_RECVINFO */
     return buf;
Index: api/sockets.c
===================================================================
RCS file: /sources/lwip/lwip/src/api/sockets.c,v
retrieving revision 1.156
diff -u -r1.156 sockets.c
--- api/sockets.c	13 Feb 2010 17:08:40 -0000	1.156
+++ api/sockets.c	14 Feb 2010 14:57:44 -0000
@@ -782,12 +782,12 @@
   if (to) {
     inet_addr_to_ipaddr(&remote_addr, &((const struct sockaddr_in *)to)->sin_addr);
     remote_port      = ntohs(((const struct sockaddr_in *)to)->sin_port);
-    buf.addr         = &remote_addr;
+    buf.addr         = remote_addr;
     buf.port         = remote_port;
   } else {
     ip_addr_set_zero(&remote_addr);
     remote_port      = 0;
-    buf.addr         = NULL;
+    ip_addr_set_zero(&buf.addr);
     buf.port         = 0;
   }
 
Index: core/ipv4/autoip.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/ipv4/autoip.c,v
retrieving revision 1.28
diff -u -r1.28 autoip.c
--- core/ipv4/autoip.c	12 Feb 2010 16:42:02 -0000	1.28
+++ core/ipv4/autoip.c	14 Feb 2010 20:32:02 -0000
@@ -482,8 +482,10 @@
     /* Copy struct ip_addr2 to aligned ip_addr, to support compilers without
      * structure packing (not using structure copy which breaks strict-aliasing rules).
      */
-    SMEMCPY(&sipaddr, &hdr->sipaddr, sizeof(sipaddr));
-    SMEMCPY(&dipaddr, &hdr->dipaddr, sizeof(dipaddr));
+    sipaddr.addrw[0] = hdr->sipaddr.addrw[0]; 
+    sipaddr.addrw[1] = hdr->sipaddr.addrw[1]; 
+    dipaddr.addrw[0] = hdr->dipaddr.addrw[0]; 
+    dipaddr.addrw[1] = hdr->dipaddr.addrw[1]; 
       
     if ((netif->autoip->state == AUTOIP_STATE_PROBING) ||
         ((netif->autoip->state == AUTOIP_STATE_ANNOUNCING) &&
Index: core/ipv4/icmp.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/ipv4/icmp.c,v
retrieving revision 1.50
diff -u -r1.50 icmp.c
--- core/ipv4/icmp.c	14 Feb 2010 12:42:50 -0000	1.50
+++ core/ipv4/icmp.c	14 Feb 2010 15:00:19 -0000
@@ -212,7 +212,9 @@
       LWIP_ASSERT("Can't move over header in packet", 0);
     } else {
       err_t ret;
-      ret = ip_output_if(p, &(iphdr->src), IP_HDRINCL,
+      ip_addr_t src;
+      ip_addr_copy(src, iphdr->src);
+      ret = ip_output_if(p, &src, IP_HDRINCL,
                    ICMP_TTL, 0, IP_PROTO_ICMP, inp);
       if (ret != ERR_OK) {
         LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ip_output_if returned an error: %c.\n", ret));
@@ -287,6 +289,7 @@
   struct ip_hdr *iphdr;
   /* we can use the echo header here */
   struct icmp_echo_hdr *icmphdr;
+  ip_addr_t src;
 
   /* ICMP header + IP header + 8 bytes of data */
   q = pbuf_alloc(PBUF_IP, sizeof(struct icmp_echo_hdr) + IP_HLEN + ICMP_DEST_UNREACH_DATASIZE,
@@ -323,7 +326,8 @@
   snmp_inc_icmpoutmsgs();
   /* increase number of destination unreachable messages attempted to send */
   snmp_inc_icmpouttimeexcds();
-  ip_output(q, NULL, &(iphdr->src), ICMP_TTL, 0, IP_PROTO_ICMP);
+  ip_addr_copy(src, iphdr->src);
+  ip_output(q, NULL, &src, ICMP_TTL, 0, IP_PROTO_ICMP);
   pbuf_free(q);
 }
 
Index: core/ipv4/igmp.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/ipv4/igmp.c,v
retrieving revision 1.39
diff -u -r1.39 igmp.c
--- core/ipv4/igmp.c	14 Feb 2010 12:42:50 -0000	1.39
+++ core/ipv4/igmp.c	14 Feb 2010 15:00:47 -0000
@@ -462,9 +462,11 @@
          LWIP_DEBUGF(IGMP_DEBUG, ("igmp_input: IGMP_MEMB_QUERY to a specific group "));
          ip_addr_debug_print(IGMP_DEBUG, &igmp->igmp_group_address);
          if (ip_addr_cmp(dest, &allsystems)) {
+           ip_addr_t groupaddr;
            LWIP_DEBUGF(IGMP_DEBUG, (" using \"ALL SYSTEMS\" address (224.0.0.1) [igmp_maxresp=%i]\n", (int)(igmp->igmp_maxresp)));
            /* we first need to re-lookfor the group since we used dest last time */
-           group = igmp_lookfor_group(inp, &igmp->igmp_group_address);
+           ip_addr_copy(groupaddr, igmp->igmp_group_address);
+           group = igmp_lookfor_group(inp, &groupaddr);
          } else {
            LWIP_DEBUGF(IGMP_DEBUG, (" with the group address as destination [igmp_maxresp=%i]\n", (int)(igmp->igmp_maxresp)));
          }
@@ -774,10 +776,10 @@
 static void
 igmp_send(struct igmp_group *group, u8_t type)
 {
-  struct pbuf*     p    = NULL;
-  struct igmp_msg* igmp = NULL;
-  ip_addr_t   src  = *IP_ADDR_ANY;
-  ip_addr_t*  dest = NULL;
+  struct pbuf*     p;
+  struct igmp_msg* igmp;
+  ip_addr_t   src;
+  ip_addr_t   dest;
 
   /* IP header + "router alert" option + IGMP header */
   p = pbuf_alloc(PBUF_TRANSPORT, IGMP_MINLEN, PBUF_RAM);
@@ -789,12 +791,12 @@
     ip_addr_copy(src, group->netif->ip_addr);
      
     if (type == IGMP_V2_MEMB_REPORT) {
-      dest = &(group->group_address);
+      ip_addr_copy(dest, group->group_address);
       ip_addr_copy(igmp->igmp_group_address, group->group_address);
       group->last_reporter_flag = 1; /* Remember we were the last to report */
     } else {
       if (type == IGMP_LEAVE_GROUP) {
-        dest = &allrouters;
+        ip_addr_copy(dest, allrouters);
         ip_addr_copy(igmp->igmp_group_address, group->group_address);
       }
     }
@@ -805,7 +807,7 @@
       igmp->igmp_checksum = 0;
       igmp->igmp_checksum = inet_chksum(igmp, IGMP_MINLEN);
 
-      igmp_ip_output_if(p, &src, dest, group->netif);
+      igmp_ip_output_if(p, &src, &dest, group->netif);
     }
 
     pbuf_free(p);
Index: core/ipv4/inet_chksum.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/ipv4/inet_chksum.c,v
retrieving revision 1.16
diff -u -r1.16 inet_chksum.c
--- core/ipv4/inet_chksum.c	14 Feb 2010 11:40:13 -0000	1.16
+++ core/ipv4/inet_chksum.c	15 Feb 2010 01:50:51 -0000
@@ -275,14 +275,14 @@
  * @param p chain of pbufs over that a checksum should be calculated (ip data part)
  * @param src source ip address (used for checksum of pseudo header)
  * @param dst destination ip address (used for checksum of pseudo header)
- * @param proto ip protocol (used for checksum of pseudo header)
+ * @param proto ip protocol, in network byte order (used for checksum of pseudo header)
  * @param proto_len length of the ip data part (used for checksum of pseudo header)
  * @return checksum (as u16_t) to be saved directly in the protocol header
  */
 u16_t
 inet_chksum_pseudo(struct pbuf *p,
-       ip_addr_t *src, ip_addr_t *dest,
-       u8_t proto, u16_t proto_len)
+       u32_t src, u32_t dest,
+       u16_t proto, u16_t proto_len)
 {
   u32_t acc;
   u32_t addr;
@@ -310,13 +310,11 @@
   if (swapped) {
     acc = SWAP_BYTES_IN_WORD(acc);
   }
-  addr = ip4_addr_get_u32(src);
-  acc += (addr & 0xffffUL);
-  acc += ((addr >> 16) & 0xffffUL);
-  addr = ip4_addr_get_u32(dest);
-  acc += (addr & 0xffffUL);
-  acc += ((addr >> 16) & 0xffffUL);
-  acc += (u32_t)htons((u16_t)proto);
+  acc += (src & 0xffffUL);
+  acc += ((src >> 16) & 0xffffUL);
+  acc += (dest & 0xffffUL);
+  acc += ((dest >> 16) & 0xffffUL);
+  acc += proto;
   acc += (u32_t)htons(proto_len);
 
   /* Fold 32-bit sum to 16 bits
@@ -335,7 +333,7 @@
  * @param p chain of pbufs over that a checksum should be calculated (ip data part)
  * @param src source ip address (used for checksum of pseudo header)
  * @param dst destination ip address (used for checksum of pseudo header)
- * @param proto ip protocol (used for checksum of pseudo header)
+ * @param proto ip protocol, in network byte order (used for checksum of pseudo header)
  * @param proto_len length of the ip data part (used for checksum of pseudo header)
  * @return checksum (as u16_t) to be saved directly in the protocol header
  */
@@ -343,8 +341,8 @@
 #if LWIP_UDPLITE
 u16_t
 inet_chksum_pseudo_partial(struct pbuf *p,
-       ip_addr_t *src, ip_addr_t *dest,
-       u8_t proto, u16_t proto_len, u16_t chksum_len)
+       u32_t src, u32_t dest,
+       u16_t proto, u16_t proto_len, u16_t chksum_len)
 {
   u32_t acc;
   u32_t addr;
@@ -378,13 +376,11 @@
   if (swapped) {
     acc = SWAP_BYTES_IN_WORD(acc);
   }
-  addr = ip4_addr_get_u32(src);
-  acc += (addr & 0xffffUL);
-  acc += ((addr >> 16) & 0xffffUL);
-  addr = ip4_addr_get_u32(dest);
-  acc += (addr & 0xffffUL);
-  acc += ((addr >> 16) & 0xffffUL);
-  acc += (u32_t)htons((u16_t)proto);
+  acc += (src & 0xffffUL);
+  acc += ((src >> 16) & 0xffffUL);
+  acc += (dest & 0xffffUL);
+  acc += ((dest >> 16) & 0xffffUL);
+  acc += proto;
   acc += (u32_t)htons(proto_len);
 
   /* Fold 32-bit sum to 16 bits
Index: core/ipv4/ip.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/ipv4/ip.c,v
retrieving revision 1.85
diff -u -r1.85 ip.c
--- core/ipv4/ip.c	14 Feb 2010 12:42:50 -0000	1.85
+++ core/ipv4/ip.c	14 Feb 2010 15:01:19 -0000
@@ -197,6 +197,9 @@
 #if LWIP_DHCP
   int check_ip_src=1;
 #endif /* LWIP_DHCP */
+#if LWIP_IGMP
+  	ip_addr_t dst;
+#endif /* LWIP_IGMP */
 
   IP_STATS_INC(ip.recv);
   snmp_inc_ipinreceives();
@@ -261,8 +264,9 @@
 
   /* match packet against an interface, i.e. is this packet for us? */
 #if LWIP_IGMP
-  if (ip_addr_ismulticast(&(iphdr->dest))) {
-    if ((inp->flags & NETIF_FLAG_IGMP) && (igmp_lookfor_group(inp, &(iphdr->dest)))) {
+  ip_addr_copy(dst, iphdr->dest);
+  if (ip_addr_ismulticast(&dst)) {
+    if ((inp->flags & NETIF_FLAG_IGMP) && (igmp_lookfor_group(inp, &dst))) {
       netif = inp;
     } else {
       netif = NULL;
@@ -441,7 +445,7 @@
 #endif /* LWIP_ICMP */
 #if LWIP_IGMP
     case IP_PROTO_IGMP:
-      igmp_input(p,inp,&(iphdr->dest));
+      igmp_input(p, inp, &dst);
       break;
 #endif /* LWIP_IGMP */
     default:
@@ -516,6 +520,7 @@
 #endif /* IP_OPTIONS_SEND */
   struct ip_hdr *iphdr;
   static u16_t ip_id = 0;
+  ip_addr_t dst2;
 
   snmp_inc_ipoutrequests();
 
@@ -581,7 +586,8 @@
   } else {
     /* IP header already included in p */
     iphdr = (struct ip_hdr *)p->payload;
-    dest = &(iphdr->dest);
+    ip_addr_copy(dst2, iphdr->dest);
+    dest = &dst2;
   }
 
   IP_STATS_INC(ip.xmit);
@@ -599,7 +605,7 @@
 #if IP_FRAG
   /* don't fragment if interface has mtu set to 0 [loopif] */
   if (netif->mtu && (p->tot_len > netif->mtu)) {
-    return ip_frag(p,netif,dest);
+    return ip_frag(p, netif, dest);
   }
 #endif
 
Index: core/raw.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/raw.c,v
retrieving revision 1.28
diff -u -r1.28 raw.c
--- core/raw.c	4 Feb 2010 18:47:44 -0000	1.28
+++ core/raw.c	14 Feb 2010 14:58:26 -0000
@@ -101,7 +101,9 @@
         /* receive callback function available? */
         if (pcb->recv != NULL) {
           /* the receive callback function did not eat the packet? */
-          if (pcb->recv(pcb->recv_arg, pcb, p, &(iphdr->src)) != 0) {
+          ip_addr_t src;
+          ip_addr_copy(src, iphdr->src);
+          if (pcb->recv(pcb->recv_arg, pcb, p, &src) != 0) {
             /* receive function ate the packet */
             p = NULL;
             eaten = 1;
Index: core/tcp_in.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/tcp_in.c,v
retrieving revision 1.135
diff -u -r1.135 tcp_in.c
--- core/tcp_in.c	14 Feb 2010 12:42:49 -0000	1.135
+++ core/tcp_in.c	14 Feb 2010 14:59:03 -0000
@@ -131,11 +131,11 @@
 
 #if CHECKSUM_CHECK_TCP
   /* Verify TCP checksum. */
-  if (inet_chksum_pseudo(p, &iphdr->src, &iphdr->dest,
-      IP_PROTO_TCP, p->tot_len) != 0) {
+  if (inet_chksum_pseudo(p, ip4_addr_get_u32(&iphdr->src), ip4_addr_get_u32(&iphdr->dest),
+      htons(IP_PROTO_TCP), p->tot_len) != 0) {
       LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: packet discarded due to failing checksum 0x%04"X16_F"\n",
-        inet_chksum_pseudo(p, &iphdr->src, &iphdr->dest,
-      IP_PROTO_TCP, p->tot_len)));
+        inet_chksum_pseudo(p, ip4_addr_get_u32(&iphdr->src), ip4_addr_get_u32(&iphdr->dest),
+      htons(IP_PROTO_TCP), p->tot_len)));
 #if TCP_DEBUG
     tcp_debug_print(tcphdr);
 #endif /* TCP_DEBUG */
@@ -372,11 +372,12 @@
        sender. */
     LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_input: no PCB match found, resetting.\n"));
     if (!(TCPH_FLAGS(tcphdr) & TCP_RST)) {
+      ip_addr_t local_ip, remote_ip;
+      ip_addr_copy(local_ip, iphdr->dest);	/* can we use pcb addresses ? */
+      ip_addr_copy(remote_ip, iphdr->src);
       TCP_STATS_INC(tcp.proterr);
       TCP_STATS_INC(tcp.drop);
-      tcp_rst(ackno, seqno + tcplen,
-        &(iphdr->dest), &(iphdr->src),
-        tcphdr->dest, tcphdr->src);
+      tcp_rst(ackno, seqno + tcplen, &local_ip, &remote_ip, tcphdr->dest, tcphdr->src);
     }
     pbuf_free(p);
   }
@@ -408,10 +409,11 @@
   if (flags & TCP_ACK) {
     /* For incoming segments with the ACK flag set, respond with a
        RST. */
+    ip_addr_t local_ip, remote_ip;
+    ip_addr_copy(local_ip, iphdr->dest);	/* can we use pcb addresses ? */
+    ip_addr_copy(remote_ip, iphdr->src);
     LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_listen_input: ACK in LISTEN, sending reset\n"));
-    tcp_rst(ackno + 1, seqno + tcplen,
-      &(iphdr->dest), &(iphdr->src),
-      tcphdr->dest, tcphdr->src);
+    tcp_rst(ackno + 1, seqno + tcplen, &local_ip, &remote_ip, tcphdr->dest, tcphdr->src);
   } else if (flags & TCP_SYN) {
     LWIP_DEBUGF(TCP_DEBUG, ("TCP connection request %"U16_F" -> %"U16_F".\n", tcphdr->src, tcphdr->dest));
 #if TCP_LISTEN_BACKLOG
@@ -503,8 +505,10 @@
        should be sent in reply */
     if (TCP_SEQ_BETWEEN(seqno, pcb->rcv_nxt, pcb->rcv_nxt+pcb->rcv_wnd)) {
       /* If the SYN is in the window it is an error, send a reset */
-      tcp_rst(ackno, seqno + tcplen, &(iphdr->dest), &(iphdr->src),
-        tcphdr->dest, tcphdr->src);
+      ip_addr_t local_ip, remote_ip;
+      ip_addr_copy(local_ip, iphdr->dest);	/* can we use pcb addresses ? */
+      ip_addr_copy(remote_ip, iphdr->src);
+      tcp_rst(ackno, seqno + tcplen, &local_ip, &remote_ip, tcphdr->dest, tcphdr->src);
       return ERR_OK;
     }
   } else if (flags & TCP_FIN) {
@@ -635,8 +639,10 @@
     /* received ACK? possibly a half-open connection */
     else if (flags & TCP_ACK) {
       /* send a RST to bring the other side in a non-synchronized state. */
-      tcp_rst(ackno, seqno + tcplen, &(iphdr->dest), &(iphdr->src),
-        tcphdr->dest, tcphdr->src);
+      ip_addr_t local_ip, remote_ip;
+      ip_addr_copy(local_ip, iphdr->dest);	/* can we use pcb addresses ? */
+      ip_addr_copy(remote_ip, iphdr->src);
+      tcp_rst(ackno, seqno + tcplen, &local_ip, &remote_ip, tcphdr->dest, tcphdr->src);
     }
     break;
   case SYN_RCVD:
@@ -680,8 +686,10 @@
       /* incorrect ACK number */
       else {
         /* send RST */
-        tcp_rst(ackno, seqno + tcplen, &(iphdr->dest), &(iphdr->src),
-                tcphdr->dest, tcphdr->src);
+        ip_addr_t local_ip, remote_ip;
+        ip_addr_copy(local_ip, iphdr->dest);	/* can we use pcb addresses ? */
+        ip_addr_copy(remote_ip, iphdr->src);
+        tcp_rst(ackno, seqno + tcplen, &local_ip, &remote_ip, tcphdr->dest, tcphdr->src);
       }
     } else if ((flags & TCP_SYN) && (seqno == pcb->rcv_nxt - 1)) {
       /* Looks like another copy of the SYN - retransmit our SYN-ACK */
Index: core/tcp_out.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/tcp_out.c,v
retrieving revision 1.97
diff -u -r1.97 tcp_out.c
--- core/tcp_out.c	14 Feb 2010 12:42:49 -0000	1.97
+++ core/tcp_out.c	14 Feb 2010 14:59:32 -0000
@@ -491,8 +491,8 @@
 #endif 
 
 #if CHECKSUM_GEN_TCP
-  tcphdr->chksum = inet_chksum_pseudo(p, &(pcb->local_ip), &(pcb->remote_ip),
-        IP_PROTO_TCP, p->tot_len);
+  tcphdr->chksum = inet_chksum_pseudo(p, ip4_addr_get_u32(&(pcb->local_ip)), ip4_addr_get_u32(&(pcb->remote_ip)),
+        htons(IP_PROTO_TCP), p->tot_len);
 #endif
 #if LWIP_NETIF_HWADDRHINT
   ip_output_hinted(p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
@@ -730,9 +730,9 @@
   seg->tcphdr->chksum = 0;
 #if CHECKSUM_GEN_TCP
   seg->tcphdr->chksum = inet_chksum_pseudo(seg->p,
-             &(pcb->local_ip),
-             &(pcb->remote_ip),
-             IP_PROTO_TCP, seg->p->tot_len);
+             ip4_addr_get_u32(&(pcb->local_ip)),
+             ip4_addr_get_u32(&(pcb->remote_ip)),
+             htons(IP_PROTO_TCP), seg->p->tot_len);
 #endif
   TCP_STATS_INC(tcp.xmit);
 
@@ -792,8 +792,8 @@
 
   tcphdr->chksum = 0;
 #if CHECKSUM_GEN_TCP
-  tcphdr->chksum = inet_chksum_pseudo(p, local_ip, remote_ip,
-              IP_PROTO_TCP, p->tot_len);
+  tcphdr->chksum = inet_chksum_pseudo(p, ip4_addr_get_u32(local_ip), ip4_addr_get_u32(remote_ip),
+              htons(IP_PROTO_TCP), p->tot_len);
 #endif
   TCP_STATS_INC(tcp.xmit);
   snmp_inc_tcpoutrsts();
@@ -953,8 +953,8 @@
   tcphdr = tcp_output_set_header(pcb, p, 0, htonl(pcb->snd_nxt - 1));
 
 #if CHECKSUM_GEN_TCP
-  tcphdr->chksum = inet_chksum_pseudo(p, &pcb->local_ip, &pcb->remote_ip,
-                                      IP_PROTO_TCP, p->tot_len);
+  tcphdr->chksum = inet_chksum_pseudo(p, ip4_addr_get_u32(&pcb->local_ip), ip4_addr_get_u32(&pcb->remote_ip),
+                                      htons(IP_PROTO_TCP), p->tot_len);
 #endif
   TCP_STATS_INC(tcp.xmit);
 
@@ -1031,8 +1031,8 @@
   }
 
 #if CHECKSUM_GEN_TCP
-  tcphdr->chksum = inet_chksum_pseudo(p, &pcb->local_ip, &pcb->remote_ip,
-                                      IP_PROTO_TCP, p->tot_len);
+  tcphdr->chksum = inet_chksum_pseudo(p, ip4_addr_get_u32(&pcb->local_ip), ip4_addr_get_u32(&pcb->remote_ip),
+                                      htons(IP_PROTO_TCP), p->tot_len);
 #endif
   TCP_STATS_INC(tcp.xmit);
 
Index: core/udp.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/udp.c,v
retrieving revision 1.120
diff -u -r1.120 udp.c
--- core/udp.c	12 Feb 2010 16:30:58 -0000	1.120
+++ core/udp.c	14 Feb 2010 14:59:57 -0000
@@ -237,8 +237,8 @@
           goto end;
         }
       }
-      if (inet_chksum_pseudo_partial(p, &iphdr->src, &iphdr->dest,
-                             IP_PROTO_UDPLITE, p->tot_len, chklen) != 0) {
+      if (inet_chksum_pseudo_partial(p, ip4_addr_get_u32(&iphdr->src), ip4_addr_get_u32(&iphdr->dest),
+                             htons(IP_PROTO_UDPLITE), p->tot_len, chklen) != 0) {
        LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_LEVEL_SERIOUS,
                    ("udp_input: UDP Lite datagram discarded due to failing checksum\n"));
         UDP_STATS_INC(udp.chkerr);
@@ -253,8 +253,8 @@
     {
 #if CHECKSUM_CHECK_UDP
       if (udphdr->chksum != 0) {
-        if (inet_chksum_pseudo(p, &iphdr->src, &iphdr->dest,
-                               IP_PROTO_UDP, p->tot_len) != 0) {
+        if (inet_chksum_pseudo(p, ip4_addr_get_u32(&iphdr->src), ip4_addr_get_u32(&iphdr->dest),
+                               htons(IP_PROTO_UDP), p->tot_len) != 0) {
           LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_LEVEL_SERIOUS,
                       ("udp_input: UDP datagram discarded due to failing checksum\n"));
           UDP_STATS_INC(udp.chkerr);
@@ -279,7 +279,9 @@
       /* callback */
       if (pcb->recv != NULL) {
         /* now the recv function is responsible for freeing p */
-        pcb->recv(pcb->recv_arg, pcb, p, &iphdr->src, src);
+        ip_addr_t srcip;
+        ip_addr_copy(srcip, iphdr->src);
+        pcb->recv(pcb->recv_arg, pcb, p, &srcip, src);
       } else {
         /* no recv function registered? then we have to free the pbuf! */
         pbuf_free(p);
@@ -500,8 +502,8 @@
     udphdr->len = htons(chklen_hdr);
     /* calculate checksum */
 #if CHECKSUM_GEN_UDP
-    udphdr->chksum = inet_chksum_pseudo_partial(q, src_ip, dst_ip,
-                                        IP_PROTO_UDPLITE, q->tot_len, chklen);
+    udphdr->chksum = inet_chksum_pseudo_partial(q, ip4_addr_get_u32(src_ip), ip4_addr_get_u32(dst_ip),
+                                        htons(IP_PROTO_UDPLITE), q->tot_len, chklen);
     /* chksum zero must become 0xffff, as zero means 'no checksum' */
     if (udphdr->chksum == 0x0000) {
       udphdr->chksum = 0xffff;
@@ -524,7 +526,7 @@
     /* calculate checksum */
 #if CHECKSUM_GEN_UDP
     if ((pcb->flags & UDP_FLAGS_NOCHKSUM) == 0) {
-      udphdr->chksum = inet_chksum_pseudo(q, src_ip, dst_ip, IP_PROTO_UDP, q->tot_len);
+      udphdr->chksum = inet_chksum_pseudo(q, ip4_addr_get_u32(src_ip), ip4_addr_get_u32(dst_ip), htons(IP_PROTO_UDP), q->tot_len);
       /* chksum zero must become 0xffff, as zero means 'no checksum' */
       if (udphdr->chksum == 0x0000) {
         udphdr->chksum = 0xffff;
Index: include/ipv4/lwip/inet_chksum.h
===================================================================
RCS file: /sources/lwip/lwip/src/include/ipv4/lwip/inet_chksum.h,v
retrieving revision 1.3
diff -u -r1.3 inet_chksum.h
--- include/ipv4/lwip/inet_chksum.h	4 Feb 2010 18:47:48 -0000	1.3
+++ include/ipv4/lwip/inet_chksum.h	15 Feb 2010 01:51:55 -0000
@@ -44,12 +44,12 @@
 u16_t inet_chksum(void *dataptr, u16_t len);
 u16_t inet_chksum_pbuf(struct pbuf *p);
 u16_t inet_chksum_pseudo(struct pbuf *p,
-       ip_addr_t *src, ip_addr_t *dest,
-       u8_t proto, u16_t proto_len);
+       u32_t src, u32_t dest,
+       u16_t proto, u16_t proto_len);
 #if LWIP_UDPLITE
 u16_t inet_chksum_pseudo_partial(struct pbuf *p,
-       ip_addr_t *src, ip_addr_t *dest,
-       u8_t proto, u16_t proto_len, u16_t chksum_len);
+       u32_t src, u32_t dest,
+       u16_t proto, u16_t proto_len, u16_t chksum_len);
 #endif
 
 #ifdef __cplusplus
Index: include/ipv4/lwip/ip_addr.h
===================================================================
RCS file: /sources/lwip/lwip/src/include/ipv4/lwip/ip_addr.h,v
retrieving revision 1.48
diff -u -r1.48 ip_addr.h
--- include/ipv4/lwip/ip_addr.h	14 Feb 2010 12:41:46 -0000	1.48
+++ include/ipv4/lwip/ip_addr.h	14 Feb 2010 20:46:59 -0000
@@ -39,17 +39,14 @@
 extern "C" {
 #endif
 
-#ifdef PACK_STRUCT_USE_INCLUDES
-#  include "arch/bpstruct.h"
-#endif
-PACK_STRUCT_BEGIN
 struct _ip_addr {
-  PACK_STRUCT_FIELD(u32_t addr);
-} PACK_STRUCT_STRUCT;
-PACK_STRUCT_END
-#ifdef PACK_STRUCT_USE_INCLUDES
-#  include "arch/epstruct.h"
-#endif
+  union {
+    u32_t addr;
+    u16_t addrw[2];
+    u8_t addrb[4];
+  };
+};
+
 
 typedef struct _ip_addr ip_addr_t;
 
@@ -195,10 +192,10 @@
                       ipaddr != NULL ? ip4_addr4_16(ipaddr) : 0))
 
 /* Get one byte from the 4-byte address */
-#define ip4_addr1(ipaddr) (((u8_t*)(ipaddr))[0])
-#define ip4_addr2(ipaddr) (((u8_t*)(ipaddr))[1])
-#define ip4_addr3(ipaddr) (((u8_t*)(ipaddr))[2])
-#define ip4_addr4(ipaddr) (((u8_t*)(ipaddr))[3])
+#define ip4_addr1(ipaddr) (ipaddr)->addrb[0]
+#define ip4_addr2(ipaddr) (ipaddr)->addrb[1]
+#define ip4_addr3(ipaddr) (ipaddr)->addrb[2]
+#define ip4_addr4(ipaddr) (ipaddr)->addrb[3]
 /* These are cast to u16_t, with the intent that they are often arguments
  * to printf using the U16_F format from cc.h. */
 #define ip4_addr1_16(ipaddr) ((u16_t)ip4_addr1(ipaddr))
Index: include/lwip/netbuf.h
===================================================================
RCS file: /sources/lwip/lwip/src/include/lwip/netbuf.h,v
retrieving revision 1.5
diff -u -r1.5 netbuf.h
--- include/lwip/netbuf.h	4 Feb 2010 18:47:48 -0000	1.5
+++ include/lwip/netbuf.h	14 Feb 2010 15:02:50 -0000
@@ -42,10 +42,10 @@
 
 struct netbuf {
   struct pbuf *p, *ptr;
-  ip_addr_t *addr;
+  ip_addr_t addr;
   u16_t port;
 #if LWIP_NETBUF_RECVINFO
-  ip_addr_t *toaddr;
+  ip_addr_t toaddr;
   u16_t toport;
 #endif /* LWIP_NETBUF_RECVINFO */
 };
@@ -71,10 +71,10 @@
 #define netbuf_copy(buf,dataptr,len) netbuf_copy_partial(buf, dataptr, len, 0)
 #define netbuf_take(buf, dataptr, len) pbuf_take((buf)->p, dataptr, len)
 #define netbuf_len(buf)              ((buf)->p->tot_len)
-#define netbuf_fromaddr(buf)         ((buf)->addr)
+#define netbuf_fromaddr(buf)         (&((buf)->addr))
 #define netbuf_fromport(buf)         ((buf)->port)
 #if LWIP_NETBUF_RECVINFO
-#define netbuf_destaddr(buf)         ((buf)->toaddr)
+#define netbuf_destaddr(buf)         (&((buf)->toaddr))
 #define netbuf_destport(buf)         ((buf)->toport)
 #endif /* LWIP_NETBUF_RECVINFO */
 
Index: netif/etharp.c
===================================================================
RCS file: /sources/lwip/lwip/src/netif/etharp.c,v
retrieving revision 1.162
diff -u -r1.162 etharp.c
--- netif/etharp.c	14 Feb 2010 18:08:17 -0000	1.162
+++ netif/etharp.c	14 Feb 2010 20:33:08 -0000
@@ -686,8 +686,10 @@
 
   /* Copy struct ip_addr2 to aligned ip_addr, to support compilers without
    * structure packing (not using structure copy which breaks strict-aliasing rules). */
-  SMEMCPY(&sipaddr, &hdr->sipaddr, sizeof(sipaddr));
-  SMEMCPY(&dipaddr, &hdr->dipaddr, sizeof(dipaddr));
+  sipaddr.addrw[0] = hdr->sipaddr.addrw[0]; 
+  sipaddr.addrw[1] = hdr->sipaddr.addrw[1]; 
+  dipaddr.addrw[0] = hdr->dipaddr.addrw[0]; 
+  dipaddr.addrw[1] = hdr->dipaddr.addrw[1]; 
 
   /* this interface is not configured? */
   if (ip_addr_isany(&netif->ip_addr)) {
@@ -726,8 +728,10 @@
          that would allocate a new pbuf. */
       hdr->opcode = htons(ARP_REPLY);
 
-      SMEMCPY(&hdr->dipaddr, &hdr->sipaddr, sizeof(ip_addr_t));
-      SMEMCPY(&hdr->sipaddr, &netif->ip_addr, sizeof(ip_addr_t));
+      hdr->dipaddr.addrw[0] = hdr->sipaddr.addrw[0]; 
+      hdr->dipaddr.addrw[1] = hdr->sipaddr.addrw[1]; 
+      hdr->sipaddr.addrw[0] = netif->ip_addr.addrw[0]; 
+      hdr->sipaddr.addrw[1] = netif->ip_addr.addrw[1]; 
 
       LWIP_ASSERT("netif->hwaddr_len must be the same as ETHARP_HWADDR_LEN for etharp!",
                   (netif->hwaddr_len == ETHARP_HWADDR_LEN));
@@ -1105,9 +1109,11 @@
   }
   /* Copy struct ip_addr2 to aligned ip_addr, to support compilers without
    * structure packing. */ 
-  SMEMCPY(&hdr->sipaddr, ipsrc_addr, sizeof(ip_addr_t));
-  SMEMCPY(&hdr->dipaddr, ipdst_addr, sizeof(ip_addr_t));
-
+  hdr->sipaddr.addrw[0] = ipsrc_addr->addrw[0];
+  hdr->sipaddr.addrw[1] = ipsrc_addr->addrw[1];
+  hdr->dipaddr.addrw[0] = ipdst_addr->addrw[0];
+  hdr->dipaddr.addrw[1] = ipdst_addr->addrw[1];
+  /* set hardware and protocol types */
   hdr->hwtype = htons(HWTYPE_ETHERNET);
   hdr->proto = htons(ETHTYPE_IP);
   /* set hwlen and protolen together */

