Commit 5eb4898b authored by Linus Torvalds's avatar Linus Torvalds

Import 1.0.1

parent 13f97bf0
...@@ -390,7 +390,7 @@ S: D-37083 Goettingen ...@@ -390,7 +390,7 @@ S: D-37083 Goettingen
S: Germany S: Germany
N: Ian A. Murdock N: Ian A. Murdock
E: imurdock@shell.portal.com E: imurdock@gnu.ai.mit.edu
D: Creator of Debian distribution D: Creator of Debian distribution
S: 30 White Tail Lane S: 30 White Tail Lane
S: Lafayette, Indiana 47906 S: Lafayette, Indiana 47906
......
VERSION = 1 VERSION = 1
PATCHLEVEL = 0 PATCHLEVEL = 0
ALPHA = SUBLEVEL = 1
all: Version zImage all: Version zImage
...@@ -128,7 +128,7 @@ tools/./version.h: tools/version.h ...@@ -128,7 +128,7 @@ tools/./version.h: tools/version.h
tools/version.h: $(CONFIGURE) Makefile tools/version.h: $(CONFIGURE) Makefile
@./makever.sh @./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 UTS_VERSION \"\#`cat .version` `date`\" >> tools/version.h
@echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> tools/version.h @echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> tools/version.h
@echo \#define LINUX_COMPILE_BY \"`whoami`\" >> tools/version.h @echo \#define LINUX_COMPILE_BY \"`whoami`\" >> tools/version.h
......
...@@ -279,6 +279,8 @@ asmlinkage void math_emulate(long arg) ...@@ -279,6 +279,8 @@ asmlinkage void math_emulate(long arg)
} }
} }
FPU_EIP = FPU_ORIG_EIP; /* Point to current FPU instruction. */
RE_ENTRANT_CHECK_OFF; RE_ENTRANT_CHECK_OFF;
current->tss.trap_no = 16; current->tss.trap_no = 16;
current->tss.error_code = 0; current->tss.error_code = 0;
......
...@@ -170,6 +170,7 @@ static int lp_write_interrupt(struct inode * inode, struct file * file, char * b ...@@ -170,6 +170,7 @@ static int lp_write_interrupt(struct inode * inode, struct file * file, char * b
current->timeout = jiffies + LP_TIMEOUT_INTERRUPT; current->timeout = jiffies + LP_TIMEOUT_INTERRUPT;
interruptible_sleep_on(&lp->lp_wait_q); interruptible_sleep_on(&lp->lp_wait_q);
outb_p((LP_PSELECP|LP_PINITP), (LP_C(minor))); outb_p((LP_PSELECP|LP_PINITP), (LP_C(minor)));
sti();
if (current->signal & ~current->blocked) { if (current->signal & ~current->blocked) {
if (total_bytes_written + bytes_written) if (total_bytes_written + bytes_written)
return total_bytes_written + bytes_written; return total_bytes_written + bytes_written;
......
...@@ -145,14 +145,14 @@ static int ei_start_xmit(struct sk_buff *skb, struct device *dev) ...@@ -145,14 +145,14 @@ static int ei_start_xmit(struct sk_buff *skb, struct device *dev)
return 1; return 1;
} }
isr = inb(e8390_base+EN0_ISR); 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); dev->name, txsr, isr);
/* Does the 8390 thinks it has posted an interrupt? */ /* Does the 8390 thinks it has posted an interrupt? */
if (isr) 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 { else {
/* The 8390 probably hasn't gotten on the cable yet. */ /* 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. */ ei_local->interface_num ^= 1; /* Try a different xcvr. */
} }
/* Try to restart the card. Perhaps the user has fixed something. */ /* Try to restart the card. Perhaps the user has fixed something. */
...@@ -453,7 +453,7 @@ static void ei_receive(struct device *dev) ...@@ -453,7 +453,7 @@ static void ei_receive(struct device *dev)
skb = alloc_skb(sksize, GFP_ATOMIC); skb = alloc_skb(sksize, GFP_ATOMIC);
if (skb == NULL) { if (skb == NULL) {
if (ei_debug) if (ei_debug > 1)
printk("%s: Couldn't allocate a sk_buff of size %d.\n", printk("%s: Couldn't allocate a sk_buff of size %d.\n",
dev->name, sksize); dev->name, sksize);
ei_local->stat.rx_dropped++; ei_local->stat.rx_dropped++;
...@@ -513,7 +513,7 @@ static void ei_rx_overrun(struct device *dev) ...@@ -513,7 +513,7 @@ static void ei_rx_overrun(struct device *dev)
/* We should already be stopped and in page0. Remove after testing. */ /* We should already be stopped and in page0. Remove after testing. */
outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD); 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); printk("%s: Receiver overrun.\n", dev->name);
ei_local->stat.rx_over_errors++; ei_local->stat.rx_over_errors++;
......
...@@ -75,7 +75,7 @@ static int check(int flag, select_table * wait, struct file * file) ...@@ -75,7 +75,7 @@ static int check(int flag, select_table * wait, struct file * file)
return 0; 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) fd_set *res_in, fd_set *res_out, fd_set *res_ex)
{ {
int count; int count;
......
...@@ -155,9 +155,12 @@ void * kmalloc (size_t size, int priority) ...@@ -155,9 +155,12 @@ void * kmalloc (size_t size, int priority)
/* Sanity check... */ /* Sanity check... */
if (intr_count && priority != GFP_ATOMIC) { if (intr_count && priority != GFP_ATOMIC) {
printk("kmalloc called nonatomically from interrupt %08lx\n", static int count = 0;
((unsigned long *)&size)[-1]); if (++count < 5) {
priority = GFP_ATOMIC; printk("kmalloc called nonatomically from interrupt %08lx\n",
((unsigned long *)&size)[-1]);
priority = GFP_ATOMIC;
}
} }
if (size > MAX_KMALLOC_K * 1024) if (size > MAX_KMALLOC_K * 1024)
{ {
...@@ -214,11 +217,14 @@ while (tries --) ...@@ -214,11 +217,14 @@ while (tries --)
/* This can be done with ints on: This is private to this invocation */ /* This can be done with ints on: This is private to this invocation */
page = (struct page_descriptor *) __get_free_page (priority & GFP_LEVEL_MASK); page = (struct page_descriptor *) __get_free_page (priority & GFP_LEVEL_MASK);
if (!page) if (!page) {
{ static unsigned long last = 0;
printk ("Couldn't get a free page.....\n"); if (last + 10*HZ < jiffies) {
last = jiffies;
printk ("Couldn't get a free page.....\n");
}
return NULL; return NULL;
} }
#if 0 #if 0
printk ("Got page %08x to use for %d byte mallocs....",(long)page,sz); printk ("Got page %08x to use for %d byte mallocs....",(long)page,sz);
#endif #endif
......
...@@ -595,9 +595,12 @@ unsigned long __get_free_page(int priority) ...@@ -595,9 +595,12 @@ unsigned long __get_free_page(int priority)
Is this code reentrant? */ Is this code reentrant? */
if (intr_count && priority != GFP_ATOMIC) { if (intr_count && priority != GFP_ATOMIC) {
printk("gfp called nonatomically from interrupt %08lx\n", static int count = 0;
((unsigned long *)&priority)[-1]); if (++count < 5) {
priority = GFP_ATOMIC; printk("gfp called nonatomically from interrupt %08lx\n",
((unsigned long *)&priority)[-1]);
priority = GFP_ATOMIC;
}
} }
save_flags(flag); save_flags(flag);
repeat: repeat:
......
...@@ -134,6 +134,7 @@ static struct packet_type ip_packet_type = { ...@@ -134,6 +134,7 @@ static struct packet_type ip_packet_type = {
struct packet_type *ptype_base = &ip_packet_type; struct packet_type *ptype_base = &ip_packet_type;
static struct sk_buff *volatile backlog = NULL; static struct sk_buff *volatile backlog = NULL;
static int backlog_size = 0;
static unsigned long ip_bcast = 0; static unsigned long ip_bcast = 0;
...@@ -482,14 +483,25 @@ dev_queue_xmit(struct sk_buff *skb, struct device *dev, int pri) ...@@ -482,14 +483,25 @@ dev_queue_xmit(struct sk_buff *skb, struct device *dev, int pri)
void void
netif_rx(struct sk_buff *skb) netif_rx(struct sk_buff *skb)
{ {
static int dropping = 0;
/* Set any necessary flags. */ /* Set any necessary flags. */
skb->sk = NULL; skb->sk = NULL;
skb->free = 1; 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. */ /* and add it to the "backlog" queue. */
IS_SKB(skb); IS_SKB(skb);
skb_queue_tail(&backlog,skb); skb_queue_tail(&backlog,skb);
backlog_size++;
/* If any packet arrived, mark it for processing. */ /* If any packet arrived, mark it for processing. */
if (backlog != NULL) mark_bh(INET_BH); if (backlog != NULL) mark_bh(INET_BH);
...@@ -607,6 +619,7 @@ inet_bh(void *tmp) ...@@ -607,6 +619,7 @@ inet_bh(void *tmp)
/* Any data left to process? */ /* Any data left to process? */
while((skb=skb_dequeue(&backlog))!=NULL) while((skb=skb_dequeue(&backlog))!=NULL)
{ {
backlog_size--;
nitcount=dev_nit; nitcount=dev_nit;
flag=0; flag=0;
sti(); sti();
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
* Authors: Ross Biro, <bir7@leland.Stanford.Edu> * Authors: Ross Biro, <bir7@leland.Stanford.Edu>
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
* Donald Becker, <becker@super.org> * Donald Becker, <becker@super.org>
* Alan Cox, <gw4pts@gw4pts.ampr.org>
* *
* Fixes: * Fixes:
* Alan Cox : Commented a couple of minor bits of surplus code * Alan Cox : Commented a couple of minor bits of surplus code
...@@ -40,6 +41,9 @@ ...@@ -40,6 +41,9 @@
* Alan Cox : Silly ip bug when an overlength * Alan Cox : Silly ip bug when an overlength
* fragment turns up. Now frees the * fragment turns up. Now frees the
* queue. * queue.
* Linus Torvalds/ : Memory leakage on fragmentation
* Alan Cox : handling.
* Gerhard Koerting: Forwarding uses IP priority hints
* *
* To Fix: * To Fix:
* IP option processing is mostly not needed. ip_forward needs to know about routing rules * IP option processing is mostly not needed. ip_forward needs to know about routing rules
...@@ -831,9 +835,8 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct ...@@ -831,9 +835,8 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct
offset = ntohs(iph->frag_off); offset = ntohs(iph->frag_off);
flags = offset & ~IP_OFFSET; flags = offset & ~IP_OFFSET;
offset &= IP_OFFSET; offset &= IP_OFFSET;
if (((flags & IP_MF) == 0) && (offset == 0)) if (((flags & IP_MF) == 0) && (offset == 0)) {
{ if (qp != NULL)
if (qp != NULL)
ip_free(qp); /* Huh? How could this exist?? */ ip_free(qp); /* Huh? How could this exist?? */
return(skb); return(skb);
} }
...@@ -844,20 +847,20 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct ...@@ -844,20 +847,20 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct
* as we still are receiving fragments. Otherwise, create a fresh * as we still are receiving fragments. Otherwise, create a fresh
* queue entry. * queue entry.
*/ */
if (qp != NULL) if (qp != NULL) {
{ del_timer(&qp->timer);
del_timer(&qp->timer); qp->timer.expires = IP_FRAG_TIME; /* about 30 seconds */
qp->timer.expires = IP_FRAG_TIME; /* about 30 seconds */ qp->timer.data = (unsigned long) qp; /* pointer to queue */
qp->timer.data = (unsigned long) qp; /* pointer to queue */ qp->timer.function = ip_expire; /* expire function */
qp->timer.function = ip_expire; /* expire function */ add_timer(&qp->timer);
add_timer(&qp->timer); } else {
} if ((qp = ip_create(skb, iph, dev)) == NULL) {
else skb->sk = NULL;
{ kfree_skb(skb, FREE_READ);
if ((qp = ip_create(skb, iph, dev)) == NULL) return NULL;
return(NULL); }
} }
/* Determine the position of this fragment. */ /* Determine the position of this fragment. */
ihl = (iph->ihl * sizeof(unsigned long)); ihl = (iph->ihl * sizeof(unsigned long));
end = offset + ntohs(iph->tot_len) - ihl; end = offset + ntohs(iph->tot_len) - ihl;
...@@ -924,6 +927,7 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct ...@@ -924,6 +927,7 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct
if (tfp->next != NULL) if (tfp->next != NULL)
next->next->prev = next->prev; next->next->prev = next->prev;
kfree_skb(next->skb, FREE_READ);
kfree_s(next, sizeof(struct ipfrag)); kfree_s(next, sizeof(struct ipfrag));
} }
DPRINTF((DBG_IP, "IP: defrag: fixed high overlap %d bytes\n", i)); DPRINTF((DBG_IP, "IP: defrag: fixed high overlap %d bytes\n", i));
...@@ -932,6 +936,11 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct ...@@ -932,6 +936,11 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct
/* Insert this fragment in the chain of fragments. */ /* Insert this fragment in the chain of fragments. */
tfp = NULL; tfp = NULL;
tfp = ip_frag_create(offset, end, skb, ptr); tfp = ip_frag_create(offset, end, skb, ptr);
if (!tfp) {
skb->sk = NULL;
kfree_skb(skb, FREE_READ);
return NULL;
}
tfp->prev = prev; tfp->prev = prev;
tfp->next = next; tfp->next = next;
if (prev != NULL) if (prev != NULL)
...@@ -1000,11 +1009,6 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct ...@@ -1000,11 +1009,6 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct
dev->name, dev->mtu, left, in_ntoa(iph->saddr))); dev->name, dev->mtu, left, in_ntoa(iph->saddr)));
DPRINTF((DBG_IP, " DST=%s\n", in_ntoa(iph->daddr))); 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); icmp_send(skb,ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, dev);
return; return;
} }
...@@ -1017,15 +1021,6 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct ...@@ -1017,15 +1021,6 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct
while(left > 0) while(left > 0)
{ {
len = left; 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: it doesn't fit, use 'mtu' - the data space left */
if (len > mtu) if (len > mtu)
len = mtu; len = mtu;
...@@ -1036,7 +1031,6 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct ...@@ -1036,7 +1031,6 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct
len/=8; len/=8;
len*=8; len*=8;
} }
#endif
DPRINTF((DBG_IP,"IP: frag: creating fragment of %d bytes (%d total)\n", DPRINTF((DBG_IP,"IP: frag: creating fragment of %d bytes (%d total)\n",
len, len + hlen)); len, len + hlen));
...@@ -1199,7 +1193,14 @@ ip_forward(struct sk_buff *skb, struct device *dev, int is_frag) ...@@ -1199,7 +1193,14 @@ ip_forward(struct sk_buff *skb, struct device *dev, int is_frag)
kfree_skb(skb2,FREE_WRITE); kfree_skb(skb2,FREE_WRITE);
} }
else 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);
}
} }
} }
......
...@@ -429,9 +429,12 @@ struct sk_buff *alloc_skb(unsigned int size,int priority) ...@@ -429,9 +429,12 @@ struct sk_buff *alloc_skb(unsigned int size,int priority)
extern unsigned long intr_count; extern unsigned long intr_count;
if (intr_count && priority != GFP_ATOMIC) { if (intr_count && priority != GFP_ATOMIC) {
printk("alloc_skb called nonatomically from interrupt %08lx\n", static int count = 0;
((unsigned long *)&size)[-1]); if (++count < 5) {
priority = GFP_ATOMIC; printk("alloc_skb called nonatomically from interrupt %08lx\n",
((unsigned long *)&size)[-1]);
priority = GFP_ATOMIC;
}
} }
skb=(struct sk_buff *)kmalloc(size,priority); skb=(struct sk_buff *)kmalloc(size,priority);
if(skb==NULL) if(skb==NULL)
......
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
* Mark Evans, <evansmp@uhura.aston.ac.uk> * Mark Evans, <evansmp@uhura.aston.ac.uk>
* Corey Minyard <wf-rch!minyard@relay.EU.net> * Corey Minyard <wf-rch!minyard@relay.EU.net>
* Florian La Roche, <flla@stud.uni-sb.de> * Florian La Roche, <flla@stud.uni-sb.de>
* Charles Hedrick, <hedrick@klinzhai.rutgers.edu>
* Linus Torvalds, <torvalds@cs.helsinki.fi>
* Alan Cox, <gw4pts@gw4pts.ampr.org>
* *
* Fixes: * Fixes:
* Alan Cox : Numerous verify_area() calls * Alan Cox : Numerous verify_area() calls
...@@ -63,6 +66,7 @@ ...@@ -63,6 +66,7 @@
* Charles Hedrick : Window fix * Charles Hedrick : Window fix
* Linus : Rewrote tcp_read() and URG handling * Linus : Rewrote tcp_read() and URG handling
* completely * completely
* Gerhard Koerting: Fixed some missing timer handling
* *
* *
* To Fix: * To Fix:
...@@ -1487,8 +1491,13 @@ tcp_shutdown(struct sock *sk, int how) ...@@ -1487,8 +1491,13 @@ tcp_shutdown(struct sock *sk, int how)
IPPROTO_TCP, sk->opt, IPPROTO_TCP, sk->opt,
sizeof(struct tcphdr),sk->ip_tos,sk->ip_ttl); sizeof(struct tcphdr),sk->ip_tos,sk->ip_ttl);
if (tmp < 0) { if (tmp < 0) {
/* Finish anyway, treat this as a send that got lost. */
buff->free=1; buff->free=1;
prot->wfree(sk,buff->mem_addr, buff->mem_len); 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); release_sock(sk);
DPRINTF((DBG_TCP, "Unable to build header for fin.\n")); DPRINTF((DBG_TCP, "Unable to build header for fin.\n"));
return; return;
...@@ -2024,6 +2033,13 @@ tcp_close(struct sock *sk, int timeout) ...@@ -2024,6 +2033,13 @@ tcp_close(struct sock *sk, int timeout)
sizeof(struct tcphdr),sk->ip_tos,sk->ip_ttl); sizeof(struct tcphdr),sk->ip_tos,sk->ip_ttl);
if (tmp < 0) { if (tmp < 0) {
kfree_skb(buff,FREE_WRITE); 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")); DPRINTF((DBG_TCP, "Unable to build header for fin.\n"));
release_sock(sk); release_sock(sk);
return; return;
...@@ -2854,6 +2870,7 @@ tcp_fin(struct sock *sk, struct tcphdr *th, ...@@ -2854,6 +2870,7 @@ tcp_fin(struct sock *sk, struct tcphdr *th,
case TCP_SYN_SENT: case TCP_SYN_SENT:
case TCP_ESTABLISHED: case TCP_ESTABLISHED:
/* Contains the one that needs to be acked */ /* Contains the one that needs to be acked */
reset_timer(sk, TIME_CLOSE, TCP_TIMEOUT_LEN);
sk->fin_seq = th->seq+1; sk->fin_seq = th->seq+1;
sk->state = TCP_CLOSE_WAIT; sk->state = TCP_CLOSE_WAIT;
if (th->rst) sk->shutdown = SHUTDOWN_MASK; if (th->rst) sk->shutdown = SHUTDOWN_MASK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment