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
VERSION = 1
PATCHLEVEL = 0
-ALPHA =
+SUBLEVEL = 1
all: Version zImage
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
}
}
+ FPU_EIP = FPU_ORIG_EIP; /* Point to current FPU instruction. */
+
RE_ENTRANT_CHECK_OFF;
current->tss.trap_no = 16;
current->tss.error_code = 0;
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;
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. */
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++;
/* 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++;
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;
/* 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)
{
/* 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
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:
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;
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);
/* Any data left to process? */
while((skb=skb_dequeue(&backlog))!=NULL)
{
+ backlog_size--;
nitcount=dev_nit;
flag=0;
sti();
* Authors: Ross Biro, <bir7@leland.Stanford.Edu>
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
* Donald Becker, <becker@super.org>
+ * Alan Cox, <gw4pts@gw4pts.ampr.org>
*
* Fixes:
* Alan Cox : Commented a couple of minor bits of surplus code
* 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
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);
}
* 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;
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));
/* 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)
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;
}
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;
len/=8;
len*=8;
}
-#endif
DPRINTF((DBG_IP,"IP: frag: creating fragment of %d bytes (%d total)\n",
len, len + hlen));
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);
+ }
}
}
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)
* Mark Evans, <evansmp@uhura.aston.ac.uk>
* Corey Minyard <wf-rch!minyard@relay.EU.net>
* 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:
* Alan Cox : Numerous verify_area() calls
* Charles Hedrick : Window fix
* Linus : Rewrote tcp_read() and URG handling
* completely
+ * Gerhard Koerting: Fixed some missing timer handling
*
*
* To Fix:
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;
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;
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;