sizeof(u8_t) is 1 at temperatures > 0 K

This commit is contained in:
jani 2002-12-19 09:04:58 +00:00
parent ef68392388
commit 156d2c866f
5 changed files with 8 additions and 8 deletions

View File

@ -64,7 +64,7 @@ icmp_input(struct pbuf *p, struct netif *inp)
iphdr = p->payload;
hlen = IPH_HL(iphdr) * 4/sizeof(u8_t);
hlen = IPH_HL(iphdr) * 4;
pbuf_header(p, -hlen);
type = *((u8_t *)p->payload);

View File

@ -332,7 +332,7 @@ ip_input(struct pbuf *p, struct netif *inp) {
node (as recommended by RFC 1542 section 3.1.1, referred by RFC
2131). */
if(IPH_PROTO(iphdr) == IP_PROTO_UDP &&
((struct udp_hdr *)((u8_t *)iphdr + IPH_HL(iphdr) * 4/sizeof(u8_t)))->src ==
((struct udp_hdr *)((u8_t *)iphdr + IPH_HL(iphdr) * 4))->src ==
DHCP_SERVER_PORT) {
netif = inp;
}
@ -563,7 +563,7 @@ ip_debug_print(struct pbuf *p)
struct ip_hdr *iphdr = p->payload;
u8_t *payload;
payload = (u8_t *)iphdr + IP_HLEN/sizeof(u8_t);
payload = (u8_t *)iphdr + IP_HLEN;
DEBUGF(IP_DEBUG, ("IP header:\n"));
DEBUGF(IP_DEBUG, ("+-------------------------------+\n"));

View File

@ -445,7 +445,7 @@ pbuf_header(struct pbuf *p, s16_t header_size)
}
payload = p->payload;
p->payload = (u8_t *)p->payload - header_size/sizeof(u8_t);
p->payload = (u8_t *)p->payload - header_size;
DEBUGF(PBUF_DEBUG, ("pbuf_header: old %p new %p (%d)\n", payload, p->payload, header_size));

View File

@ -106,9 +106,9 @@ tcp_input(struct pbuf *p, struct netif *inp)
#endif /* TCP_STATS */
iphdr = p->payload;
tcphdr = (struct tcp_hdr *)((u8_t *)p->payload + IPH_HL(iphdr) * 4/sizeof(u8_t));
tcphdr = (struct tcp_hdr *)((u8_t *)p->payload + IPH_HL(iphdr) * 4);
pbuf_header(p, -(IPH_HL(iphdr) * 4/sizeof(u8_t)));
pbuf_header(p, -(IPH_HL(iphdr) * 4));
/* Don't even process incoming broadcasts/multicasts. */
if(ip_addr_isbroadcast(&(iphdr->dest), &(inp->netmask)) ||

View File

@ -28,7 +28,7 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: udp.c,v 1.5 2002/12/18 12:49:02 jani Exp $
* $Id: udp.c,v 1.6 2002/12/19 09:04:58 jani Exp $
*/
/*-----------------------------------------------------------------------------------*/
@ -94,7 +94,7 @@ udp_lookup(struct ip_hdr *iphdr, struct netif *inp)
PERF_START;
udphdr = (struct udp_hdr *)(u8_t *)iphdr + IPH_HL(iphdr) * 4/sizeof(u8_t);
udphdr = (struct udp_hdr *)(u8_t *)iphdr + IPH_HL(iphdr) * 4;
src = NTOHS(udphdr->src);
dest = NTOHS(udphdr->dest);