summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/802/p8022.c2
-rw-r--r--net/802/p8023.c2
-rw-r--r--net/802/psnap.c2
-rw-r--r--net/802/tr.c2
-rw-r--r--net/appletalk/aarp.c2
-rw-r--r--net/appletalk/ddp.c6
-rw-r--r--net/core/dev_mcast.c4
-rw-r--r--net/core/netfilter.c4
-rw-r--r--net/core/sock.c2
-rw-r--r--net/decnet/dn_dev.c2
-rw-r--r--net/decnet/dn_table.c2
-rw-r--r--net/ethernet/pe2.c2
-rw-r--r--net/ipv4/devinet.c4
-rw-r--r--net/ipv4/igmp.c2
-rw-r--r--net/ipv4/ip_options.c2
-rw-r--r--net/ipv4/ip_sockglue.c2
-rw-r--r--net/ipv4/ipconfig.c2
-rw-r--r--net/ipv4/netfilter/ipfwadm_core.c6
-rw-r--r--net/ipv4/netfilter/ipt_REJECT.c55
-rw-r--r--net/ipv4/syncookies.c2
-rw-r--r--net/ipv4/tcp_ipv4.c4
-rw-r--r--net/ipv6/mcast.c2
-rw-r--r--net/ipx/af_ipx.c6
-rw-r--r--net/packet/af_packet.c4
-rw-r--r--net/socket.c4
-rw-r--r--net/sunrpc/xprt.c5
-rw-r--r--net/unix/af_unix.c2
27 files changed, 69 insertions, 65 deletions
diff --git a/net/802/p8022.c b/net/802/p8022.c
index 7d03668d2..9be3100dd 100644
--- a/net/802/p8022.c
+++ b/net/802/p8022.c
@@ -130,7 +130,7 @@ void unregister_8022_client(unsigned char type)
{
if (tmp->type[0] == type) {
*clients = tmp->next;
- kfree_s(tmp, sizeof(struct datalink_proto));
+ kfree(tmp);
break;
} else {
clients = &tmp->next;
diff --git a/net/802/p8023.c b/net/802/p8023.c
index 90ac32365..57649c231 100644
--- a/net/802/p8023.c
+++ b/net/802/p8023.c
@@ -57,6 +57,6 @@ struct datalink_proto *make_8023_client(void)
void destroy_8023_client(struct datalink_proto *dl)
{
if (dl)
- kfree_s(dl,sizeof(struct datalink_proto));
+ kfree(dl);
}
diff --git a/net/802/psnap.c b/net/802/psnap.c
index 7d8b12047..3c493d7d9 100644
--- a/net/802/psnap.c
+++ b/net/802/psnap.c
@@ -141,7 +141,7 @@ void unregister_snap_client(unsigned char *desc)
if (memcmp(tmp->type,desc,5) == 0)
{
*clients = tmp->next;
- kfree_s(tmp, sizeof(struct datalink_proto));
+ kfree(tmp);
break;
}
else
diff --git a/net/802/tr.c b/net/802/tr.c
index cb6604698..097929257 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -434,7 +434,7 @@ static void rif_check_expire(unsigned long dummy)
if((now-entry->last_used) > sysctl_tr_rif_timeout)
{
*pentry=entry->next;
- kfree_s(entry,sizeof(struct rif_cache_s));
+ kfree(entry);
}
else
pentry=&entry->next;
diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c
index 37aae3e6c..f89f777ce 100644
--- a/net/appletalk/aarp.c
+++ b/net/appletalk/aarp.c
@@ -111,7 +111,7 @@ static void __aarp_expire(struct aarp_entry *a)
while ((skb=skb_dequeue(&a->packet_queue)) != NULL)
kfree_skb(skb);
- kfree_s(a, sizeof(*a));
+ kfree(a);
}
/*
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 896bc9384..4fca72a84 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -335,7 +335,7 @@ static void atif_drop_device(struct net_device *dev)
while ((tmp = *iface) != NULL) {
if (tmp->dev == dev) {
*iface = tmp->next;
- kfree_s(tmp, sizeof(struct atalk_iface));
+ kfree(tmp);
dev->atalk_ptr = NULL;
MOD_DEC_USE_COUNT;
} else
@@ -769,7 +769,7 @@ static int atrtr_delete(struct at_addr * addr)
(!(tmp->flags&RTF_GATEWAY) ||
tmp->target.s_node == addr->s_node)) {
*r = tmp->next;
- kfree_s(tmp, sizeof(struct atalk_route));
+ kfree(tmp);
goto out;
}
r = &tmp->next;
@@ -793,7 +793,7 @@ void atrtr_device_down(struct net_device *dev)
while ((tmp = *r) != NULL) {
if (tmp->dev == dev) {
*r = tmp->next;
- kfree_s(tmp, sizeof(struct atalk_route));
+ kfree(tmp);
} else {
r = &tmp->next;
}
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c
index 0dcedb142..cf590db04 100644
--- a/net/core/dev_mcast.c
+++ b/net/core/dev_mcast.c
@@ -129,7 +129,7 @@ int dev_mc_delete(struct net_device *dev, void *addr, int alen, int glbl)
dev->mc_count--;
write_unlock_bh(&dev_mc_lock);
- kfree_s(dmi, sizeof(*dmi));
+ kfree(dmi);
/*
* We have altered the list, so the card
@@ -205,7 +205,7 @@ void dev_mc_discard(struct net_device *dev)
dev->mc_list = tmp->next;
if (tmp->dmi_users > tmp->dmi_gusers)
printk("dev_mc_discard: multicast leakage! dmi_users=%d\n", tmp->dmi_users);
- kfree_s(tmp, sizeof(*tmp));
+ kfree(tmp);
}
dev->mc_count = 0;
write_unlock_bh(&dev_mc_lock);
diff --git a/net/core/netfilter.c b/net/core/netfilter.c
index c372ab029..f632ef236 100644
--- a/net/core/netfilter.c
+++ b/net/core/netfilter.c
@@ -436,7 +436,7 @@ static void nf_queue(struct sk_buff *skb,
/* James M doesn't say fuck enough. */
if (indev) dev_put(indev);
if (outdev) dev_put(outdev);
- kfree_s(info, sizeof(*info));
+ kfree(info);
kfree_skb(skb);
return;
}
@@ -532,7 +532,7 @@ void nf_reinject(struct sk_buff *skb, struct nf_info *info,
if (info->indev) dev_put(info->indev);
if (info->outdev) dev_put(info->outdev);
- kfree_s(info, sizeof(*info));
+ kfree(info);
return;
}
diff --git a/net/core/sock.c b/net/core/sock.c
index fcb6246b3..ab8cb89e8 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -707,7 +707,7 @@ void *sock_kmalloc(struct sock *sk, int size, int priority)
*/
void sock_kfree_s(struct sock *sk, void *mem, int size)
{
- kfree_s(mem, size);
+ kfree(mem);
atomic_sub(size, &sk->omem_alloc);
}
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 76bc28648..f05568ee5 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -387,7 +387,7 @@ static struct dn_ifaddr *dn_dev_alloc_ifa(void)
static __inline__ void dn_dev_free_ifa(struct dn_ifaddr *ifa)
{
- kfree_s(ifa, sizeof(*ifa));
+ kfree(ifa);
}
static void dn_dev_del_ifa(struct dn_dev *dn_db, struct dn_ifaddr **ifap, int destroy)
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c
index 7a8f3768b..2e09a8507 100644
--- a/net/decnet/dn_table.c
+++ b/net/decnet/dn_table.c
@@ -878,7 +878,7 @@ static void dn_fib_del_tree(int n)
write_unlock(&dn_fib_tables_lock);
if (t) {
- kfree_s(t, sizeof(struct dn_fib_table));
+ kfree(t);
}
}
diff --git a/net/ethernet/pe2.c b/net/ethernet/pe2.c
index f245a8704..0406bc68b 100644
--- a/net/ethernet/pe2.c
+++ b/net/ethernet/pe2.c
@@ -34,5 +34,5 @@ make_EII_client(void)
void destroy_EII_client(struct datalink_proto *dl)
{
if (dl)
- kfree_s(dl, sizeof(struct datalink_proto));
+ kfree(dl);
}
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index d50b56ea9..a7f5d3e49 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -99,7 +99,7 @@ static __inline__ void inet_free_ifa(struct in_ifaddr *ifa)
{
if (ifa->ifa_dev)
__in_dev_put(ifa->ifa_dev);
- kfree_s(ifa, sizeof(*ifa));
+ kfree(ifa);
inet_ifa_count--;
}
@@ -118,7 +118,7 @@ void in_dev_finish_destroy(struct in_device *idev)
return;
}
inet_dev_count--;
- kfree_s(idev, sizeof(*idev));
+ kfree(idev);
}
struct in_device *inetdev_init(struct net_device *dev)
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index aed0945c5..94d64999f 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -129,7 +129,7 @@ static void ip_ma_put(struct ip_mc_list *im)
{
if (atomic_dec_and_test(&im->refcnt)) {
in_dev_put(im->interface);
- kfree_s(im, sizeof(*im));
+ kfree(im);
}
}
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c
index 359926a4c..89b3206f0 100644
--- a/net/ipv4/ip_options.c
+++ b/net/ipv4/ip_options.c
@@ -509,7 +509,7 @@ int ip_options_get(struct ip_options **optp, unsigned char *data, int optlen, in
opt->is_data = 1;
opt->is_setbyuser = 1;
if (optlen && ip_options_compile(opt, NULL)) {
- kfree_s(opt, sizeof(struct ip_options) + optlen);
+ kfree(opt);
return -EINVAL;
}
*optp = opt;
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index aea8b9370..c1c0bb047 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -429,7 +429,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int opt
}
opt = xchg(&sk->protinfo.af_inet.opt, opt);
if (opt)
- kfree_s(opt, sizeof(struct ip_options) + opt->optlen);
+ kfree(opt);
break;
}
case IP_PKTINFO:
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index f34fa37d2..765da5148 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -175,7 +175,7 @@ static void __init ic_close_devs(void)
DBG(("IP-Config: Downing %s\n", dev->name));
dev_change_flags(dev, d->flags);
}
- kfree_s(d, sizeof(struct ic_device));
+ kfree(d);
}
rtnl_shunlock();
}
diff --git a/net/ipv4/netfilter/ipfwadm_core.c b/net/ipv4/netfilter/ipfwadm_core.c
index 4b4ab23b8..36614409d 100644
--- a/net/ipv4/netfilter/ipfwadm_core.c
+++ b/net/ipv4/netfilter/ipfwadm_core.c
@@ -684,7 +684,7 @@ static void free_fw_chain(struct ip_fw *volatile* chainptr)
struct ip_fw *ftmp;
ftmp = *chainptr;
*chainptr = ftmp->fw_next;
- kfree_s(ftmp,sizeof(*ftmp));
+ kfree(ftmp);
}
restore_flags(flags);
}
@@ -834,13 +834,13 @@ static int del_from_chain(struct ip_fw *volatile*chainptr, struct ip_fw *frwl)
if (ltmp)
{
ltmp->fw_next=ftmp->fw_next;
- kfree_s(ftmp,sizeof(*ftmp));
+ kfree(ftmp);
ftmp=ltmp->fw_next;
}
else
{
*chainptr=ftmp->fw_next;
- kfree_s(ftmp,sizeof(*ftmp));
+ kfree(ftmp);
ftmp=*chainptr;
}
}
diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c
index c63e95fe8..7c8bf2f1e 100644
--- a/net/ipv4/netfilter/ipt_REJECT.c
+++ b/net/ipv4/netfilter/ipt_REJECT.c
@@ -2,6 +2,7 @@
* This is a module which is used for rejecting packets.
* Added support for customized reject packets (Jozsef Kadlecsik).
*/
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/ip.h>
@@ -23,13 +24,33 @@ struct in_device;
static void send_reset(struct sk_buff *oldskb)
{
struct sk_buff *nskb;
- struct tcphdr *tcph;
+ struct tcphdr *otcph, *tcph;
struct rtable *rt;
- unsigned int tcplen;
+ unsigned int otcplen;
int needs_ack;
- /* Clone skb (skb is about to be dropped, so we don't care) */
- nskb = skb_clone(oldskb, GFP_ATOMIC);
+ /* IP header checks: fragment, too short. */
+ if (oldskb->nh.iph->frag_off & htons(IP_OFFSET)
+ || oldskb->len < (oldskb->nh.iph->ihl<<2) + sizeof(struct tcphdr))
+ return;
+
+ otcph = (struct tcphdr *)((u_int32_t*)oldskb->nh.iph + oldskb->nh.iph->ihl);
+ otcplen = oldskb->len - oldskb->nh.iph->ihl*4;
+
+ /* No RST for RST. */
+ if (otcph->rst)
+ return;
+
+ /* Check checksum. */
+ if (tcp_v4_check(otcph, otcplen, oldskb->nh.iph->saddr,
+ oldskb->nh.iph->daddr,
+ csum_partial((char *)otcph, otcplen, 0)) != 0)
+ return;
+
+ /* Copy skb (even if skb is about to be dropped, we can't just
+ clone it because there may be other things, such as tcpdump,
+ interested in it) */
+ nskb = skb_copy(oldskb, GFP_ATOMIC);
if (!nskb)
return;
@@ -41,23 +62,7 @@ static void send_reset(struct sk_buff *oldskb)
nskb->nf_debug = 0;
#endif
- /* IP header checks: fragment, too short. */
- if (nskb->nh.iph->frag_off & htons(IP_OFFSET)
- || nskb->len < (nskb->nh.iph->ihl<<2) + sizeof(struct tcphdr))
- goto free_nskb;
-
tcph = (struct tcphdr *)((u_int32_t*)nskb->nh.iph + nskb->nh.iph->ihl);
- tcplen = nskb->len - nskb->nh.iph->ihl*4;
-
- /* Check checksum. */
- if (tcp_v4_check(tcph, tcplen, nskb->nh.iph->saddr,
- nskb->nh.iph->daddr,
- csum_partial((char *)tcph, tcplen, 0)) != 0)
- goto free_nskb;
-
- /* No RST for RST. */
- if (tcph->rst)
- goto free_nskb;
nskb->nh.iph->daddr = xchg(&nskb->nh.iph->saddr, nskb->nh.iph->daddr);
tcph->source = xchg(&tcph->dest, tcph->source);
@@ -65,23 +70,23 @@ static void send_reset(struct sk_buff *oldskb)
/* Truncate to length (no data) */
tcph->doff = sizeof(struct tcphdr)/4;
skb_trim(nskb, nskb->nh.iph->ihl*4 + sizeof(struct tcphdr));
+ nskb->nh.iph->tot_len = htons(nskb->len);
if (tcph->ack) {
needs_ack = 0;
- tcph->seq = tcph->ack_seq;
+ tcph->seq = otcph->ack_seq;
tcph->ack_seq = 0;
} else {
needs_ack = 1;
+ tcph->ack_seq = htonl(ntohl(otcph->seq) + otcph->syn + otcph->fin
+ + otcplen - (otcph->doff<<2));
tcph->seq = 0;
- tcph->ack_seq = htonl(ntohl(tcph->seq) + tcph->syn + tcph->fin
- + tcplen - (tcph->doff<<2));
}
/* Reset flags */
((u_int8_t *)tcph)[13] = 0;
tcph->rst = 1;
- if (needs_ack)
- tcph->ack = 1;
+ tcph->ack = needs_ack;
tcph->window = 0;
tcph->urg_ptr = 0;
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index d218c3bdb..39cd96ede 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -159,7 +159,7 @@ cookie_v4_check(struct sock *sk, struct sk_buff *skb, struct ip_options *opt)
req->af.v4_req.opt = kmalloc(opt_size, GFP_ATOMIC);
if (req->af.v4_req.opt) {
if (ip_options_echo(req->af.v4_req.opt, skb)) {
- kfree_s(req->af.v4_req.opt, opt_size);
+ kfree(req->af.v4_req.opt);
req->af.v4_req.opt = NULL;
}
}
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 46f5e57e8..1fcf0e255 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1232,7 +1232,7 @@ out:
static void tcp_v4_or_free(struct open_request *req)
{
if (req->af.v4_req.opt)
- kfree_s(req->af.v4_req.opt, optlength(req->af.v4_req.opt));
+ kfree(req->af.v4_req.opt);
}
static inline void syn_flood_warning(struct sk_buff *skb)
@@ -1261,7 +1261,7 @@ tcp_v4_save_options(struct sock *sk, struct sk_buff *skb)
dopt = kmalloc(opt_size, GFP_ATOMIC);
if (dopt) {
if (ip_options_echo(dopt, skb)) {
- kfree_s(dopt, opt_size);
+ kfree(dopt);
dopt = NULL;
}
}
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index dd4b55b0f..582531a97 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -200,7 +200,7 @@ static void ma_put(struct ifmcaddr6 *mc)
{
if (atomic_dec_and_test(&mc->mca_refcnt)) {
in6_dev_put(mc->idev);
- kfree_s(mc, sizeof(*mc));
+ kfree(mc);
}
}
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c
index afa955add..bbb2b2630 100644
--- a/net/ipx/af_ipx.c
+++ b/net/ipx/af_ipx.c
@@ -356,7 +356,7 @@ static void ipxitf_down(ipx_interface *intrfc)
if(intrfc == ipx_internal_net)
ipx_internal_net = NULL;
- kfree_s(intrfc, sizeof(*intrfc));
+ kfree(intrfc);
MOD_DEC_USE_COUNT;
return;
@@ -1235,7 +1235,7 @@ static void ipxrtr_del_routes(ipx_interface *intrfc)
if(tmp->ir_intrfc == intrfc)
{
*r = tmp->ir_next;
- kfree_s(tmp, sizeof(ipx_route));
+ kfree(tmp);
}
else
r = &(tmp->ir_next);
@@ -1268,7 +1268,7 @@ static int ipxrtr_delete(long net)
return (-EPERM);
*r = tmp->ir_next;
- kfree_s(tmp, sizeof(ipx_route));
+ kfree(tmp);
return (0);
}
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 3b2df4f55..b342c4f14 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1218,7 +1218,7 @@ static int packet_mc_drop(struct sock *sk, struct packet_mreq *mreq)
packet_dev_mc(dev, ml, -1);
dev_put(dev);
}
- kfree_s(ml, sizeof(*ml));
+ kfree(ml);
}
rtnl_unlock();
return 0;
@@ -1243,7 +1243,7 @@ static void packet_flush_mclist(struct sock *sk)
packet_dev_mc(dev, ml, -1);
dev_put(dev);
}
- kfree_s(ml, sizeof(*ml));
+ kfree(ml);
}
rtnl_unlock();
}
diff --git a/net/socket.c b/net/socket.c
index 2b5426991..1870a867c 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -757,7 +757,7 @@ static int sock_fasync(int fd, struct file *filp, int on)
fa->fa_fd=fd;
write_unlock_bh(&sk->callback_lock);
- kfree_s(fna,sizeof(struct fasync_struct));
+ kfree(fna);
goto out;
}
fna->fa_file=filp;
@@ -775,7 +775,7 @@ static int sock_fasync(int fd, struct file *filp, int on)
write_lock_bh(&sk->callback_lock);
*prev=fa->fa_next;
write_unlock_bh(&sk->callback_lock);
- kfree_s(fa,sizeof(struct fasync_struct));
+ kfree(fa);
}
}
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 55c816ce5..e4e06e9be 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -238,7 +238,6 @@ xprt_sendmsg(struct rpc_xprt *xprt, struct rpc_rqst *req)
break;
default:
printk(KERN_NOTICE "RPC: sendmsg returned error %d\n", -result);
- result = 0;
}
return result;
}
@@ -1049,14 +1048,14 @@ tcp_write_space(struct sock *sk)
if (xprt->snd_task && xprt->snd_task->tk_rpcwait == &xprt->sending)
rpc_wake_up_task(xprt->snd_task);
+ out_unlock:
+ spin_unlock_bh(&xprt_sock_lock);
if (test_bit(SOCK_NOSPACE, &sock->flags)) {
if (sk->sleep && waitqueue_active(sk->sleep)) {
clear_bit(SOCK_NOSPACE, &sock->flags);
wake_up_interruptible(sk->sleep);
}
}
- out_unlock:
- spin_unlock_bh(&xprt_sock_lock);
}
static void
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index a04b85cfa..628269f57 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1670,7 +1670,7 @@ static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
}
default:
- err = -EINVAL;
+ err = dev_ioctl(cmd, (void *)arg);
break;
}
return err;