diff --git a/src/api/api_lib.c b/src/api/api_lib.c index 8c519090..93c0e453 100644 --- a/src/api/api_lib.c +++ b/src/api/api_lib.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/api/api_msg.c b/src/api/api_msg.c index 3fb2dbbb..a05bb858 100644 --- a/src/api/api_msg.c +++ b/src/api/api_msg.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/api/err.c b/src/api/err.c index ea8b75a0..b582d88a 100644 --- a/src/api/err.c +++ b/src/api/err.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/api/sockets.c b/src/api/sockets.c index c39cf921..9ff2c0ed 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/api/tcpip.c b/src/api/tcpip.c index e27dae0c..bdd35932 100644 --- a/src/api/tcpip.c +++ b/src/api/tcpip.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/core/dhcp.c b/src/core/dhcp.c index 2c3ae455..db832270 100644 --- a/src/core/dhcp.c +++ b/src/core/dhcp.c @@ -6,8 +6,8 @@ /* * - * Copyright (c) 2001-2003 Leon Woestenberg - * Copyright (c) 2001-2003 Axon Digital Design B.V., The Netherlands. + * Copyright (c) 2001-2004 Leon Woestenberg + * Copyright (c) 2001-2004 Axon Digital Design B.V., The Netherlands. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -67,8 +67,6 @@ * to remove the DHCP client. * */ -#ifdef LWIP_DHCP /* don't build if not configured for use in lwipopt.h */ - #include "lwip/stats.h" #include "lwip/mem.h" #include "lwip/udp.h" @@ -1420,5 +1418,3 @@ static u32_t dhcp_get_option_long(u8_t *ptr) LWIP_DEBUGF(DHCP_DEBUG, ("option long value=%lu\n", value)); return value; } - -#endif /* LWIP_DHCP */ diff --git a/src/core/inet.c b/src/core/inet.c index a0243987..818f7ba9 100644 --- a/src/core/inet.c +++ b/src/core/inet.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/core/inet6.c b/src/core/inet6.c index 2a1931fe..c04915b7 100644 --- a/src/core/inet6.c +++ b/src/core/inet6.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/core/ipv4/icmp.c b/src/core/ipv4/icmp.c index 078100be..fbf5e7e5 100644 --- a/src/core/ipv4/icmp.c +++ b/src/core/ipv4/icmp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/core/ipv4/ip.c b/src/core/ipv4/ip.c index 25862519..e39334a5 100644 --- a/src/core/ipv4/ip.c +++ b/src/core/ipv4/ip.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -73,57 +73,6 @@ ip_init(void) { } -/* ip_lookup: - * - * An experimental feature that will be changed in future versions. Do - * not depend on it yet... - */ - -#ifdef LWIP_DEBUG -u8_t -ip_lookup(void *header, struct netif *inp) -{ - struct ip_hdr *iphdr; - - iphdr = header; - - /* not IP v4? */ - if (IPH_V(iphdr) != 4) { - return 0; - } - - /* Immediately accept/decline packets that are fragments or has - options. */ -#if IP_REASSEMBLY == 0 - /* if ((IPH_OFFSET(iphdr) & htons(IP_OFFMASK | IP_MF)) != 0) { - return 0; - }*/ -#endif /* IP_REASSEMBLY == 0 */ - -#if IP_OPTIONS == 0 - if (IPH_HL(iphdr) != 5) { - return 0; - } -#endif /* IP_OPTIONS == 0 */ - - switch (IPH_PROTO(iphdr)) { -#if LWIP_UDP - case IP_PROTO_UDP: - case IP_PROTO_UDPLITE: - return udp_lookup(iphdr, inp); -#endif /* LWIP_UDP */ -#if LWIP_TCP - case IP_PROTO_TCP: - return 1; -#endif /* LWIP_TCP */ - case IP_PROTO_ICMP: - return 1; - default: - return 0; - } -} -#endif /* LWIP_DEBUG */ - /* ip_route: * * Finds the appropriate network interface for a given IP address. It diff --git a/src/core/ipv4/ip_addr.c b/src/core/ipv4/ip_addr.c index 83da77f7..d01420be 100644 --- a/src/core/ipv4/ip_addr.c +++ b/src/core/ipv4/ip_addr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/core/ipv4/ip_frag.c b/src/core/ipv4/ip_frag.c index 141293ff..ab5e6503 100644 --- a/src/core/ipv4/ip_frag.c +++ b/src/core/ipv4/ip_frag.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/core/ipv6/icmp6.c b/src/core/ipv6/icmp6.c index 832e0417..a162758a 100644 --- a/src/core/ipv6/icmp6.c +++ b/src/core/ipv6/icmp6.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/core/ipv6/ip6.c b/src/core/ipv6/ip6.c index 00496f60..403e4de0 100644 --- a/src/core/ipv6/ip6.c +++ b/src/core/ipv6/ip6.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/core/ipv6/ip6_addr.c b/src/core/ipv6/ip6_addr.c index 1f6700d3..3e11e07e 100644 --- a/src/core/ipv6/ip6_addr.c +++ b/src/core/ipv6/ip6_addr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/core/mem.c b/src/core/mem.c index 8f79a8d0..4f6c9217 100644 --- a/src/core/mem.c +++ b/src/core/mem.c @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -292,7 +292,7 @@ mem_malloc(mem_size_t size) } sys_sem_signal(mem_sem); LWIP_ASSERT("mem_malloc: allocated memory not above ram_end.", - (mem_ptr_t)mem + SIZEOF_STRUCT_MEM + size <= (mem_ptr_t)ram_end); + (u32_t)mem + SIZEOF_STRUCT_MEM + size <= (u32_t)ram_end); LWIP_ASSERT("mem_malloc: allocated memory properly aligned.", (unsigned long)((u8_t *)mem + SIZEOF_STRUCT_MEM) % MEM_ALIGNMENT == 0); return (u8_t *)mem + SIZEOF_STRUCT_MEM; diff --git a/src/core/memp.c b/src/core/memp.c index 739bce43..7eaf7bfc 100644 --- a/src/core/memp.c +++ b/src/core/memp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -217,7 +217,7 @@ memp_malloc(memp_t type) sys_sem_signal(mutex); #endif /* SYS_LIGHTWEIGHT_PROT */ LWIP_ASSERT("memp_malloc: memp properly aligned", - ((mem_ptr_t)MEM_ALIGN((u8_t *)memp + sizeof(struct memp)) % MEM_ALIGNMENT) == 0); + ((u32_t)MEM_ALIGN((u8_t *)memp + sizeof(struct memp)) % MEM_ALIGNMENT) == 0); mem = MEM_ALIGN((u8_t *)memp + sizeof(struct memp)); return mem; diff --git a/src/core/netif.c b/src/core/netif.c index 3ae8307a..13632d4b 100644 --- a/src/core/netif.c +++ b/src/core/netif.c @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -186,7 +186,7 @@ netif_set_ipaddr(struct netif *netif, struct ip_addr *ipaddr) pcb = pcb->next; } } - for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) { + for (lpcb = tcp_listen_pcbs; lpcb != NULL; lpcb = lpcb->next) { /* PCB bound to current local interface address? */ if (ip_addr_cmp(&(lpcb->local_ip), &(netif->ip_addr))) { /* The PCB is listening to the old ipaddr and diff --git a/src/core/pbuf.c b/src/core/pbuf.c index a04c617d..20843080 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -28,7 +28,7 @@ */ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -100,7 +100,7 @@ pbuf_init(void) u16_t i; pbuf_pool = (struct pbuf *)&pbuf_pool_memory[0]; - LWIP_ASSERT("pbuf_init: pool aligned", (mem_ptr_t)pbuf_pool % MEM_ALIGNMENT == 0); + LWIP_ASSERT("pbuf_init: pool aligned", (long)pbuf_pool % MEM_ALIGNMENT == 0); #if PBUF_STATS lwip_stats.pbuf.avail = PBUF_POOL_SIZE; @@ -254,7 +254,7 @@ pbuf_alloc(pbuf_layer l, u16_t length, pbuf_flag flag) /* make the payload pointer point 'offset' bytes into pbuf data memory */ p->payload = MEM_ALIGN((void *)((u8_t *)p + (sizeof(struct pbuf) + offset))); LWIP_ASSERT("pbuf_alloc: pbuf p->payload properly aligned", - ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0); + ((u32_t)p->payload % MEM_ALIGNMENT) == 0); /* the total length of the pbuf chain is the requested size */ p->tot_len = length; /* set the length of the first pbuf in the chain */ @@ -290,7 +290,7 @@ pbuf_alloc(pbuf_layer l, u16_t length, pbuf_flag flag) q->len = rem_len > PBUF_POOL_BUFSIZE? PBUF_POOL_BUFSIZE: rem_len; q->payload = (void *)((u8_t *)q + sizeof(struct pbuf)); LWIP_ASSERT("pbuf_alloc: pbuf q->payload properly aligned", - ((mem_ptr_t)q->payload % MEM_ALIGNMENT) == 0); + ((u32_t)q->payload % MEM_ALIGNMENT) == 0); q->ref = 1; /* calculate remaining length to be allocated */ rem_len -= q->len; @@ -314,7 +314,7 @@ pbuf_alloc(pbuf_layer l, u16_t length, pbuf_flag flag) p->flags = PBUF_FLAG_RAM; LWIP_ASSERT("pbuf_alloc: pbuf->payload properly aligned", - ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0); + ((u32_t)p->payload % MEM_ALIGNMENT) == 0); break; /* pbuf references existing (static constant) ROM payload? */ case PBUF_ROM: diff --git a/src/core/raw.c b/src/core/raw.c index 7e3aa41d..c4c69e54 100644 --- a/src/core/raw.c +++ b/src/core/raw.c @@ -4,7 +4,7 @@ * */ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/core/stats.c b/src/core/stats.c index 85ebda4d..85a55b9e 100644 --- a/src/core/stats.c +++ b/src/core/stats.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/core/sys.c b/src/core/sys.c index cc4aaf07..657d72a8 100644 --- a/src/core/sys.c +++ b/src/core/sys.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/core/tcp.c b/src/core/tcp.c index a7ca9228..8c67650e 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -62,9 +62,7 @@ const u8_t tcp_backoff[13] = { 1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7}; /* The TCP PCB lists. */ - -/* List of all TCP PCBs in LISTEN state. */ -union tcp_listen_pcbs_t tcp_listen_pcbs; +struct tcp_pcb_listen *tcp_listen_pcbs; /* List of all TCP PCBs in LISTEN state. */ struct tcp_pcb *tcp_active_pcbs; /* List of all TCP PCBs that are in a state in which they accept or send data. */ @@ -87,7 +85,7 @@ void tcp_init(void) { /* Clear globals. */ - tcp_listen_pcbs.listen_pcbs = NULL; + tcp_listen_pcbs = NULL; tcp_active_pcbs = NULL; tcp_tw_pcbs = NULL; tcp_tmp_pcb = NULL; @@ -138,7 +136,7 @@ tcp_close(struct tcp_pcb *pcb) switch (pcb->state) { case LISTEN: err = ERR_OK; - tcp_pcb_remove((struct tcp_pcb **)&tcp_listen_pcbs.pcbs, pcb); + tcp_pcb_remove((struct tcp_pcb **)&tcp_listen_pcbs, pcb); memp_free(MEMP_TCP_PCB_LISTEN, pcb); pcb = NULL; break; @@ -253,7 +251,7 @@ tcp_bind(struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t port) } #ifndef SO_REUSE /* Check if the address already is in use. */ - for(cpcb = (struct tcp_pcb *)tcp_listen_pcbs.pcbs; + for(cpcb = (struct tcp_pcb *)tcp_listen_pcbs; cpcb != NULL; cpcb = cpcb->next) { if (cpcb->local_port == port) { if (ip_addr_isany(&(cpcb->local_ip)) || @@ -286,7 +284,7 @@ tcp_bind(struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t port) When the two options aren't set and specified port is already bound, ERR_USE is returned saying that address is already in use. */ - for(cpcb = (struct tcp_pcb *)tcp_listen_pcbs.pcbs; cpcb != NULL; cpcb = cpcb->next) { + for(cpcb = (struct tcp_pcb *)tcp_listen_pcbs; cpcb != NULL; cpcb = cpcb->next) { if(cpcb->local_port == port) { if(ip_addr_cmp(&(cpcb->local_ip), ipaddr)) { if(pcb->so_options & SOF_REUSEPORT) { @@ -423,7 +421,7 @@ tcp_listen(struct tcp_pcb *pcb) #if LWIP_CALLBACK_API lpcb->accept = tcp_accept_null; #endif /* LWIP_CALLBACK_API */ - TCP_REG(&tcp_listen_pcbs.listen_pcbs, lpcb); + TCP_REG(&tcp_listen_pcbs, lpcb); return (struct tcp_pcb *)lpcb; } @@ -485,7 +483,7 @@ tcp_new_port(void) goto again; } } - for(pcb = (struct tcp_pcb *)tcp_listen_pcbs.pcbs; pcb != NULL; pcb = pcb->next) { + for(pcb = (struct tcp_pcb *)tcp_listen_pcbs; pcb != NULL; pcb = pcb->next) { if (pcb->local_port == port) { goto again; } @@ -1255,7 +1253,7 @@ tcp_debug_print_pcbs(void) tcp_debug_print_state(pcb->state); } LWIP_DEBUGF(TCP_DEBUG, ("Listen PCB states:\n")); - for(pcb = (struct tcp_pcb *)tcp_listen_pcbs.pcbs; pcb != NULL; pcb = pcb->next) { + for(pcb = (struct tcp_pcb *)tcp_listen_pcbs; pcb != NULL; pcb = pcb->next) { LWIP_DEBUGF(TCP_DEBUG, ("Local port %u, foreign port %u snd_nxt %lu rcv_nxt %lu ", pcb->local_port, pcb->remote_port, pcb->snd_nxt, pcb->rcv_nxt)); diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c index 6727a3b0..8260c22a 100644 --- a/src/core/tcp_in.c +++ b/src/core/tcp_in.c @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -255,7 +255,7 @@ tcp_input(struct pbuf *p, struct netif *inp) /* Finally, if we still did not get a match, we check all PCBs that are LISTENing for incoming connections. */ prev = NULL; - for(lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) { + for(lpcb = tcp_listen_pcbs; lpcb != NULL; lpcb = lpcb->next) { if ((ip_addr_isany(&(lpcb->local_ip)) || ip_addr_cmp(&(lpcb->local_ip), &(iphdr->dest))) && lpcb->local_port == tcphdr->dest) { @@ -265,9 +265,9 @@ tcp_input(struct pbuf *p, struct netif *inp) if (prev != NULL) { ((struct tcp_pcb_listen *)prev)->next = lpcb->next; /* our successor is the remainder of the listening list */ - lpcb->next = tcp_listen_pcbs.listen_pcbs; + lpcb->next = tcp_listen_pcbs; /* put this listening pcb at the head of the listening list */ - tcp_listen_pcbs.listen_pcbs = lpcb; + tcp_listen_pcbs = lpcb; } LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: packed for LISTENing connection.\n")); diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c index fbfc831b..70838947 100644 --- a/src/core/tcp_out.c +++ b/src/core/tcp_out.c @@ -4,7 +4,7 @@ * Transmission Control Protocol, outgoing traffic */ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/core/udp.c b/src/core/udp.c index 292ff690..a95cb770 100644 --- a/src/core/udp.c +++ b/src/core/udp.c @@ -4,7 +4,7 @@ * */ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -71,76 +71,6 @@ udp_init(void) udp_pcbs = pcb_cache = NULL; } - -/* udp_lookup: - * - * An experimental feature that will be changed in future versions. Do - * not depend on it yet... - */ - -#ifdef LWIP_DEBUG -u8_t -udp_lookup(struct ip_hdr *iphdr, struct netif *inp) -{ - struct udp_pcb *pcb; - struct udp_hdr *udphdr; - u16_t src, dest; - - PERF_START; - (void)inp; - - udphdr = (struct udp_hdr *)(u8_t *)iphdr + IPH_HL(iphdr) * 4; - - src = ntohs(udphdr->src); - dest = ntohs(udphdr->dest); - - pcb = pcb_cache; - if (pcb != NULL && - pcb->remote_port == src && - pcb->local_port == dest && - (ip_addr_isany(&pcb->remote_ip) || - ip_addr_cmp(&(pcb->remote_ip), &(iphdr->src))) && - (ip_addr_isany(&pcb->local_ip) || - ip_addr_cmp(&(pcb->local_ip), &(iphdr->dest)))) { - return 1; - } - else { - for(pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) { - if (pcb->remote_port == src && - pcb->local_port == dest && - (ip_addr_isany(&pcb->remote_ip) || - ip_addr_cmp(&(pcb->remote_ip), &(iphdr->src))) && - (ip_addr_isany(&pcb->local_ip) || - ip_addr_cmp(&(pcb->local_ip), &(iphdr->dest)))) { - pcb_cache = pcb; - break; - } - } - - if (pcb == NULL) { - for(pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) { - if (pcb->remote_port == 0 && - pcb->local_port == dest && - (ip_addr_isany(&pcb->remote_ip) || - ip_addr_cmp(&(pcb->remote_ip), &(iphdr->src))) && - (ip_addr_isany(&pcb->local_ip) || - ip_addr_cmp(&(pcb->local_ip), &(iphdr->dest)))) { - break; - } - } - } - } - - PERF_STOP("udp_lookup"); - - if (pcb != NULL) { - return 1; - } - else { - return 1; - } -} -#endif /* LWIP_DEBUG */ /** * Process an incoming UDP datagram. * diff --git a/src/netif/etharp.c b/src/netif/etharp.c index ebbabfbc..8d34923b 100644 --- a/src/netif/etharp.c +++ b/src/netif/etharp.c @@ -11,7 +11,7 @@ */ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -372,20 +372,22 @@ update_arp_entry(struct netif *netif, struct ip_addr *ipaddr, struct eth_addr *e #if ARP_QUEUEING /* get the first packet on the queue (if any) */ p = arp_table[i].p; - /* queued packet present? */ + /* (another) queued packet present? */ while (p != NULL) { struct pbuf *q, *n; /* search for second packet on queue (n) */ q = p; while (q->tot_len > q->len) { - /* proceed to next pbuf of this packet */ - LWIP_ASSERT("q->next ! NULL", q->next != NULL); - q = q->next; + LWIP_ASSERT("q->next != NULL (while q->tot_len > q->len)", q->next != NULL); + /* proceed to next pbuf of this packet */ + q = q->next; } - /* { q = last pbuf of first packet, q->tot_len = q->len } */ + /* { q = last pbuf of this packet, q->tot_len == q->len } */ + LWIP_ASSERT("q->tot_len == q->len", q->tot_len == q->len); + /* remember next packet on queue */ n = q->next; - /* { n = first pbuf of 2nd packet, or NULL if no 2nd packet } */ - /* terminate the first packet pbuf chain */ + /* { n = first pbuf of next packet, or NULL if no next packet } */ + /* terminate this packet pbuf chain */ q->next = NULL; /* fill-in Ethernet header */ ethhdr = p->payload; @@ -394,7 +396,7 @@ update_arp_entry(struct netif *netif, struct ip_addr *ipaddr, struct eth_addr *e ethhdr->src.addr[k] = netif->hwaddr[k]; } ethhdr->type = htons(ETHTYPE_IP); - LWIP_DEBUGF(ETHARP_DEBUG | DBG_TRACE, ("update_arp_entry: sending queued IP packet %p.\n",(void *)p)); + LWIP_DEBUGF(ETHARP_DEBUG | DBG_TRACE, ("update_arp_entry: sending queued IP packet %p.\n", (void *)p)); /* send the queued IP packet */ netif->linkoutput(netif, p); /* free the queued IP packet */ @@ -405,10 +407,11 @@ update_arp_entry(struct netif *netif, struct ip_addr *ipaddr, struct eth_addr *e /* NULL attached buffer*/ arp_table[i].p = NULL; #endif + /* IP addresses should only occur once in the ARP entry, we are done */ return NULL; } - } /* if */ - } /* for */ + } /* if STABLE */ + } /* for all ARP entries */ /* no matching ARP entry was found */ LWIP_ASSERT("update_arp_entry: i == ARP_TABLE_SIZE", i == ARP_TABLE_SIZE); @@ -582,7 +585,7 @@ etharp_arp_input(struct netif *netif, struct eth_addr *ethaddr, struct pbuf *p) /* ARP reply. We insert or update the ARP table later. */ LWIP_DEBUGF(ETHARP_DEBUG | DBG_TRACE, ("etharp_arp_input: incoming ARP reply\n")); #if (LWIP_DHCP && DHCP_DOES_ARP_CHECK) - /* DHCP needs to know about ARP replies to our address */ + /* DHCP wants to know about ARP replies to our wanna-have-address */ if (for_us) dhcp_arp_reply(netif, &hdr->sipaddr); #endif break; diff --git a/src/netif/ethernetif.c b/src/netif/ethernetif.c index 557c00c6..f024661d 100644 --- a/src/netif/ethernetif.c +++ b/src/netif/ethernetif.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/netif/loopif.c b/src/netif/loopif.c index 9e7c03a0..f5bcc07c 100644 --- a/src/netif/loopif.c +++ b/src/netif/loopif.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, diff --git a/src/netif/ppp/auth.c b/src/netif/ppp/auth.c index 45001336..33349640 100644 --- a/src/netif/ppp/auth.c +++ b/src/netif/ppp/auth.c @@ -610,7 +610,7 @@ int get_secret( addrs = NULL; - if(!client || !client[0] && strcmp(client, ppp_settings.user)) { + if(!client || !client[0] || strcmp(client, ppp_settings.user)) { return 0; } diff --git a/src/netif/ppp/chpms.h b/src/netif/ppp/chpms.h index ea4f8b34..c5844721 100644 --- a/src/netif/ppp/chpms.h +++ b/src/netif/ppp/chpms.h @@ -51,7 +51,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: chpms.h,v 1.2 2003/11/14 14:56:31 likewise Exp $ + * $Id: chpms.h,v 1.3 2004/02/07 00:30:03 likewise Exp $ */ #ifndef CHPMS_H diff --git a/src/netif/ppp/vj.h b/src/netif/ppp/vj.h index fb080936..71720814 100644 --- a/src/netif/ppp/vj.h +++ b/src/netif/ppp/vj.h @@ -1,7 +1,7 @@ /* * Definitions for tcp compression routines. * - * $Id: vj.h,v 1.3 2003/11/14 14:56:31 likewise Exp $ + * $Id: vj.h,v 1.4 2004/02/07 00:30:03 likewise Exp $ * * Copyright (c) 1989 Regents of the University of California. * All rights reserved. diff --git a/src/netif/slipif.c b/src/netif/slipif.c index 97618517..b349d82c 100644 --- a/src/netif/slipif.c +++ b/src/netif/slipif.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Swedish Institute of Computer Science. + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without