summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-01-10 17:17:53 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-01-10 17:17:53 +0000
commitb2ad5f821b1381492d792ca10b1eb7a107b48f14 (patch)
tree954a648692e7da983db1d2470953705f6a729264 /net/core
parentc9c06167e7933d93a6e396174c68abf242294abb (diff)
Merge with Linux 2.4.0-prerelease. Big Makefile rewrite, test your
Makefiles.
Diffstat (limited to 'net/core')
-rw-r--r--net/core/Makefile30
-rw-r--r--net/core/skbuff.c15
-rw-r--r--net/core/sock.c23
3 files changed, 26 insertions, 42 deletions
diff --git a/net/core/Makefile b/net/core/Makefile
index af3c74091..9a0e8ff97 100644
--- a/net/core/Makefile
+++ b/net/core/Makefile
@@ -9,35 +9,23 @@
O_TARGET := core.o
-O_OBJS := sock.o skbuff.o iovec.o datagram.o scm.o
+export-objs := netfilter.o profile.o
+
+obj-y := sock.o skbuff.o iovec.o datagram.o scm.o
ifeq ($(CONFIG_SYSCTL),y)
ifeq ($(CONFIG_NET),y)
-O_OBJS += sysctl_net_core.o
-endif
+obj-y += sysctl_net_core.o
endif
-
-ifdef CONFIG_FILTER
-O_OBJS += filter.o
-endif
-
-ifdef CONFIG_NET
-
-O_OBJS += dev.o dev_mcast.o dst.o neighbour.o rtnetlink.o utils.o
-
-ifdef CONFIG_NETFILTER
-OX_OBJS += netfilter.o
endif
-ifeq ($(CONFIG_NET_DIVERT),y)
-O_OBJS += dv.o
-endif
+obj-$(CONFIG_FILTER) += filter.o
-endif
+obj-$(CONFIG_NET) += dev.o dev_mcast.o dst.o neighbour.o rtnetlink.o utils.o
-ifdef CONFIG_NET_PROFILE
-OX_OBJS += profile.o
-endif
+obj-$(CONFIG_NETFILTER) += netfilter.o
+obj-$(CONFIG_NET_DIVERT) += dv.o
+obj-$(CONFIG_NET_PROFILE) += profile.o
include $(TOPDIR)/Rules.make
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index c5dcecfb3..5275e83b8 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -223,15 +223,20 @@ static inline void skb_headerinit(void *p, kmem_cache_t *cache,
{
struct sk_buff *skb = p;
- skb->destructor = NULL;
- skb->pkt_type = PACKET_HOST; /* Default type */
- skb->prev = skb->next = NULL;
+ skb->next = NULL;
+ skb->prev = NULL;
skb->list = NULL;
skb->sk = NULL;
skb->stamp.tv_sec=0; /* No idea about time */
+ skb->dev = NULL;
+ skb->dst = NULL;
+ memset(skb->cb, 0, sizeof(skb->cb));
+ skb->pkt_type = PACKET_HOST; /* Default type */
skb->ip_summed = 0;
+ skb->priority = 0;
skb->security = 0; /* By default packets are insecure */
- skb->dst = NULL;
+ skb->destructor = NULL;
+
#ifdef CONFIG_NETFILTER
skb->nfmark = skb->nfcache = 0;
skb->nfct = NULL;
@@ -242,8 +247,6 @@ static inline void skb_headerinit(void *p, kmem_cache_t *cache,
#ifdef CONFIG_NET_SCHED
skb->tc_index = 0;
#endif
- memset(skb->cb, 0, sizeof(skb->cb));
- skb->priority = 0;
}
/*
diff --git a/net/core/sock.c b/net/core/sock.c
index 7b9484437..d15bd82f4 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -7,7 +7,7 @@
* handler for protocols to use and generic option handler.
*
*
- * Version: $Id: sock.c,v 1.101 2000/11/10 04:02:04 davem Exp $
+ * Version: $Id: sock.c,v 1.102 2000/12/11 23:00:24 davem Exp $
*
* Authors: Ross Biro, <bir7@leland.Stanford.Edu>
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -866,24 +866,17 @@ void sklist_remove_socket(struct sock **list, struct sock *sk)
write_lock_bh(&net_big_sklist_lock);
- s= *list;
- if(s==sk)
- {
- *list = s->next;
- write_unlock_bh(&net_big_sklist_lock);
- sock_put(sk);
- return;
- }
- while(s && s->next)
- {
- if(s->next==sk)
- {
- s->next=sk->next;
+ while ((s = *list) != NULL) {
+ if (s == sk) {
+ *list = s->next;
break;
}
- s=s->next;
+ list = &s->next;
}
+
write_unlock_bh(&net_big_sklist_lock);
+ if (s)
+ sock_put(s);
}
void sklist_insert_socket(struct sock **list, struct sock *sk)