diff -u --recursive --new-file v1.0/linux/CREDITS linux/CREDITS --- v1.0/linux/CREDITS Mon Mar 14 11:30:51 1994 +++ linux/CREDITS Tue Mar 15 11:23:06 1994 @@ -390,7 +390,7 @@ S: Germany N: Ian A. Murdock -E: imurdock@shell.portal.com +E: imurdock@gnu.ai.mit.edu D: Creator of Debian distribution S: 30 White Tail Lane S: Lafayette, Indiana 47906 diff -u --recursive --new-file v1.0/linux/Makefile linux/Makefile --- v1.0/linux/Makefile Mon Mar 14 11:30:51 1994 +++ linux/Makefile Tue Mar 15 17:32:42 1994 @@ -1,6 +1,6 @@ VERSION = 1 PATCHLEVEL = 0 -ALPHA = +SUBLEVEL = 1 all: Version zImage @@ -128,7 +128,7 @@ tools/version.h: $(CONFIGURE) Makefile @./makever.sh - @echo \#define UTS_RELEASE \"$(VERSION).$(PATCHLEVEL)$(ALPHA)\" > tools/version.h + @echo \#define UTS_RELEASE \"$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)\" > tools/version.h @echo \#define UTS_VERSION \"\#`cat .version` `date`\" >> tools/version.h @echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> tools/version.h @echo \#define LINUX_COMPILE_BY \"`whoami`\" >> tools/version.h diff -u --recursive --new-file v1.0/linux/drivers/FPU-emu/fpu_entry.c linux/drivers/FPU-emu/fpu_entry.c --- v1.0/linux/drivers/FPU-emu/fpu_entry.c Mon Feb 21 20:36:51 1994 +++ linux/drivers/FPU-emu/fpu_entry.c Wed Mar 16 09:54:24 1994 @@ -279,6 +279,8 @@ } } + FPU_EIP = FPU_ORIG_EIP; /* Point to current FPU instruction. */ + RE_ENTRANT_CHECK_OFF; current->tss.trap_no = 16; current->tss.error_code = 0; diff -u --recursive --new-file v1.0/linux/drivers/char/lp.c linux/drivers/char/lp.c --- v1.0/linux/drivers/char/lp.c Wed Dec 1 14:44:15 1993 +++ linux/drivers/char/lp.c Wed Mar 16 11:06:17 1994 @@ -170,6 +170,7 @@ current->timeout = jiffies + LP_TIMEOUT_INTERRUPT; interruptible_sleep_on(&lp->lp_wait_q); outb_p((LP_PSELECP|LP_PINITP), (LP_C(minor))); + sti(); if (current->signal & ~current->blocked) { if (total_bytes_written + bytes_written) return total_bytes_written + bytes_written; diff -u --recursive --new-file v1.0/linux/drivers/net/8390.c linux/drivers/net/8390.c --- v1.0/linux/drivers/net/8390.c Tue Feb 22 08:12:27 1994 +++ linux/drivers/net/8390.c Mon Mar 14 18:31:32 1994 @@ -145,14 +145,14 @@ return 1; } isr = inb(e8390_base+EN0_ISR); - printk("%s: transmit timed out, TX status %#2x, ISR %#2x.\n", + printk(KERN_DEBUG "%s: transmit timed out, TX status %#2x, ISR %#2x.\n", dev->name, txsr, isr); /* Does the 8390 thinks it has posted an interrupt? */ if (isr) - printk("%s: Possible IRQ conflict on IRQ%d?\n", dev->name, dev->irq); + printk(KERN_DEBUG "%s: Possible IRQ conflict on IRQ%d?\n", dev->name, dev->irq); else { /* The 8390 probably hasn't gotten on the cable yet. */ - printk("%s: Possible network cable problem?\n", dev->name); + printk(KERN_DEBUG "%s: Possible network cable problem?\n", dev->name); ei_local->interface_num ^= 1; /* Try a different xcvr. */ } /* Try to restart the card. Perhaps the user has fixed something. */ @@ -453,7 +453,7 @@ skb = alloc_skb(sksize, GFP_ATOMIC); if (skb == NULL) { - if (ei_debug) + if (ei_debug > 1) printk("%s: Couldn't allocate a sk_buff of size %d.\n", dev->name, sksize); ei_local->stat.rx_dropped++; @@ -513,7 +513,7 @@ /* We should already be stopped and in page0. Remove after testing. */ outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD); - if (ei_debug) + if (ei_debug > 1) printk("%s: Receiver overrun.\n", dev->name); ei_local->stat.rx_over_errors++; diff -u --recursive --new-file v1.0/linux/fs/select.c linux/fs/select.c --- v1.0/linux/fs/select.c Thu Feb 24 08:06:53 1994 +++ linux/fs/select.c Mon Mar 14 16:38:45 1994 @@ -75,7 +75,7 @@ return 0; } -int do_select(int n, fd_set *in, fd_set *out, fd_set *ex, +static int do_select(int n, fd_set *in, fd_set *out, fd_set *ex, fd_set *res_in, fd_set *res_out, fd_set *res_ex) { int count; diff -u --recursive --new-file v1.0/linux/mm/kmalloc.c linux/mm/kmalloc.c --- v1.0/linux/mm/kmalloc.c Mon Mar 14 11:30:57 1994 +++ linux/mm/kmalloc.c Mon Mar 14 18:30:57 1994 @@ -155,9 +155,12 @@ /* Sanity check... */ if (intr_count && priority != GFP_ATOMIC) { - printk("kmalloc called nonatomically from interrupt %08lx\n", - ((unsigned long *)&size)[-1]); - priority = GFP_ATOMIC; + static int count = 0; + if (++count < 5) { + printk("kmalloc called nonatomically from interrupt %08lx\n", + ((unsigned long *)&size)[-1]); + priority = GFP_ATOMIC; + } } if (size > MAX_KMALLOC_K * 1024) { @@ -214,11 +217,14 @@ /* This can be done with ints on: This is private to this invocation */ page = (struct page_descriptor *) __get_free_page (priority & GFP_LEVEL_MASK); - if (!page) - { - printk ("Couldn't get a free page.....\n"); + if (!page) { + static unsigned long last = 0; + if (last + 10*HZ < jiffies) { + last = jiffies; + printk ("Couldn't get a free page.....\n"); + } return NULL; - } + } #if 0 printk ("Got page %08x to use for %d byte mallocs....",(long)page,sz); #endif diff -u --recursive --new-file v1.0/linux/mm/swap.c linux/mm/swap.c --- v1.0/linux/mm/swap.c Mon Mar 14 11:30:57 1994 +++ linux/mm/swap.c Mon Mar 14 11:34:06 1994 @@ -595,9 +595,12 @@ Is this code reentrant? */ if (intr_count && priority != GFP_ATOMIC) { - printk("gfp called nonatomically from interrupt %08lx\n", - ((unsigned long *)&priority)[-1]); - priority = GFP_ATOMIC; + static int count = 0; + if (++count < 5) { + printk("gfp called nonatomically from interrupt %08lx\n", + ((unsigned long *)&priority)[-1]); + priority = GFP_ATOMIC; + } } save_flags(flag); repeat: diff -u --recursive --new-file v1.0/linux/net/inet/dev.c linux/net/inet/dev.c --- v1.0/linux/net/inet/dev.c Tue Feb 22 10:00:56 1994 +++ linux/net/inet/dev.c Mon Mar 14 17:38:27 1994 @@ -134,6 +134,7 @@ struct packet_type *ptype_base = &ip_packet_type; static struct sk_buff *volatile backlog = NULL; +static int backlog_size = 0; static unsigned long ip_bcast = 0; @@ -482,14 +483,25 @@ void netif_rx(struct sk_buff *skb) { + static int dropping = 0; /* Set any necessary flags. */ skb->sk = NULL; skb->free = 1; - + + /* check that we aren't oevrdoing things.. */ + if (!backlog_size) + dropping = 0; + else if (backlog_size > 100) + dropping = 1; + if (dropping) { + kfree_skb(skb, FREE_READ); + return; + } /* and add it to the "backlog" queue. */ IS_SKB(skb); skb_queue_tail(&backlog,skb); - + backlog_size++; + /* If any packet arrived, mark it for processing. */ if (backlog != NULL) mark_bh(INET_BH); @@ -607,6 +619,7 @@ /* Any data left to process? */ while((skb=skb_dequeue(&backlog))!=NULL) { + backlog_size--; nitcount=dev_nit; flag=0; sti(); diff -u --recursive --new-file v1.0/linux/net/inet/ip.c linux/net/inet/ip.c --- v1.0/linux/net/inet/ip.c Mon Mar 14 11:30:58 1994 +++ linux/net/inet/ip.c Wed Mar 16 10:21:22 1994 @@ -10,6 +10,7 @@ * Authors: Ross Biro, * Fred N. van Kempen, * Donald Becker, + * Alan Cox, * * Fixes: * Alan Cox : Commented a couple of minor bits of surplus code @@ -40,6 +41,9 @@ * Alan Cox : Silly ip bug when an overlength * fragment turns up. Now frees the * queue. + * Linus Torvalds/ : Memory leakage on fragmentation + * Alan Cox : handling. + * Gerhard Koerting: Forwarding uses IP priority hints * * To Fix: * IP option processing is mostly not needed. ip_forward needs to know about routing rules @@ -831,9 +835,8 @@ offset = ntohs(iph->frag_off); flags = offset & ~IP_OFFSET; offset &= IP_OFFSET; - if (((flags & IP_MF) == 0) && (offset == 0)) - { - if (qp != NULL) + if (((flags & IP_MF) == 0) && (offset == 0)) { + if (qp != NULL) ip_free(qp); /* Huh? How could this exist?? */ return(skb); } @@ -844,20 +847,20 @@ * as we still are receiving fragments. Otherwise, create a fresh * queue entry. */ - if (qp != NULL) - { - del_timer(&qp->timer); - qp->timer.expires = IP_FRAG_TIME; /* about 30 seconds */ - qp->timer.data = (unsigned long) qp; /* pointer to queue */ - qp->timer.function = ip_expire; /* expire function */ - add_timer(&qp->timer); - } - else - { - if ((qp = ip_create(skb, iph, dev)) == NULL) - return(NULL); - } - + if (qp != NULL) { + del_timer(&qp->timer); + qp->timer.expires = IP_FRAG_TIME; /* about 30 seconds */ + qp->timer.data = (unsigned long) qp; /* pointer to queue */ + qp->timer.function = ip_expire; /* expire function */ + add_timer(&qp->timer); + } else { + if ((qp = ip_create(skb, iph, dev)) == NULL) { + skb->sk = NULL; + kfree_skb(skb, FREE_READ); + return NULL; + } + } + /* Determine the position of this fragment. */ ihl = (iph->ihl * sizeof(unsigned long)); end = offset + ntohs(iph->tot_len) - ihl; @@ -924,6 +927,7 @@ if (tfp->next != NULL) next->next->prev = next->prev; + kfree_skb(next->skb, FREE_READ); kfree_s(next, sizeof(struct ipfrag)); } DPRINTF((DBG_IP, "IP: defrag: fixed high overlap %d bytes\n", i)); @@ -932,6 +936,11 @@ /* Insert this fragment in the chain of fragments. */ tfp = NULL; tfp = ip_frag_create(offset, end, skb, ptr); + if (!tfp) { + skb->sk = NULL; + kfree_skb(skb, FREE_READ); + return NULL; + } tfp->prev = prev; tfp->next = next; if (prev != NULL) @@ -1000,11 +1009,6 @@ dev->name, dev->mtu, left, in_ntoa(iph->saddr))); DPRINTF((DBG_IP, " DST=%s\n", in_ntoa(iph->daddr))); - /* - * FIXME: - * We should send an ICMP warning message here! - */ - icmp_send(skb,ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, dev); return; } @@ -1017,15 +1021,6 @@ while(left > 0) { len = left; -#ifdef OLD - if (len+8 > mtu) - len = (dev->mtu - hlen - 8); - if ((left - len) >= 8) - { - len /= 8; - len *= 8; - } -#else /* IF: it doesn't fit, use 'mtu' - the data space left */ if (len > mtu) len = mtu; @@ -1036,7 +1031,6 @@ len/=8; len*=8; } -#endif DPRINTF((DBG_IP,"IP: frag: creating fragment of %d bytes (%d total)\n", len, len + hlen)); @@ -1199,7 +1193,14 @@ kfree_skb(skb2,FREE_WRITE); } else - dev2->queue_xmit(skb2, dev2, SOPRI_NORMAL); + { + if(iph->tos & IPTOS_LOWDELAY) + dev2->queue_xmit(skb2, dev2, SOPRI_INTERACTIVE); + if(iph->tos & IPTOS_THROUGHPUT) + dev2->queue_xmit(skb2, dev2, SOPRI_BACKGROUND); + else + dev2->queue_xmit(skb2, dev2, SOPRI_NORMAL); + } } } diff -u --recursive --new-file v1.0/linux/net/inet/skbuff.c linux/net/inet/skbuff.c --- v1.0/linux/net/inet/skbuff.c Mon Mar 14 11:30:58 1994 +++ linux/net/inet/skbuff.c Mon Mar 14 11:35:45 1994 @@ -429,9 +429,12 @@ extern unsigned long intr_count; if (intr_count && priority != GFP_ATOMIC) { - printk("alloc_skb called nonatomically from interrupt %08lx\n", - ((unsigned long *)&size)[-1]); - priority = GFP_ATOMIC; + static int count = 0; + if (++count < 5) { + printk("alloc_skb called nonatomically from interrupt %08lx\n", + ((unsigned long *)&size)[-1]); + priority = GFP_ATOMIC; + } } skb=(struct sk_buff *)kmalloc(size,priority); if(skb==NULL) diff -u --recursive --new-file v1.0/linux/net/inet/tcp.c linux/net/inet/tcp.c --- v1.0/linux/net/inet/tcp.c Mon Mar 14 11:31:02 1994 +++ linux/net/inet/tcp.c Wed Mar 16 10:28:26 1994 @@ -12,6 +12,9 @@ * Mark Evans, * Corey Minyard * Florian La Roche, + * Charles Hedrick, + * Linus Torvalds, + * Alan Cox, * * Fixes: * Alan Cox : Numerous verify_area() calls @@ -63,6 +66,7 @@ * Charles Hedrick : Window fix * Linus : Rewrote tcp_read() and URG handling * completely + * Gerhard Koerting: Fixed some missing timer handling * * * To Fix: @@ -1487,8 +1491,13 @@ IPPROTO_TCP, sk->opt, sizeof(struct tcphdr),sk->ip_tos,sk->ip_ttl); if (tmp < 0) { + /* Finish anyway, treat this as a send that got lost. */ buff->free=1; prot->wfree(sk,buff->mem_addr, buff->mem_len); + if(sk->state==TCP_ESTABLISHED) + sk->state=TCP_FIN_WAIT1; + else + sk->state=TCP_FIN_WAIT2; release_sock(sk); DPRINTF((DBG_TCP, "Unable to build header for fin.\n")); return; @@ -2024,6 +2033,13 @@ sizeof(struct tcphdr),sk->ip_tos,sk->ip_ttl); if (tmp < 0) { kfree_skb(buff,FREE_WRITE); + if(sk->state==TCP_ESTABLISHED) + sk->state=TCP_FIN_WAIT1; + else + sk->state=TCP_FIN_WAIT2; + reset_timer(sk, TIME_CLOSE,4*sk->rto); + if(timeout) + tcp_time_wait(sk); DPRINTF((DBG_TCP, "Unable to build header for fin.\n")); release_sock(sk); return; @@ -2854,6 +2870,7 @@ case TCP_SYN_SENT: case TCP_ESTABLISHED: /* Contains the one that needs to be acked */ + reset_timer(sk, TIME_CLOSE, TCP_TIMEOUT_LEN); sk->fin_seq = th->seq+1; sk->state = TCP_CLOSE_WAIT; if (th->rst) sk->shutdown = SHUTDOWN_MASK;