diff options
Diffstat (limited to 'net')
84 files changed, 130 insertions, 49 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 67465b65abe4..fa76220708ce 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c @@ -19,6 +19,7 @@ */ #include <asm/uaccess.h> /* for copy_from_user */ +#include <linux/capability.h> #include <linux/module.h> #include <linux/netdevice.h> #include <linux/skbuff.h> diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index a5144e43aae1..697ac55e29dc 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c @@ -52,6 +52,7 @@ */ #include <linux/config.h> +#include <linux/capability.h> #include <linux/module.h> #include <linux/if_arp.h> #include <linux/termios.h> /* For TIOCOUTQ/INQ */ diff --git a/net/atm/br2684.c b/net/atm/br2684.c index 1dafa9c108a7..680ccb12aae8 100644 --- a/net/atm/br2684.c +++ b/net/atm/br2684.c @@ -18,6 +18,7 @@ Author: Marcell GAL, 2000, XDSL Ltd, Hungary #include <net/arp.h> #include <linux/atm.h> #include <linux/atmdev.h> +#include <linux/capability.h> #include <linux/seq_file.h> #include <linux/atmbr2684.h> diff --git a/net/atm/clip.c b/net/atm/clip.c index 4f54c9a5e84a..73370de97539 100644 --- a/net/atm/clip.c +++ b/net/atm/clip.c @@ -19,6 +19,7 @@ #include <linux/atmdev.h> #include <linux/atmclip.h> #include <linux/atmarp.h> +#include <linux/capability.h> #include <linux/ip.h> /* for net/route.h */ #include <linux/in.h> /* for struct sockaddr_in */ #include <linux/if.h> /* for IFF_UP */ diff --git a/net/atm/ioctl.c b/net/atm/ioctl.c index a150198b05a3..eb109af7eb4a 100644 --- a/net/atm/ioctl.c +++ b/net/atm/ioctl.c @@ -12,6 +12,7 @@ #include <linux/atmdev.h> #include <linux/atmclip.h> /* CLIP_*ENCAP */ #include <linux/atmarp.h> /* manifest constants */ +#include <linux/capability.h> #include <linux/sonet.h> /* for ioctls */ #include <linux/atmsvc.h> #include <linux/atmmpc.h> diff --git a/net/atm/lec.c b/net/atm/lec.c index eea051338498..c4fc722fef9a 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c @@ -7,6 +7,7 @@ #include <linux/config.h> #include <linux/kernel.h> #include <linux/bitops.h> +#include <linux/capability.h> /* We are ethernet device */ #include <linux/if_ether.h> @@ -1811,8 +1812,7 @@ make_entry(struct lec_priv *priv, unsigned char *mac_addr) { struct lec_arp_table *to_return; - to_return = (struct lec_arp_table *) kmalloc(sizeof(struct lec_arp_table), - GFP_ATOMIC); + to_return = kmalloc(sizeof(struct lec_arp_table), GFP_ATOMIC); if (!to_return) { printk("LEC: Arp entry kmalloc failed\n"); return NULL; diff --git a/net/atm/mpc.c b/net/atm/mpc.c index 36b7ae360232..c304ef1513b9 100644 --- a/net/atm/mpc.c +++ b/net/atm/mpc.c @@ -3,6 +3,7 @@ #include <linux/timer.h> #include <linux/init.h> #include <linux/bitops.h> +#include <linux/capability.h> #include <linux/seq_file.h> /* We are an ethernet device */ diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c index 58f4a2b5aebe..1489067c1e84 100644 --- a/net/atm/pppoatm.c +++ b/net/atm/pppoatm.c @@ -39,6 +39,7 @@ #include <linux/skbuff.h> #include <linux/atm.h> #include <linux/atmdev.h> +#include <linux/capability.h> #include <linux/ppp_defs.h> #include <linux/if_ppp.h> #include <linux/ppp_channel.h> diff --git a/net/atm/raw.c b/net/atm/raw.c index 4a0466e91aa6..3e57b17ca523 100644 --- a/net/atm/raw.c +++ b/net/atm/raw.c @@ -6,6 +6,7 @@ #include <linux/module.h> #include <linux/sched.h> #include <linux/atmdev.h> +#include <linux/capability.h> #include <linux/kernel.h> #include <linux/skbuff.h> #include <linux/mm.h> diff --git a/net/atm/resources.c b/net/atm/resources.c index c8c459fcb038..224190537c90 100644 --- a/net/atm/resources.c +++ b/net/atm/resources.c @@ -16,6 +16,7 @@ #include <linux/kernel.h> /* for barrier */ #include <linux/module.h> #include <linux/bitops.h> +#include <linux/capability.h> #include <linux/delay.h> #include <net/sock.h> /* for struct sock */ diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index e8753c7fcad1..dbf9b47681f7 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c @@ -14,6 +14,7 @@ * Copyright (C) Frederic Rible F1OAT (frible@teaser.fr) */ #include <linux/config.h> +#include <linux/capability.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/types.h> diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c index b1e945bd6ed3..f04f8630fd28 100644 --- a/net/ax25/ax25_route.c +++ b/net/ax25/ax25_route.c @@ -11,6 +11,8 @@ * Copyright (C) Hans-Joachim Hetscher DD8NE (dd8ne@bnv-bamberg.de) * Copyright (C) Frederic Rible F1OAT (frible@teaser.fr) */ + +#include <linux/capability.h> #include <linux/errno.h> #include <linux/types.h> #include <linux/socket.h> diff --git a/net/ax25/ax25_uid.c b/net/ax25/ax25_uid.c index d53cc8615865..b8b5854bce9a 100644 --- a/net/ax25/ax25_uid.c +++ b/net/ax25/ax25_uid.c @@ -6,6 +6,8 @@ * * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk) */ + +#include <linux/capability.h> #include <linux/errno.h> #include <linux/types.h> #include <linux/socket.h> diff --git a/net/bluetooth/bnep/sock.c b/net/bluetooth/bnep/sock.c index ccbaf69afc5b..2bfe796cf05d 100644 --- a/net/bluetooth/bnep/sock.c +++ b/net/bluetooth/bnep/sock.c @@ -32,6 +32,7 @@ #include <linux/module.h> #include <linux/types.h> +#include <linux/capability.h> #include <linux/errno.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/net/bluetooth/cmtp/sock.c b/net/bluetooth/cmtp/sock.c index 5e22343b6090..8f8fad23f78a 100644 --- a/net/bluetooth/cmtp/sock.c +++ b/net/bluetooth/cmtp/sock.c @@ -24,6 +24,7 @@ #include <linux/module.h> #include <linux/types.h> +#include <linux/capability.h> #include <linux/errno.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 84e6c93a044a..bdb6458c6bd5 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c @@ -28,6 +28,7 @@ #include <linux/module.h> #include <linux/types.h> +#include <linux/capability.h> #include <linux/errno.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/net/bluetooth/hidp/sock.c b/net/bluetooth/hidp/sock.c index 8f8dd931b294..b8f67761b886 100644 --- a/net/bluetooth/hidp/sock.c +++ b/net/bluetooth/hidp/sock.c @@ -24,6 +24,7 @@ #include <linux/module.h> #include <linux/types.h> +#include <linux/capability.h> #include <linux/errno.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 7f0781e4326f..f6b4a8085357 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c @@ -28,6 +28,7 @@ #include <linux/module.h> #include <linux/types.h> +#include <linux/capability.h> #include <linux/errno.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index f57cde78c3de..74368f79ee5d 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c @@ -34,6 +34,7 @@ #include <linux/tty_driver.h> #include <linux/tty_flip.h> +#include <linux/capability.h> #include <linux/slab.h> #include <linux/skbuff.h> diff --git a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c index b8ce14b22181..159fb8409824 100644 --- a/net/bridge/br_ioctl.c +++ b/net/bridge/br_ioctl.c @@ -13,6 +13,7 @@ * 2 of the License, or (at your option) any later version. */ +#include <linux/capability.h> #include <linux/kernel.h> #include <linux/if_bridge.h> #include <linux/netdevice.h> diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c index 98cf53c81fad..6f577f16c4c0 100644 --- a/net/bridge/br_sysfs_br.c +++ b/net/bridge/br_sysfs_br.c @@ -11,6 +11,7 @@ * 2 of the License, or (at your option) any later version. */ +#include <linux/capability.h> #include <linux/kernel.h> #include <linux/netdevice.h> #include <linux/if_bridge.h> diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c index 2ebdc23bbe26..0ac0355d16dd 100644 --- a/net/bridge/br_sysfs_if.c +++ b/net/bridge/br_sysfs_if.c @@ -11,6 +11,7 @@ * 2 of the License, or (at your option) any later version. */ +#include <linux/capability.h> #include <linux/kernel.h> #include <linux/netdevice.h> #include <linux/if_bridge.h> diff --git a/net/bridge/netfilter/ebt_stp.c b/net/bridge/netfilter/ebt_stp.c index 9d2ef4ffe276..0248c67277ee 100644 --- a/net/bridge/netfilter/ebt_stp.c +++ b/net/bridge/netfilter/ebt_stp.c @@ -10,6 +10,7 @@ #include <linux/netfilter_bridge/ebtables.h> #include <linux/netfilter_bridge/ebt_stp.h> +#include <linux/etherdevice.h> #include <linux/module.h> #define BPDU_TYPE_CONFIG 0 diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index f8ffbf6e2333..00729b3604f8 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c @@ -944,7 +944,7 @@ static int do_replace(void __user *user, unsigned int len) if (countersize) memset(newinfo->counters, 0, countersize); - newinfo->entries = (char *)vmalloc(tmp.entries_size); + newinfo->entries = vmalloc(tmp.entries_size); if (!newinfo->entries) { ret = -ENOMEM; goto free_newinfo; @@ -1146,7 +1146,7 @@ int ebt_register_table(struct ebt_table *table) if (!newinfo) return -ENOMEM; - newinfo->entries = (char *)vmalloc(table->table->entries_size); + newinfo->entries = vmalloc(table->table->entries_size); if (!(newinfo->entries)) goto free_newinfo; diff --git a/net/core/dev.c b/net/core/dev.c index bf66b114d3c2..fd070a098f20 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -75,6 +75,7 @@ #include <asm/uaccess.h> #include <asm/system.h> #include <linux/bitops.h> +#include <linux/capability.h> #include <linux/config.h> #include <linux/cpu.h> #include <linux/types.h> diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c index cb530eef0e39..05d60850840e 100644 --- a/net/core/dev_mcast.c +++ b/net/core/dev_mcast.c @@ -158,7 +158,7 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl) int err = 0; struct dev_mc_list *dmi, *dmi1; - dmi1 = (struct dev_mc_list *)kmalloc(sizeof(*dmi), GFP_ATOMIC); + dmi1 = kmalloc(sizeof(*dmi), GFP_ATOMIC); spin_lock_bh(&dev->xmit_lock); for (dmi = dev->mc_list; dmi != NULL; dmi = dmi->next) { diff --git a/net/core/dv.c b/net/core/dv.c index c5deb3655257..cf581407538c 100644 --- a/net/core/dv.c +++ b/net/core/dv.c @@ -24,6 +24,7 @@ #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/skbuff.h> +#include <linux/capability.h> #include <linux/errno.h> #include <linux/init.h> #include <net/dst.h> @@ -457,7 +458,7 @@ void divert_frame(struct sk_buff *skb) unsigned char *skb_data_end = skb->data + skb->len; /* Packet is already aimed at us, return */ - if (!compare_ether_addr(eth, skb->dev->dev_addr)) + if (!compare_ether_addr(eth->h_dest, skb->dev->dev_addr)) return; /* proto is not IP, do nothing */ diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 0350586e9195..e6f76106a99b 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c @@ -11,6 +11,7 @@ #include <linux/module.h> #include <linux/types.h> +#include <linux/capability.h> #include <linux/errno.h> #include <linux/ethtool.h> #include <linux/netdevice.h> diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 58adaf208dd6..e8b2acbc8ea2 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include <linux/capability.h> #include <linux/config.h> #include <linux/kernel.h> #include <linux/netdevice.h> diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 631056d44b7b..39063122fbb7 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -116,13 +116,13 @@ #include <linux/sched.h> #include <linux/slab.h> #include <linux/vmalloc.h> -#include <linux/sched.h> #include <linux/unistd.h> #include <linux/string.h> #include <linux/ptrace.h> #include <linux/errno.h> #include <linux/ioport.h> #include <linux/interrupt.h> +#include <linux/capability.h> #include <linux/delay.h> #include <linux/timer.h> #include <linux/init.h> diff --git a/net/core/scm.c b/net/core/scm.c index e887d19be506..649d01ef35b6 100644 --- a/net/core/scm.c +++ b/net/core/scm.c @@ -11,6 +11,7 @@ #include <linux/module.h> #include <linux/signal.h> +#include <linux/capability.h> #include <linux/errno.h> #include <linux/sched.h> #include <linux/mm.h> diff --git a/net/core/sock.c b/net/core/sock.c index 6465b0e4c8cb..6e00811d44bc 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -91,6 +91,7 @@ * 2 of the License, or (at your option) any later version. */ +#include <linux/capability.h> #include <linux/config.h> #include <linux/errno.h> #include <linux/types.h> diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c index 78ec5344be86..ce4aaf94860d 100644 --- a/net/decnet/af_decnet.c +++ b/net/decnet/af_decnet.c @@ -122,6 +122,7 @@ Version 0.0.6 2.1.110 07-aug-98 Eduardo Marcelo Serrat #include <net/flow.h> #include <asm/system.h> #include <asm/ioctls.h> +#include <linux/capability.h> #include <linux/mm.h> #include <linux/interrupt.h> #include <linux/proc_fs.h> diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index 5610bb16dbf9..efbead83ba7f 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c @@ -25,6 +25,7 @@ */ #include <linux/config.h> +#include <linux/capability.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h> diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 966a071a408c..97c276f95b35 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -79,6 +79,7 @@ #include <linux/string.h> #include <linux/sockios.h> #include <linux/net.h> +#include <linux/capability.h> #include <linux/fcntl.h> #include <linux/mm.h> #include <linux/interrupt.h> diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 37432088fe6d..accdefedfed7 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -79,6 +79,7 @@ #include <linux/string.h> #include <linux/kernel.h> #include <linux/sched.h> +#include <linux/capability.h> #include <linux/config.h> #include <linux/socket.h> #include <linux/sockios.h> diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 7b9bb28e2ee9..95b9d81ac488 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -32,6 +32,7 @@ #include <asm/uaccess.h> #include <asm/system.h> #include <linux/bitops.h> +#include <linux/capability.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 18f5e509281a..5b25fc0d980c 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -20,6 +20,7 @@ #include <asm/uaccess.h> #include <asm/system.h> #include <linux/bitops.h> +#include <linux/capability.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 34758118c10c..192092b89e53 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -975,7 +975,7 @@ static void igmpv3_add_delrec(struct in_device *in_dev, struct ip_mc_list *im) * for deleted items allows change reports to use common code with * non-deleted or query-response MCA's. */ - pmc = (struct ip_mc_list *)kmalloc(sizeof(*pmc), GFP_KERNEL); + pmc = kmalloc(sizeof(*pmc), GFP_KERNEL); if (!pmc) return; memset(pmc, 0, sizeof(*pmc)); @@ -1155,7 +1155,7 @@ void ip_mc_inc_group(struct in_device *in_dev, u32 addr) } } - im = (struct ip_mc_list *)kmalloc(sizeof(*im), GFP_KERNEL); + im = kmalloc(sizeof(*im), GFP_KERNEL); if (!im) goto out; @@ -1476,7 +1476,7 @@ static int ip_mc_add1_src(struct ip_mc_list *pmc, int sfmode, psf_prev = psf; } if (!psf) { - psf = (struct ip_sf_list *)kmalloc(sizeof(*psf), GFP_ATOMIC); + psf = kmalloc(sizeof(*psf), GFP_ATOMIC); if (!psf) return -ENOBUFS; memset(psf, 0, sizeof(*psf)); @@ -1659,7 +1659,7 @@ int ip_mc_join_group(struct sock *sk , struct ip_mreqn *imr) err = -ENOBUFS; if (count >= sysctl_igmp_max_memberships) goto done; - iml = (struct ip_mc_socklist *)sock_kmalloc(sk,sizeof(*iml),GFP_KERNEL); + iml = sock_kmalloc(sk,sizeof(*iml),GFP_KERNEL); if (iml == NULL) goto done; @@ -1823,8 +1823,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct if (psl) count += psl->sl_max; - newpsl = (struct ip_sf_socklist *)sock_kmalloc(sk, - IP_SFLSIZE(count), GFP_KERNEL); + newpsl = sock_kmalloc(sk, IP_SFLSIZE(count), GFP_KERNEL); if (!newpsl) { err = -ENOBUFS; goto done; @@ -1907,8 +1906,8 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex) goto done; } if (msf->imsf_numsrc) { - newpsl = (struct ip_sf_socklist *)sock_kmalloc(sk, - IP_SFLSIZE(msf->imsf_numsrc), GFP_KERNEL); + newpsl = sock_kmalloc(sk, IP_SFLSIZE(msf->imsf_numsrc), + GFP_KERNEL); if (!newpsl) { err = -ENOBUFS; goto done; diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 1e93eafa7af1..abe23923e4e7 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -10,6 +10,7 @@ * */ +#include <linux/capability.h> #include <linux/config.h> #include <linux/module.h> #include <linux/types.h> diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c index d3f6c468faf4..9bebad07bf2e 100644 --- a/net/ipv4/ip_options.c +++ b/net/ipv4/ip_options.c @@ -11,6 +11,7 @@ * */ +#include <linux/capability.h> #include <linux/module.h> #include <linux/types.h> #include <asm/uaccess.h> diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 6986e11d65cc..2bf8d782f678 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -621,7 +621,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, err = -ENOBUFS; break; } - msf = (struct ip_msfilter *)kmalloc(optlen, GFP_KERNEL); + msf = kmalloc(optlen, GFP_KERNEL); if (msf == 0) { err = -ENOBUFS; break; @@ -778,7 +778,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, err = -ENOBUFS; break; } - gsf = (struct group_filter *)kmalloc(optlen,GFP_KERNEL); + gsf = kmalloc(optlen,GFP_KERNEL); if (gsf == 0) { err = -ENOBUFS; break; @@ -798,7 +798,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, goto mc_msf_out; } msize = IP_MSFILTER_SIZE(gsf->gf_numsrc); - msf = (struct ip_msfilter *)kmalloc(msize,GFP_KERNEL); + msf = kmalloc(msize,GFP_KERNEL); if (msf == 0) { err = -ENOBUFS; goto mc_msf_out; diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index bc5ca23b2646..e5cbe72c6b80 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c @@ -93,6 +93,7 @@ */ +#include <linux/capability.h> #include <linux/config.h> #include <linux/module.h> #include <linux/types.h> diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index f58ac9854c3f..5c94c222e3f3 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c @@ -33,6 +33,7 @@ #include <asm/uaccess.h> #include <linux/types.h> #include <linux/sched.h> +#include <linux/capability.h> #include <linux/errno.h> #include <linux/timer.h> #include <linux/mm.h> diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c index c935c5086d33..7f0288b25fa1 100644 --- a/net/ipv4/ipvs/ip_vs_ctl.c +++ b/net/ipv4/ipvs/ip_vs_ctl.c @@ -23,6 +23,7 @@ #include <linux/module.h> #include <linux/init.h> #include <linux/types.h> +#include <linux/capability.h> #include <linux/fs.h> #include <linux/sysctl.h> #include <linux/proc_fs.h> diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c index bba156304695..b6d5284c8020 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c @@ -13,6 +13,7 @@ #include <linux/kernel.h> #include <linux/skbuff.h> #include <linux/netdevice.h> +#include <linux/capability.h> #include <linux/if_arp.h> #include <linux/kmod.h> #include <linux/vmalloc.h> diff --git a/net/ipv4/netfilter/ip_conntrack_helper_pptp.c b/net/ipv4/netfilter/ip_conntrack_helper_pptp.c index 4108a5e12b3c..d716bba798f2 100644 --- a/net/ipv4/netfilter/ip_conntrack_helper_pptp.c +++ b/net/ipv4/netfilter/ip_conntrack_helper_pptp.c @@ -762,7 +762,7 @@ static struct ip_conntrack_helper pptp = { .help = conntrack_pptp_help }; -extern void __exit ip_ct_proto_gre_fini(void); +extern void ip_ct_proto_gre_fini(void); extern int __init ip_ct_proto_gre_init(void); /* ip_conntrack_pptp initialization */ diff --git a/net/ipv4/netfilter/ip_conntrack_proto_gre.c b/net/ipv4/netfilter/ip_conntrack_proto_gre.c index 57956dee60c8..c777abf16cb7 100644 --- a/net/ipv4/netfilter/ip_conntrack_proto_gre.c +++ b/net/ipv4/netfilter/ip_conntrack_proto_gre.c @@ -309,7 +309,10 @@ int __init ip_ct_proto_gre_init(void) return ip_conntrack_protocol_register(&gre); } -void __exit ip_ct_proto_gre_fini(void) +/* This cannot be __exit, as it is invoked from ip_conntrack_helper_pptp.c's + * init() code on errors. + */ +void ip_ct_proto_gre_fini(void) { struct list_head *pos, *n; diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 2a26d167e149..877bc96d3336 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c @@ -14,6 +14,7 @@ */ #include <linux/config.h> #include <linux/cache.h> +#include <linux/capability.h> #include <linux/skbuff.h> #include <linux/kmod.h> #include <linux/vmalloc.h> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index e53e421eeee9..7129d4239755 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -58,6 +58,7 @@ #ifdef CONFIG_SYSCTL #include <linux/sysctl.h> #endif +#include <linux/capability.h> #include <linux/delay.h> #include <linux/notifier.h> #include <linux/string.h> diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 25c3fe5005d9..064ffab82a9f 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c @@ -22,6 +22,7 @@ #include <linux/module.h> +#include <linux/capability.h> #include <linux/config.h> #include <linux/errno.h> #include <linux/types.h> diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c index 6b7294047238..65e73ac0d6d0 100644 --- a/net/ipv6/anycast.c +++ b/net/ipv6/anycast.c @@ -13,6 +13,7 @@ * 2 of the License, or (at your option) any later version. */ +#include <linux/capability.h> #include <linux/config.h> #include <linux/module.h> #include <linux/errno.h> diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index c4a3a993acb7..99a6eb23378b 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c @@ -13,6 +13,7 @@ * 2 of the License, or (at your option) any later version. */ +#include <linux/capability.h> #include <linux/errno.h> #include <linux/types.h> #include <linux/kernel.h> diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c index 89d12b4817a9..964ad9d1276d 100644 --- a/net/ipv6/ip6_flowlabel.c +++ b/net/ipv6/ip6_flowlabel.c @@ -9,6 +9,7 @@ * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> */ +#include <linux/capability.h> #include <linux/config.h> #include <linux/errno.h> #include <linux/types.h> diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index c3c2bf699a67..92ead3cf956b 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -21,6 +21,7 @@ #include <linux/config.h> #include <linux/module.h> +#include <linux/capability.h> #include <linux/errno.h> #include <linux/types.h> #include <linux/sockios.h> diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index c63868dd2ca2..f7142ba519ab 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c @@ -26,6 +26,7 @@ */ #include <linux/module.h> +#include <linux/capability.h> #include <linux/config.h> #include <linux/errno.h> #include <linux/types.h> @@ -549,7 +550,7 @@ done: retv = -ENOBUFS; break; } - gsf = (struct group_filter *)kmalloc(optlen,GFP_KERNEL); + gsf = kmalloc(optlen,GFP_KERNEL); if (gsf == 0) { retv = -ENOBUFS; break; diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 1cf305a9f8dd..cc3e9f560867 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c @@ -449,8 +449,7 @@ int ip6_mc_source(int add, int omode, struct sock *sk, if (psl) count += psl->sl_max; - newpsl = (struct ip6_sf_socklist *)sock_kmalloc(sk, - IP6_SFLSIZE(count), GFP_ATOMIC); + newpsl = sock_kmalloc(sk, IP6_SFLSIZE(count), GFP_ATOMIC); if (!newpsl) { err = -ENOBUFS; goto done; @@ -535,8 +534,8 @@ int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf) goto done; } if (gsf->gf_numsrc) { - newpsl = (struct ip6_sf_socklist *)sock_kmalloc(sk, - IP6_SFLSIZE(gsf->gf_numsrc), GFP_ATOMIC); + newpsl = sock_kmalloc(sk, IP6_SFLSIZE(gsf->gf_numsrc), + GFP_ATOMIC); if (!newpsl) { err = -ENOBUFS; goto done; @@ -768,7 +767,7 @@ static void mld_add_delrec(struct inet6_dev *idev, struct ifmcaddr6 *im) * for deleted items allows change reports to use common code with * non-deleted or query-response MCA's. */ - pmc = (struct ifmcaddr6 *)kmalloc(sizeof(*pmc), GFP_ATOMIC); + pmc = kmalloc(sizeof(*pmc), GFP_ATOMIC); if (!pmc) return; memset(pmc, 0, sizeof(*pmc)); @@ -1937,7 +1936,7 @@ static int ip6_mc_add1_src(struct ifmcaddr6 *pmc, int sfmode, psf_prev = psf; } if (!psf) { - psf = (struct ip6_sf_list *)kmalloc(sizeof(*psf), GFP_ATOMIC); + psf = kmalloc(sizeof(*psf), GFP_ATOMIC); if (!psf) return -ENOBUFS; memset(psf, 0, sizeof(*psf)); diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 925b42d48347..1390370186d9 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c @@ -14,6 +14,8 @@ * 06 Jun 2002 Andras Kis-Szabo <kisza@sch.bme.hu> * - new extension header parser code */ + +#include <linux/capability.h> #include <linux/config.h> #include <linux/in.h> #include <linux/skbuff.h> diff --git a/net/ipv6/netfilter/ip6t_mac.c b/net/ipv6/netfilter/ip6t_mac.c index ae0b09291d17..c848152315bc 100644 --- a/net/ipv6/netfilter/ip6t_mac.c +++ b/net/ipv6/netfilter/ip6t_mac.c @@ -11,6 +11,7 @@ #include <linux/module.h> #include <linux/skbuff.h> #include <linux/if_ether.h> +#include <linux/etherdevice.h> #include <linux/netfilter_ipv6/ip6t_mac.h> #include <linux/netfilter_ipv6/ip6_tables.h> diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 66140f13d119..e0d3ad02ffb5 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -24,6 +24,7 @@ * reachable. otherwise, round-robin the list. */ +#include <linux/capability.h> #include <linux/config.h> #include <linux/errno.h> #include <linux/types.h> diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 0dae48aa1cec..c2d3e17beae6 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -20,6 +20,7 @@ #include <linux/config.h> #include <linux/module.h> +#include <linux/capability.h> #include <linux/errno.h> #include <linux/types.h> #include <linux/socket.h> diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index a25f4e8a8ada..66d04004afda 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -67,6 +67,9 @@ #include <linux/proc_fs.h> #include <linux/seq_file.h> +/* Socket used for sending RSTs and ACKs */ +static struct socket *tcp6_socket; + static void tcp_v6_send_reset(struct sk_buff *skb); static void tcp_v6_reqsk_send_ack(struct sk_buff *skb, struct request_sock *req); static void tcp_v6_send_check(struct sock *sk, int len, @@ -611,7 +614,7 @@ static void tcp_v6_send_reset(struct sk_buff *skb) if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) { if (xfrm_lookup(&buff->dst, &fl, NULL, 0) >= 0) { - ip6_xmit(NULL, buff, &fl, NULL, 0); + ip6_xmit(tcp6_socket->sk, buff, &fl, NULL, 0); TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); TCP_INC_STATS_BH(TCP_MIB_OUTRSTS); return; @@ -675,7 +678,7 @@ static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack, u32 win, u32 if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) { if (xfrm_lookup(&buff->dst, &fl, NULL, 0) >= 0) { - ip6_xmit(NULL, buff, &fl, NULL, 0); + ip6_xmit(tcp6_socket->sk, buff, &fl, NULL, 0); TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); return; } @@ -1600,8 +1603,21 @@ static struct inet_protosw tcpv6_protosw = { void __init tcpv6_init(void) { + int err; + /* register inet6 protocol */ if (inet6_add_protocol(&tcpv6_protocol, IPPROTO_TCP) < 0) printk(KERN_ERR "tcpv6_init: Could not register protocol\n"); inet6_register_protosw(&tcpv6_protosw); + + err = sock_create_kern(PF_INET6, SOCK_RAW, IPPROTO_TCP, &tcp6_socket); + if (err < 0) + panic("Failed to create the TCPv6 control socket.\n"); + tcp6_socket->sk->sk_allocation = GFP_ATOMIC; + + /* Unhash it so that IP input processing does not even + * see it, we do not wish this socket to see incoming + * packets. + */ + tcp6_socket->sk->sk_prot->unhash(tcp6_socket->sk); } diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c index 0dc519b40404..0fb513a34d11 100644 --- a/net/ipx/af_ipx.c +++ b/net/ipx/af_ipx.c @@ -29,6 +29,7 @@ */ #include <linux/config.h> +#include <linux/capability.h> #include <linux/errno.h> #include <linux/if_arp.h> #include <linux/if_ether.h> diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index fbfa96754417..759445648667 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c @@ -43,6 +43,7 @@ ********************************************************************/ #include <linux/config.h> +#include <linux/capability.h> #include <linux/module.h> #include <linux/types.h> #include <linux/socket.h> diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c index 70543d89438b..890bac0d4a56 100644 --- a/net/irda/irda_device.c +++ b/net/irda/irda_device.c @@ -33,6 +33,7 @@ #include <linux/string.h> #include <linux/proc_fs.h> #include <linux/skbuff.h> +#include <linux/capability.h> #include <linux/if.h> #include <linux/if_ether.h> #include <linux/if_arp.h> diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c index 75f2666e8630..c6d169fbdceb 100644 --- a/net/irda/irias_object.c +++ b/net/irda/irias_object.c @@ -82,8 +82,7 @@ struct ias_object *irias_new_object( char *name, int id) IRDA_DEBUG( 4, "%s()\n", __FUNCTION__); - obj = (struct ias_object *) kmalloc(sizeof(struct ias_object), - GFP_ATOMIC); + obj = kmalloc(sizeof(struct ias_object), GFP_ATOMIC); if (obj == NULL) { IRDA_WARNING("%s(), Unable to allocate object!\n", __FUNCTION__); @@ -348,8 +347,7 @@ void irias_add_integer_attrib(struct ias_object *obj, char *name, int value, IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;); IRDA_ASSERT(name != NULL, return;); - attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib), - GFP_ATOMIC); + attrib = kmalloc(sizeof(struct ias_attrib), GFP_ATOMIC); if (attrib == NULL) { IRDA_WARNING("%s: Unable to allocate attribute!\n", __FUNCTION__); @@ -385,8 +383,7 @@ void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets, IRDA_ASSERT(name != NULL, return;); IRDA_ASSERT(octets != NULL, return;); - attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib), - GFP_ATOMIC); + attrib = kmalloc(sizeof(struct ias_attrib), GFP_ATOMIC); if (attrib == NULL) { IRDA_WARNING("%s: Unable to allocate attribute!\n", __FUNCTION__); @@ -420,8 +417,7 @@ void irias_add_string_attrib(struct ias_object *obj, char *name, char *value, IRDA_ASSERT(name != NULL, return;); IRDA_ASSERT(value != NULL, return;); - attrib = (struct ias_attrib *) kmalloc(sizeof( struct ias_attrib), - GFP_ATOMIC); + attrib = kmalloc(sizeof( struct ias_attrib), GFP_ATOMIC); if (attrib == NULL) { IRDA_WARNING("%s: Unable to allocate attribute!\n", __FUNCTION__); diff --git a/net/irda/irnet/irnet.h b/net/irda/irnet/irnet.h index b391cb3893d4..e4fe1e80029c 100644 --- a/net/irda/irnet/irnet.h +++ b/net/irda/irnet/irnet.h @@ -248,6 +248,7 @@ #include <linux/netdevice.h> #include <linux/miscdevice.h> #include <linux/poll.h> +#include <linux/capability.h> #include <linux/config.h> #include <linux/ctype.h> /* isspace() */ #include <asm/uaccess.h> diff --git a/net/key/af_key.c b/net/key/af_key.c index 4c2f6d694f88..43f1ce74187d 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -15,6 +15,7 @@ */ #include <linux/config.h> +#include <linux/capability.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/socket.h> diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index bb50c8a9fcad..2101b45d2ec6 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -24,6 +24,7 @@ #include <linux/config.h> #include <linux/module.h> +#include <linux/capability.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/signal.h> diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 63b0e4afeb33..d44981f5a619 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c @@ -11,6 +11,7 @@ #include <linux/config.h> #include <linux/module.h> #include <linux/moduleparam.h> +#include <linux/capability.h> #include <linux/errno.h> #include <linux/types.h> #include <linux/socket.h> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index f69e5ed9bd06..ee93abc71cb8 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -53,6 +53,7 @@ #include <linux/types.h> #include <linux/sched.h> #include <linux/mm.h> +#include <linux/capability.h> #include <linux/fcntl.h> #include <linux/socket.h> #include <linux/in.h> @@ -1237,7 +1238,7 @@ static int packet_mc_add(struct sock *sk, struct packet_mreq_max *mreq) goto done; err = -ENOBUFS; - i = (struct packet_mclist *)kmalloc(sizeof(*i), GFP_KERNEL); + i = kmalloc(sizeof(*i), GFP_KERNEL); if (i == NULL) goto done; diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 63090be2315a..ea65396d1619 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c @@ -9,7 +9,9 @@ * Copyright (C) Terry Dawson VK2KTJ (terry@animats.net) * Copyright (C) Tomi Manninen OH2BNS (oh2bns@sral.fi) */ + #include <linux/config.h> +#include <linux/capability.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h> diff --git a/net/sched/Kconfig b/net/sched/Kconfig index 55cd5327fbd7..8a260d43ceef 100644 --- a/net/sched/Kconfig +++ b/net/sched/Kconfig @@ -411,7 +411,7 @@ config NET_EMATCH_META tristate "Metadata" depends on NET_EMATCH ---help--- - Say Y here if you want to be ablt to classify packets based on + Say Y here if you want to be able to classify packets based on metadata such as load average, netfilter attributes, socket attributes and routing decisions. diff --git a/net/sched/ematch.c b/net/sched/ematch.c index 64b047c65568..5cb956b721e8 100644 --- a/net/sched/ematch.c +++ b/net/sched/ematch.c @@ -92,7 +92,6 @@ #include <linux/rtnetlink.h> #include <linux/skbuff.h> #include <net/pkt_cls.h> -#include <config/net/ematch/stack.h> static LIST_HEAD(ematch_ops); static DEFINE_RWLOCK(ematch_mod_lock); diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index f9573eba5c7a..556c495c6922 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c @@ -1287,7 +1287,7 @@ static sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep, - (bodysize % SCTP_COOKIE_MULTIPLE); *cookie_len = headersize + bodysize; - retval = (sctp_cookie_param_t *)kmalloc(*cookie_len, GFP_ATOMIC); + retval = kmalloc(*cookie_len, GFP_ATOMIC); if (!retval) { *cookie_len = 0; diff --git a/net/sctp/socket.c b/net/sctp/socket.c index fc04d185fa33..c98ee375ba5e 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -63,6 +63,7 @@ #include <linux/wait.h> #include <linux/time.h> #include <linux/ip.h> +#include <linux/capability.h> #include <linux/fcntl.h> #include <linux/poll.h> #include <linux/init.h> @@ -860,7 +861,7 @@ SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk, return -EFAULT; /* Alloc space for the address array in kernel memory. */ - kaddrs = (struct sockaddr *)kmalloc(addrs_size, GFP_KERNEL); + kaddrs = kmalloc(addrs_size, GFP_KERNEL); if (unlikely(!kaddrs)) return -ENOMEM; @@ -1150,7 +1151,7 @@ SCTP_STATIC int sctp_setsockopt_connectx(struct sock* sk, return -EFAULT; /* Alloc space for the address array in kernel memory. */ - kaddrs = (struct sockaddr *)kmalloc(addrs_size, GFP_KERNEL); + kaddrs = kmalloc(addrs_size, GFP_KERNEL); if (unlikely(!kaddrs)) return -ENOMEM; diff --git a/net/socket.c b/net/socket.c index 06fa217f58a9..b38a263853c3 100644 --- a/net/socket.c +++ b/net/socket.c @@ -993,7 +993,7 @@ static int sock_fasync(int fd, struct file *filp, int on) if (on) { - fna=(struct fasync_struct *)kmalloc(sizeof(struct fasync_struct), GFP_KERNEL); + fna = kmalloc(sizeof(struct fasync_struct), GFP_KERNEL); if(fna==NULL) return -ENOMEM; } diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 8c7756036e95..9ac1b8c26c01 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c @@ -94,7 +94,7 @@ rpcauth_init_credcache(struct rpc_auth *auth, unsigned long expire) struct rpc_cred_cache *new; int i; - new = (struct rpc_cred_cache *)kmalloc(sizeof(*new), GFP_KERNEL); + new = kmalloc(sizeof(*new), GFP_KERNEL); if (!new) return -ENOMEM; for (i = 0; i < RPC_CREDCACHE_NR; i++) diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c index 890fb5ea0dcb..1b3ed4fd1987 100644 --- a/net/sunrpc/auth_unix.c +++ b/net/sunrpc/auth_unix.c @@ -70,7 +70,7 @@ unx_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags) dprintk("RPC: allocating UNIX cred for uid %d gid %d\n", acred->uid, acred->gid); - if (!(cred = (struct unx_cred *) kmalloc(sizeof(*cred), GFP_KERNEL))) + if (!(cred = kmalloc(sizeof(*cred), GFP_KERNEL))) return ERR_PTR(-ENOMEM); atomic_set(&cred->uc_count, 1); diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 4cef7fa2b740..d2f0550c4ba0 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -118,7 +118,7 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname, goto out_err; err = -ENOMEM; - clnt = (struct rpc_clnt *) kmalloc(sizeof(*clnt), GFP_KERNEL); + clnt = kmalloc(sizeof(*clnt), GFP_KERNEL); if (!clnt) goto out_err; memset(clnt, 0, sizeof(*clnt)); @@ -225,7 +225,7 @@ rpc_clone_client(struct rpc_clnt *clnt) { struct rpc_clnt *new; - new = (struct rpc_clnt *)kmalloc(sizeof(*new), GFP_KERNEL); + new = kmalloc(sizeof(*new), GFP_KERNEL); if (!new) goto out_no_clnt; memcpy(new, clnt, sizeof(*new)); diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index a8bd34d47425..b08419e1fc68 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -32,7 +32,7 @@ svc_create(struct svc_program *prog, unsigned int bufsize) int vers; unsigned int xdrsize; - if (!(serv = (struct svc_serv *) kmalloc(sizeof(*serv), GFP_KERNEL))) + if (!(serv = kmalloc(sizeof(*serv), GFP_KERNEL))) return NULL; memset(serv, 0, sizeof(*serv)); serv->sv_name = prog->pg_name; diff --git a/net/wanrouter/af_wanpipe.c b/net/wanrouter/af_wanpipe.c index 7a43ae4721ed..8b9bf4a763b5 100644 --- a/net/wanrouter/af_wanpipe.c +++ b/net/wanrouter/af_wanpipe.c @@ -36,6 +36,7 @@ #include <linux/types.h> #include <linux/sched.h> #include <linux/mm.h> +#include <linux/capability.h> #include <linux/fcntl.h> #include <linux/socket.h> #include <linux/in.h> diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c index bcf7b3faa76a..c34833dc7cc1 100644 --- a/net/wanrouter/wanmain.c +++ b/net/wanrouter/wanmain.c @@ -44,6 +44,7 @@ #include <linux/config.h> #include <linux/stddef.h> /* offsetof(), etc. */ +#include <linux/capability.h> #include <linux/errno.h> /* return codes */ #include <linux/kernel.h> #include <linux/init.h> diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index bfabaf9cba87..72b6ff3299ba 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -37,6 +37,7 @@ #include <linux/config.h> #include <linux/module.h> +#include <linux/capability.h> #include <linux/errno.h> #include <linux/kernel.h> #include <linux/sched.h> |
