diff options
Diffstat (limited to 'net')
514 files changed, 2079 insertions, 833 deletions
diff --git a/net/802/garp.c b/net/802/garp.c index 1dcb0660c49d..9ed7c0e7dc17 100644 --- a/net/802/garp.c +++ b/net/802/garp.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/etherdevice.h> | 14 | #include <linux/etherdevice.h> |
| 15 | #include <linux/rtnetlink.h> | 15 | #include <linux/rtnetlink.h> |
| 16 | #include <linux/llc.h> | 16 | #include <linux/llc.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | #include <net/llc.h> | 18 | #include <net/llc.h> |
| 18 | #include <net/llc_pdu.h> | 19 | #include <net/llc_pdu.h> |
| 19 | #include <net/garp.h> | 20 | #include <net/garp.h> |
diff --git a/net/802/p8022.c b/net/802/p8022.c index 2530f35241cd..7f353c4f437a 100644 --- a/net/802/p8022.c +++ b/net/802/p8022.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
| 19 | #include <linux/netdevice.h> | 19 | #include <linux/netdevice.h> |
| 20 | #include <linux/skbuff.h> | 20 | #include <linux/skbuff.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | #include <net/datalink.h> | 22 | #include <net/datalink.h> |
| 22 | #include <linux/mm.h> | 23 | #include <linux/mm.h> |
| 23 | #include <linux/in.h> | 24 | #include <linux/in.h> |
diff --git a/net/802/p8023.c b/net/802/p8023.c index 6ab1835041a7..1256a40da43c 100644 --- a/net/802/p8023.c +++ b/net/802/p8023.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
| 19 | #include <linux/netdevice.h> | 19 | #include <linux/netdevice.h> |
| 20 | #include <linux/skbuff.h> | 20 | #include <linux/skbuff.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | 22 | ||
| 22 | #include <net/datalink.h> | 23 | #include <net/datalink.h> |
| 23 | #include <net/p8022.h> | 24 | #include <net/p8022.h> |
diff --git a/net/802/psnap.c b/net/802/psnap.c index 6fea0750662b..21cde8fd5795 100644 --- a/net/802/psnap.c +++ b/net/802/psnap.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
| 15 | #include <linux/netdevice.h> | 15 | #include <linux/netdevice.h> |
| 16 | #include <linux/skbuff.h> | 16 | #include <linux/skbuff.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | #include <net/datalink.h> | 18 | #include <net/datalink.h> |
| 18 | #include <net/llc.h> | 19 | #include <net/llc.h> |
| 19 | #include <net/psnap.h> | 20 | #include <net/psnap.h> |
diff --git a/net/802/stp.c b/net/802/stp.c index 0b7a24452d11..53c8f77f0ccd 100644 --- a/net/802/stp.c +++ b/net/802/stp.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/skbuff.h> | 11 | #include <linux/skbuff.h> |
| 12 | #include <linux/etherdevice.h> | 12 | #include <linux/etherdevice.h> |
| 13 | #include <linux/llc.h> | 13 | #include <linux/llc.h> |
| 14 | #include <linux/slab.h> | ||
| 14 | #include <net/llc.h> | 15 | #include <net/llc.h> |
| 15 | #include <net/llc_pdu.h> | 16 | #include <net/llc_pdu.h> |
| 16 | #include <net/stp.h> | 17 | #include <net/stp.h> |
diff --git a/net/802/tr.c b/net/802/tr.c index 44acce47fcdc..1c6e596074df 100644 --- a/net/802/tr.c +++ b/net/802/tr.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/seq_file.h> | 36 | #include <linux/seq_file.h> |
| 37 | #include <linux/init.h> | 37 | #include <linux/init.h> |
| 38 | #include <linux/sysctl.h> | 38 | #include <linux/sysctl.h> |
| 39 | #include <linux/slab.h> | ||
| 39 | #include <net/arp.h> | 40 | #include <net/arp.h> |
| 40 | #include <net/net_namespace.h> | 41 | #include <net/net_namespace.h> |
| 41 | 42 | ||
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 453512266ea1..97da977c2a23 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
| 23 | #include <linux/netdevice.h> | 23 | #include <linux/netdevice.h> |
| 24 | #include <linux/skbuff.h> | 24 | #include <linux/skbuff.h> |
| 25 | #include <linux/slab.h> | ||
| 25 | #include <linux/init.h> | 26 | #include <linux/init.h> |
| 26 | #include <linux/rculist.h> | 27 | #include <linux/rculist.h> |
| 27 | #include <net/p8022.h> | 28 | #include <net/p8022.h> |
| @@ -378,6 +379,8 @@ static void vlan_transfer_features(struct net_device *dev, | |||
| 378 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) | 379 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) |
| 379 | vlandev->fcoe_ddp_xid = dev->fcoe_ddp_xid; | 380 | vlandev->fcoe_ddp_xid = dev->fcoe_ddp_xid; |
| 380 | #endif | 381 | #endif |
| 382 | vlandev->real_num_tx_queues = dev->real_num_tx_queues; | ||
| 383 | BUG_ON(vlandev->real_num_tx_queues > vlandev->num_tx_queues); | ||
| 381 | 384 | ||
| 382 | if (old_features != vlandev->features) | 385 | if (old_features != vlandev->features) |
| 383 | netdev_features_change(vlandev); | 386 | netdev_features_change(vlandev); |
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c index c0316e0ca6e8..c584a0af77d3 100644 --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c | |||
| @@ -11,7 +11,7 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, | |||
| 11 | if (netpoll_rx(skb)) | 11 | if (netpoll_rx(skb)) |
| 12 | return NET_RX_DROP; | 12 | return NET_RX_DROP; |
| 13 | 13 | ||
| 14 | if (skb_bond_should_drop(skb)) | 14 | if (skb_bond_should_drop(skb, ACCESS_ONCE(skb->dev->master))) |
| 15 | goto drop; | 15 | goto drop; |
| 16 | 16 | ||
| 17 | skb->skb_iif = skb->dev->ifindex; | 17 | skb->skb_iif = skb->dev->ifindex; |
| @@ -83,7 +83,7 @@ vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp, | |||
| 83 | { | 83 | { |
| 84 | struct sk_buff *p; | 84 | struct sk_buff *p; |
| 85 | 85 | ||
| 86 | if (skb_bond_should_drop(skb)) | 86 | if (skb_bond_should_drop(skb, ACCESS_ONCE(skb->dev->master))) |
| 87 | goto drop; | 87 | goto drop; |
| 88 | 88 | ||
| 89 | skb->skb_iif = skb->dev->ifindex; | 89 | skb->skb_iif = skb->dev->ifindex; |
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 9e83272fc5b0..29b6348c8d4d 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | */ | 21 | */ |
| 22 | 22 | ||
| 23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
| 24 | #include <linux/slab.h> | ||
| 24 | #include <linux/skbuff.h> | 25 | #include <linux/skbuff.h> |
| 25 | #include <linux/netdevice.h> | 26 | #include <linux/netdevice.h> |
| 26 | #include <linux/etherdevice.h> | 27 | #include <linux/etherdevice.h> |
| @@ -361,6 +362,14 @@ static netdev_tx_t vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb, | |||
| 361 | return ret; | 362 | return ret; |
| 362 | } | 363 | } |
| 363 | 364 | ||
| 365 | static u16 vlan_dev_select_queue(struct net_device *dev, struct sk_buff *skb) | ||
| 366 | { | ||
| 367 | struct net_device *rdev = vlan_dev_info(dev)->real_dev; | ||
| 368 | const struct net_device_ops *ops = rdev->netdev_ops; | ||
| 369 | |||
| 370 | return ops->ndo_select_queue(rdev, skb); | ||
| 371 | } | ||
| 372 | |||
| 364 | static int vlan_dev_change_mtu(struct net_device *dev, int new_mtu) | 373 | static int vlan_dev_change_mtu(struct net_device *dev, int new_mtu) |
| 365 | { | 374 | { |
| 366 | /* TODO: gotta make sure the underlying layer can handle it, | 375 | /* TODO: gotta make sure the underlying layer can handle it, |
| @@ -688,7 +697,8 @@ static const struct header_ops vlan_header_ops = { | |||
| 688 | .parse = eth_header_parse, | 697 | .parse = eth_header_parse, |
| 689 | }; | 698 | }; |
| 690 | 699 | ||
| 691 | static const struct net_device_ops vlan_netdev_ops, vlan_netdev_accel_ops; | 700 | static const struct net_device_ops vlan_netdev_ops, vlan_netdev_accel_ops, |
| 701 | vlan_netdev_ops_sq, vlan_netdev_accel_ops_sq; | ||
| 692 | 702 | ||
| 693 | static int vlan_dev_init(struct net_device *dev) | 703 | static int vlan_dev_init(struct net_device *dev) |
| 694 | { | 704 | { |
| @@ -722,11 +732,17 @@ static int vlan_dev_init(struct net_device *dev) | |||
| 722 | if (real_dev->features & NETIF_F_HW_VLAN_TX) { | 732 | if (real_dev->features & NETIF_F_HW_VLAN_TX) { |
| 723 | dev->header_ops = real_dev->header_ops; | 733 | dev->header_ops = real_dev->header_ops; |
| 724 | dev->hard_header_len = real_dev->hard_header_len; | 734 | dev->hard_header_len = real_dev->hard_header_len; |
| 725 | dev->netdev_ops = &vlan_netdev_accel_ops; | 735 | if (real_dev->netdev_ops->ndo_select_queue) |
| 736 | dev->netdev_ops = &vlan_netdev_accel_ops_sq; | ||
| 737 | else | ||
| 738 | dev->netdev_ops = &vlan_netdev_accel_ops; | ||
| 726 | } else { | 739 | } else { |
| 727 | dev->header_ops = &vlan_header_ops; | 740 | dev->header_ops = &vlan_header_ops; |
| 728 | dev->hard_header_len = real_dev->hard_header_len + VLAN_HLEN; | 741 | dev->hard_header_len = real_dev->hard_header_len + VLAN_HLEN; |
| 729 | dev->netdev_ops = &vlan_netdev_ops; | 742 | if (real_dev->netdev_ops->ndo_select_queue) |
| 743 | dev->netdev_ops = &vlan_netdev_ops_sq; | ||
| 744 | else | ||
| 745 | dev->netdev_ops = &vlan_netdev_ops; | ||
| 730 | } | 746 | } |
| 731 | 747 | ||
| 732 | if (is_vlan_dev(real_dev)) | 748 | if (is_vlan_dev(real_dev)) |
| @@ -865,6 +881,56 @@ static const struct net_device_ops vlan_netdev_accel_ops = { | |||
| 865 | #endif | 881 | #endif |
| 866 | }; | 882 | }; |
| 867 | 883 | ||
| 884 | static const struct net_device_ops vlan_netdev_ops_sq = { | ||
| 885 | .ndo_select_queue = vlan_dev_select_queue, | ||
| 886 | .ndo_change_mtu = vlan_dev_change_mtu, | ||
| 887 | .ndo_init = vlan_dev_init, | ||
| 888 | .ndo_uninit = vlan_dev_uninit, | ||
| 889 | .ndo_open = vlan_dev_open, | ||
| 890 | .ndo_stop = vlan_dev_stop, | ||
| 891 | .ndo_start_xmit = vlan_dev_hard_start_xmit, | ||
| 892 | .ndo_validate_addr = eth_validate_addr, | ||
| 893 | .ndo_set_mac_address = vlan_dev_set_mac_address, | ||
| 894 | .ndo_set_rx_mode = vlan_dev_set_rx_mode, | ||
| 895 | .ndo_set_multicast_list = vlan_dev_set_rx_mode, | ||
| 896 | .ndo_change_rx_flags = vlan_dev_change_rx_flags, | ||
| 897 | .ndo_do_ioctl = vlan_dev_ioctl, | ||
| 898 | .ndo_neigh_setup = vlan_dev_neigh_setup, | ||
| 899 | .ndo_get_stats = vlan_dev_get_stats, | ||
| 900 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) | ||
| 901 | .ndo_fcoe_ddp_setup = vlan_dev_fcoe_ddp_setup, | ||
| 902 | .ndo_fcoe_ddp_done = vlan_dev_fcoe_ddp_done, | ||
| 903 | .ndo_fcoe_enable = vlan_dev_fcoe_enable, | ||
| 904 | .ndo_fcoe_disable = vlan_dev_fcoe_disable, | ||
| 905 | .ndo_fcoe_get_wwn = vlan_dev_fcoe_get_wwn, | ||
| 906 | #endif | ||
| 907 | }; | ||
| 908 | |||
| 909 | static const struct net_device_ops vlan_netdev_accel_ops_sq = { | ||
| 910 | .ndo_select_queue = vlan_dev_select_queue, | ||
| 911 | .ndo_change_mtu = vlan_dev_change_mtu, | ||
| 912 | .ndo_init = vlan_dev_init, | ||
| 913 | .ndo_uninit = vlan_dev_uninit, | ||
| 914 | .ndo_open = vlan_dev_open, | ||
| 915 | .ndo_stop = vlan_dev_stop, | ||
| 916 | .ndo_start_xmit = vlan_dev_hwaccel_hard_start_xmit, | ||
| 917 | .ndo_validate_addr = eth_validate_addr, | ||
| 918 | .ndo_set_mac_address = vlan_dev_set_mac_address, | ||
| 919 | .ndo_set_rx_mode = vlan_dev_set_rx_mode, | ||
| 920 | .ndo_set_multicast_list = vlan_dev_set_rx_mode, | ||
| 921 | .ndo_change_rx_flags = vlan_dev_change_rx_flags, | ||
| 922 | .ndo_do_ioctl = vlan_dev_ioctl, | ||
| 923 | .ndo_neigh_setup = vlan_dev_neigh_setup, | ||
| 924 | .ndo_get_stats = vlan_dev_get_stats, | ||
| 925 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) | ||
| 926 | .ndo_fcoe_ddp_setup = vlan_dev_fcoe_ddp_setup, | ||
| 927 | .ndo_fcoe_ddp_done = vlan_dev_fcoe_ddp_done, | ||
| 928 | .ndo_fcoe_enable = vlan_dev_fcoe_enable, | ||
| 929 | .ndo_fcoe_disable = vlan_dev_fcoe_disable, | ||
| 930 | .ndo_fcoe_get_wwn = vlan_dev_fcoe_get_wwn, | ||
| 931 | #endif | ||
| 932 | }; | ||
| 933 | |||
| 868 | void vlan_setup(struct net_device *dev) | 934 | void vlan_setup(struct net_device *dev) |
| 869 | { | 935 | { |
| 870 | ether_setup(dev); | 936 | ether_setup(dev); |
diff --git a/net/9p/client.c b/net/9p/client.c index bde9f3d38c57..0aa79faa9850 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/poll.h> | 29 | #include <linux/poll.h> |
| 30 | #include <linux/idr.h> | 30 | #include <linux/idr.h> |
| 31 | #include <linux/mutex.h> | 31 | #include <linux/mutex.h> |
| 32 | #include <linux/slab.h> | ||
| 32 | #include <linux/sched.h> | 33 | #include <linux/sched.h> |
| 33 | #include <linux/uaccess.h> | 34 | #include <linux/uaccess.h> |
| 34 | #include <net/9p/9p.h> | 35 | #include <net/9p/9p.h> |
| @@ -60,7 +61,7 @@ static const match_table_t tokens = { | |||
| 60 | 61 | ||
| 61 | inline int p9_is_proto_dotl(struct p9_client *clnt) | 62 | inline int p9_is_proto_dotl(struct p9_client *clnt) |
| 62 | { | 63 | { |
| 63 | return (clnt->proto_version == p9_proto_2010L); | 64 | return (clnt->proto_version == p9_proto_2000L); |
| 64 | } | 65 | } |
| 65 | EXPORT_SYMBOL(p9_is_proto_dotl); | 66 | EXPORT_SYMBOL(p9_is_proto_dotl); |
| 66 | 67 | ||
| @@ -71,18 +72,19 @@ inline int p9_is_proto_dotu(struct p9_client *clnt) | |||
| 71 | EXPORT_SYMBOL(p9_is_proto_dotu); | 72 | EXPORT_SYMBOL(p9_is_proto_dotu); |
| 72 | 73 | ||
| 73 | /* Interpret mount option for protocol version */ | 74 | /* Interpret mount option for protocol version */ |
| 74 | static unsigned char get_protocol_version(const substring_t *name) | 75 | static int get_protocol_version(const substring_t *name) |
| 75 | { | 76 | { |
| 76 | unsigned char version = -EINVAL; | 77 | int version = -EINVAL; |
| 78 | |||
| 77 | if (!strncmp("9p2000", name->from, name->to-name->from)) { | 79 | if (!strncmp("9p2000", name->from, name->to-name->from)) { |
| 78 | version = p9_proto_legacy; | 80 | version = p9_proto_legacy; |
| 79 | P9_DPRINTK(P9_DEBUG_9P, "Protocol version: Legacy\n"); | 81 | P9_DPRINTK(P9_DEBUG_9P, "Protocol version: Legacy\n"); |
| 80 | } else if (!strncmp("9p2000.u", name->from, name->to-name->from)) { | 82 | } else if (!strncmp("9p2000.u", name->from, name->to-name->from)) { |
| 81 | version = p9_proto_2000u; | 83 | version = p9_proto_2000u; |
| 82 | P9_DPRINTK(P9_DEBUG_9P, "Protocol version: 9P2000.u\n"); | 84 | P9_DPRINTK(P9_DEBUG_9P, "Protocol version: 9P2000.u\n"); |
| 83 | } else if (!strncmp("9p2010.L", name->from, name->to-name->from)) { | 85 | } else if (!strncmp("9p2000.L", name->from, name->to-name->from)) { |
| 84 | version = p9_proto_2010L; | 86 | version = p9_proto_2000L; |
| 85 | P9_DPRINTK(P9_DEBUG_9P, "Protocol version: 9P2010.L\n"); | 87 | P9_DPRINTK(P9_DEBUG_9P, "Protocol version: 9P2000.L\n"); |
| 86 | } else { | 88 | } else { |
| 87 | P9_DPRINTK(P9_DEBUG_ERROR, "Unknown protocol version %s. ", | 89 | P9_DPRINTK(P9_DEBUG_ERROR, "Unknown protocol version %s. ", |
| 88 | name->from); | 90 | name->from); |
| @@ -533,7 +535,12 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...) | |||
| 533 | 535 | ||
| 534 | P9_DPRINTK(P9_DEBUG_MUX, "client %p op %d\n", c, type); | 536 | P9_DPRINTK(P9_DEBUG_MUX, "client %p op %d\n", c, type); |
| 535 | 537 | ||
| 536 | if (c->status != Connected) | 538 | /* we allow for any status other than disconnected */ |
| 539 | if (c->status == Disconnected) | ||
| 540 | return ERR_PTR(-EIO); | ||
| 541 | |||
| 542 | /* if status is begin_disconnected we allow only clunk request */ | ||
| 543 | if ((c->status == BeginDisconnect) && (type != P9_TCLUNK)) | ||
| 537 | return ERR_PTR(-EIO); | 544 | return ERR_PTR(-EIO); |
| 538 | 545 | ||
| 539 | if (signal_pending(current)) { | 546 | if (signal_pending(current)) { |
| @@ -672,9 +679,9 @@ int p9_client_version(struct p9_client *c) | |||
| 672 | c->msize, c->proto_version); | 679 | c->msize, c->proto_version); |
| 673 | 680 | ||
| 674 | switch (c->proto_version) { | 681 | switch (c->proto_version) { |
| 675 | case p9_proto_2010L: | 682 | case p9_proto_2000L: |
| 676 | req = p9_client_rpc(c, P9_TVERSION, "ds", | 683 | req = p9_client_rpc(c, P9_TVERSION, "ds", |
| 677 | c->msize, "9P2010.L"); | 684 | c->msize, "9P2000.L"); |
| 678 | break; | 685 | break; |
| 679 | case p9_proto_2000u: | 686 | case p9_proto_2000u: |
| 680 | req = p9_client_rpc(c, P9_TVERSION, "ds", | 687 | req = p9_client_rpc(c, P9_TVERSION, "ds", |
| @@ -700,8 +707,8 @@ int p9_client_version(struct p9_client *c) | |||
| 700 | } | 707 | } |
| 701 | 708 | ||
| 702 | P9_DPRINTK(P9_DEBUG_9P, "<<< RVERSION msize %d %s\n", msize, version); | 709 | P9_DPRINTK(P9_DEBUG_9P, "<<< RVERSION msize %d %s\n", msize, version); |
| 703 | if (!strncmp(version, "9P2010.L", 8)) | 710 | if (!strncmp(version, "9P2000.L", 8)) |
| 704 | c->proto_version = p9_proto_2010L; | 711 | c->proto_version = p9_proto_2000L; |
| 705 | else if (!strncmp(version, "9P2000.u", 8)) | 712 | else if (!strncmp(version, "9P2000.u", 8)) |
| 706 | c->proto_version = p9_proto_2000u; | 713 | c->proto_version = p9_proto_2000u; |
| 707 | else if (!strncmp(version, "9P2000", 6)) | 714 | else if (!strncmp(version, "9P2000", 6)) |
| @@ -799,8 +806,10 @@ void p9_client_destroy(struct p9_client *clnt) | |||
| 799 | 806 | ||
| 800 | v9fs_put_trans(clnt->trans_mod); | 807 | v9fs_put_trans(clnt->trans_mod); |
| 801 | 808 | ||
| 802 | list_for_each_entry_safe(fid, fidptr, &clnt->fidlist, flist) | 809 | list_for_each_entry_safe(fid, fidptr, &clnt->fidlist, flist) { |
| 810 | printk(KERN_INFO "Found fid %d not clunked\n", fid->fid); | ||
| 803 | p9_fid_destroy(fid); | 811 | p9_fid_destroy(fid); |
| 812 | } | ||
| 804 | 813 | ||
| 805 | if (clnt->fidpool) | 814 | if (clnt->fidpool) |
| 806 | p9_idpool_destroy(clnt->fidpool); | 815 | p9_idpool_destroy(clnt->fidpool); |
| @@ -818,6 +827,13 @@ void p9_client_disconnect(struct p9_client *clnt) | |||
| 818 | } | 827 | } |
| 819 | EXPORT_SYMBOL(p9_client_disconnect); | 828 | EXPORT_SYMBOL(p9_client_disconnect); |
| 820 | 829 | ||
| 830 | void p9_client_begin_disconnect(struct p9_client *clnt) | ||
| 831 | { | ||
| 832 | P9_DPRINTK(P9_DEBUG_9P, "clnt %p\n", clnt); | ||
| 833 | clnt->status = BeginDisconnect; | ||
| 834 | } | ||
| 835 | EXPORT_SYMBOL(p9_client_begin_disconnect); | ||
| 836 | |||
| 821 | struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, | 837 | struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, |
| 822 | char *uname, u32 n_uname, char *aname) | 838 | char *uname, u32 n_uname, char *aname) |
| 823 | { | 839 | { |
diff --git a/net/9p/protocol.c b/net/9p/protocol.c index 94f5a8f65e9c..e7541d5b0118 100644 --- a/net/9p/protocol.c +++ b/net/9p/protocol.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
| 29 | #include <linux/errno.h> | 29 | #include <linux/errno.h> |
| 30 | #include <linux/uaccess.h> | 30 | #include <linux/uaccess.h> |
| 31 | #include <linux/slab.h> | ||
| 31 | #include <linux/sched.h> | 32 | #include <linux/sched.h> |
| 32 | #include <linux/types.h> | 33 | #include <linux/types.h> |
| 33 | #include <net/9p/9p.h> | 34 | #include <net/9p/9p.h> |
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index 31d0b05582a9..98ce9bcb0e15 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c | |||
| @@ -38,6 +38,7 @@ | |||
| 38 | #include <linux/idr.h> | 38 | #include <linux/idr.h> |
| 39 | #include <linux/file.h> | 39 | #include <linux/file.h> |
| 40 | #include <linux/parser.h> | 40 | #include <linux/parser.h> |
| 41 | #include <linux/slab.h> | ||
| 41 | #include <net/9p/9p.h> | 42 | #include <net/9p/9p.h> |
| 42 | #include <net/9p/client.h> | 43 | #include <net/9p/client.h> |
| 43 | #include <net/9p/transport.h> | 44 | #include <net/9p/transport.h> |
diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index 2c95a89c0f46..041101ab4aa5 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c | |||
| @@ -40,6 +40,7 @@ | |||
| 40 | #include <linux/file.h> | 40 | #include <linux/file.h> |
| 41 | #include <linux/parser.h> | 41 | #include <linux/parser.h> |
| 42 | #include <linux/semaphore.h> | 42 | #include <linux/semaphore.h> |
| 43 | #include <linux/slab.h> | ||
| 43 | #include <net/9p/9p.h> | 44 | #include <net/9p/9p.h> |
| 44 | #include <net/9p/client.h> | 45 | #include <net/9p/client.h> |
| 45 | #include <net/9p/transport.h> | 46 | #include <net/9p/transport.h> |
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 0aaed4819379..7eb78ecc1618 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | #include <linux/inet.h> | 37 | #include <linux/inet.h> |
| 38 | #include <linux/idr.h> | 38 | #include <linux/idr.h> |
| 39 | #include <linux/file.h> | 39 | #include <linux/file.h> |
| 40 | #include <linux/slab.h> | ||
| 40 | #include <net/9p/9p.h> | 41 | #include <net/9p/9p.h> |
| 41 | #include <linux/parser.h> | 42 | #include <linux/parser.h> |
| 42 | #include <net/9p/client.h> | 43 | #include <net/9p/client.h> |
| @@ -78,6 +79,12 @@ struct virtio_chan { | |||
| 78 | /* Scatterlist: can be too big for stack. */ | 79 | /* Scatterlist: can be too big for stack. */ |
| 79 | struct scatterlist sg[VIRTQUEUE_NUM]; | 80 | struct scatterlist sg[VIRTQUEUE_NUM]; |
| 80 | 81 | ||
| 82 | int tag_len; | ||
| 83 | /* | ||
| 84 | * tag name to identify a mount Non-null terminated | ||
| 85 | */ | ||
| 86 | char *tag; | ||
| 87 | |||
| 81 | struct list_head chan_list; | 88 | struct list_head chan_list; |
| 82 | }; | 89 | }; |
| 83 | 90 | ||
| @@ -214,6 +221,20 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req) | |||
| 214 | return 0; | 221 | return 0; |
| 215 | } | 222 | } |
| 216 | 223 | ||
| 224 | static ssize_t p9_mount_tag_show(struct device *dev, | ||
| 225 | struct device_attribute *attr, char *buf) | ||
| 226 | { | ||
| 227 | struct virtio_chan *chan; | ||
| 228 | struct virtio_device *vdev; | ||
| 229 | |||
| 230 | vdev = dev_to_virtio(dev); | ||
| 231 | chan = vdev->priv; | ||
| 232 | |||
| 233 | return snprintf(buf, chan->tag_len + 1, "%s", chan->tag); | ||
| 234 | } | ||
| 235 | |||
| 236 | static DEVICE_ATTR(mount_tag, 0444, p9_mount_tag_show, NULL); | ||
| 237 | |||
| 217 | /** | 238 | /** |
| 218 | * p9_virtio_probe - probe for existence of 9P virtio channels | 239 | * p9_virtio_probe - probe for existence of 9P virtio channels |
| 219 | * @vdev: virtio device to probe | 240 | * @vdev: virtio device to probe |
| @@ -224,6 +245,8 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req) | |||
| 224 | 245 | ||
| 225 | static int p9_virtio_probe(struct virtio_device *vdev) | 246 | static int p9_virtio_probe(struct virtio_device *vdev) |
| 226 | { | 247 | { |
| 248 | __u16 tag_len; | ||
| 249 | char *tag; | ||
| 227 | int err; | 250 | int err; |
| 228 | struct virtio_chan *chan; | 251 | struct virtio_chan *chan; |
| 229 | 252 | ||
| @@ -248,6 +271,28 @@ static int p9_virtio_probe(struct virtio_device *vdev) | |||
| 248 | sg_init_table(chan->sg, VIRTQUEUE_NUM); | 271 | sg_init_table(chan->sg, VIRTQUEUE_NUM); |
| 249 | 272 | ||
| 250 | chan->inuse = false; | 273 | chan->inuse = false; |
| 274 | if (virtio_has_feature(vdev, VIRTIO_9P_MOUNT_TAG)) { | ||
| 275 | vdev->config->get(vdev, | ||
| 276 | offsetof(struct virtio_9p_config, tag_len), | ||
| 277 | &tag_len, sizeof(tag_len)); | ||
| 278 | } else { | ||
| 279 | err = -EINVAL; | ||
| 280 | goto out_free_vq; | ||
| 281 | } | ||
| 282 | tag = kmalloc(tag_len, GFP_KERNEL); | ||
| 283 | if (!tag) { | ||
| 284 | err = -ENOMEM; | ||
| 285 | goto out_free_vq; | ||
| 286 | } | ||
| 287 | vdev->config->get(vdev, offsetof(struct virtio_9p_config, tag), | ||
| 288 | tag, tag_len); | ||
| 289 | chan->tag = tag; | ||
| 290 | chan->tag_len = tag_len; | ||
| 291 | err = sysfs_create_file(&(vdev->dev.kobj), &dev_attr_mount_tag.attr); | ||
| 292 | if (err) { | ||
| 293 | kfree(tag); | ||
| 294 | goto out_free_vq; | ||
| 295 | } | ||
| 251 | mutex_lock(&virtio_9p_lock); | 296 | mutex_lock(&virtio_9p_lock); |
| 252 | list_add_tail(&chan->chan_list, &virtio_chan_list); | 297 | list_add_tail(&chan->chan_list, &virtio_chan_list); |
| 253 | mutex_unlock(&virtio_9p_lock); | 298 | mutex_unlock(&virtio_9p_lock); |
| @@ -284,7 +329,7 @@ p9_virtio_create(struct p9_client *client, const char *devname, char *args) | |||
| 284 | 329 | ||
| 285 | mutex_lock(&virtio_9p_lock); | 330 | mutex_lock(&virtio_9p_lock); |
| 286 | list_for_each_entry(chan, &virtio_chan_list, chan_list) { | 331 | list_for_each_entry(chan, &virtio_chan_list, chan_list) { |
| 287 | if (!strcmp(devname, dev_name(&chan->vdev->dev))) { | 332 | if (!strncmp(devname, chan->tag, chan->tag_len)) { |
| 288 | if (!chan->inuse) { | 333 | if (!chan->inuse) { |
| 289 | chan->inuse = true; | 334 | chan->inuse = true; |
| 290 | found = 1; | 335 | found = 1; |
| @@ -323,6 +368,8 @@ static void p9_virtio_remove(struct virtio_device *vdev) | |||
| 323 | mutex_lock(&virtio_9p_lock); | 368 | mutex_lock(&virtio_9p_lock); |
| 324 | list_del(&chan->chan_list); | 369 | list_del(&chan->chan_list); |
| 325 | mutex_unlock(&virtio_9p_lock); | 370 | mutex_unlock(&virtio_9p_lock); |
| 371 | sysfs_remove_file(&(vdev->dev.kobj), &dev_attr_mount_tag.attr); | ||
| 372 | kfree(chan->tag); | ||
| 326 | kfree(chan); | 373 | kfree(chan); |
| 327 | 374 | ||
| 328 | } | 375 | } |
| @@ -332,13 +379,19 @@ static struct virtio_device_id id_table[] = { | |||
| 332 | { 0 }, | 379 | { 0 }, |
| 333 | }; | 380 | }; |
| 334 | 381 | ||
| 382 | static unsigned int features[] = { | ||
| 383 | VIRTIO_9P_MOUNT_TAG, | ||
| 384 | }; | ||
| 385 | |||
| 335 | /* The standard "struct lguest_driver": */ | 386 | /* The standard "struct lguest_driver": */ |
| 336 | static struct virtio_driver p9_virtio_drv = { | 387 | static struct virtio_driver p9_virtio_drv = { |
| 337 | .driver.name = KBUILD_MODNAME, | 388 | .feature_table = features, |
| 338 | .driver.owner = THIS_MODULE, | 389 | .feature_table_size = ARRAY_SIZE(features), |
| 339 | .id_table = id_table, | 390 | .driver.name = KBUILD_MODNAME, |
| 340 | .probe = p9_virtio_probe, | 391 | .driver.owner = THIS_MODULE, |
| 341 | .remove = p9_virtio_remove, | 392 | .id_table = id_table, |
| 393 | .probe = p9_virtio_probe, | ||
| 394 | .remove = p9_virtio_remove, | ||
| 342 | }; | 395 | }; |
| 343 | 396 | ||
| 344 | static struct p9_trans_module p9_virtio_trans = { | 397 | static struct p9_trans_module p9_virtio_trans = { |
diff --git a/net/9p/util.c b/net/9p/util.c index dc4ec05ad93d..e048701a72d2 100644 --- a/net/9p/util.c +++ b/net/9p/util.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <linux/sched.h> | 30 | #include <linux/sched.h> |
| 31 | #include <linux/parser.h> | 31 | #include <linux/parser.h> |
| 32 | #include <linux/idr.h> | 32 | #include <linux/idr.h> |
| 33 | #include <linux/slab.h> | ||
| 33 | #include <net/9p/9p.h> | 34 | #include <net/9p/9p.h> |
| 34 | 35 | ||
| 35 | /** | 36 | /** |
diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c index f2b3b56aa779..50dce7981321 100644 --- a/net/appletalk/aarp.c +++ b/net/appletalk/aarp.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | */ | 30 | */ |
| 31 | 31 | ||
| 32 | #include <linux/if_arp.h> | 32 | #include <linux/if_arp.h> |
| 33 | #include <linux/slab.h> | ||
| 33 | #include <net/sock.h> | 34 | #include <net/sock.h> |
| 34 | #include <net/datalink.h> | 35 | #include <net/datalink.h> |
| 35 | #include <net/psnap.h> | 36 | #include <net/psnap.h> |
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index 9fc4da56fb1d..7b02967fbbe7 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c | |||
| @@ -57,6 +57,7 @@ | |||
| 57 | #include <linux/smp_lock.h> | 57 | #include <linux/smp_lock.h> |
| 58 | #include <linux/termios.h> /* For TIOCOUTQ/INQ */ | 58 | #include <linux/termios.h> /* For TIOCOUTQ/INQ */ |
| 59 | #include <linux/compat.h> | 59 | #include <linux/compat.h> |
| 60 | #include <linux/slab.h> | ||
| 60 | #include <net/datalink.h> | 61 | #include <net/datalink.h> |
| 61 | #include <net/psnap.h> | 62 | #include <net/psnap.h> |
| 62 | #include <net/sock.h> | 63 | #include <net/sock.h> |
diff --git a/net/atm/addr.c b/net/atm/addr.c index cf3ae8b47572..dcda35c66f15 100644 --- a/net/atm/addr.c +++ b/net/atm/addr.c | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include <linux/atm.h> | 5 | #include <linux/atm.h> |
| 6 | #include <linux/atmdev.h> | 6 | #include <linux/atmdev.h> |
| 7 | #include <linux/slab.h> | ||
| 7 | #include <linux/uaccess.h> | 8 | #include <linux/uaccess.h> |
| 8 | 9 | ||
| 9 | #include "signaling.h" | 10 | #include "signaling.h" |
diff --git a/net/atm/atm_sysfs.c b/net/atm/atm_sysfs.c index f693b78eb467..799c631f0fed 100644 --- a/net/atm/atm_sysfs.c +++ b/net/atm/atm_sysfs.c | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | /* ATM driver model support. */ | 1 | /* ATM driver model support. */ |
| 2 | 2 | ||
| 3 | #include <linux/kernel.h> | 3 | #include <linux/kernel.h> |
| 4 | #include <linux/slab.h> | ||
| 4 | #include <linux/init.h> | 5 | #include <linux/init.h> |
| 5 | #include <linux/kobject.h> | 6 | #include <linux/kobject.h> |
| 6 | #include <linux/atmdev.h> | 7 | #include <linux/atmdev.h> |
diff --git a/net/atm/br2684.c b/net/atm/br2684.c index 4d64d87e7578..d6c7ceaf13e9 100644 --- a/net/atm/br2684.c +++ b/net/atm/br2684.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/rtnetlink.h> | 18 | #include <linux/rtnetlink.h> |
| 19 | #include <linux/ip.h> | 19 | #include <linux/ip.h> |
| 20 | #include <linux/uaccess.h> | 20 | #include <linux/uaccess.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | #include <net/arp.h> | 22 | #include <net/arp.h> |
| 22 | #include <linux/atm.h> | 23 | #include <linux/atm.h> |
| 23 | #include <linux/atmdev.h> | 24 | #include <linux/atmdev.h> |
diff --git a/net/atm/clip.c b/net/atm/clip.c index ebfa022008f7..313aba11316b 100644 --- a/net/atm/clip.c +++ b/net/atm/clip.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <linux/seq_file.h> | 30 | #include <linux/seq_file.h> |
| 31 | #include <linux/rcupdate.h> | 31 | #include <linux/rcupdate.h> |
| 32 | #include <linux/jhash.h> | 32 | #include <linux/jhash.h> |
| 33 | #include <linux/slab.h> | ||
| 33 | #include <net/route.h> /* for struct rtable and routing */ | 34 | #include <net/route.h> /* for struct rtable and routing */ |
| 34 | #include <net/icmp.h> /* icmp_send */ | 35 | #include <net/icmp.h> /* icmp_send */ |
| 35 | #include <linux/param.h> /* for HZ */ | 36 | #include <linux/param.h> /* for HZ */ |
diff --git a/net/atm/common.c b/net/atm/common.c index 74d095a081e3..97ed94aa0cbc 100644 --- a/net/atm/common.c +++ b/net/atm/common.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/skbuff.h> | 18 | #include <linux/skbuff.h> |
| 19 | #include <linux/bitops.h> | 19 | #include <linux/bitops.h> |
| 20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | #include <net/sock.h> /* struct sock */ | 22 | #include <net/sock.h> /* struct sock */ |
| 22 | #include <linux/uaccess.h> | 23 | #include <linux/uaccess.h> |
| 23 | #include <linux/poll.h> | 24 | #include <linux/poll.h> |
diff --git a/net/atm/lec.c b/net/atm/lec.c index 5da5753157f9..feeaf5718472 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__ | 7 | #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__ |
| 8 | 8 | ||
| 9 | #include <linux/slab.h> | ||
| 9 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
| 10 | #include <linux/bitops.h> | 11 | #include <linux/bitops.h> |
| 11 | #include <linux/capability.h> | 12 | #include <linux/capability.h> |
diff --git a/net/atm/mpc.c b/net/atm/mpc.c index a6521c8aa88b..436f2e177657 100644 --- a/net/atm/mpc.c +++ b/net/atm/mpc.c | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | #include <linux/kernel.h> | 3 | #include <linux/kernel.h> |
| 4 | #include <linux/string.h> | 4 | #include <linux/string.h> |
| 5 | #include <linux/slab.h> | ||
| 5 | #include <linux/timer.h> | 6 | #include <linux/timer.h> |
| 6 | #include <linux/init.h> | 7 | #include <linux/init.h> |
| 7 | #include <linux/bitops.h> | 8 | #include <linux/bitops.h> |
diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c index 4c141810eb6d..e773d8336918 100644 --- a/net/atm/mpoa_caches.c +++ b/net/atm/mpoa_caches.c | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | #include <linux/types.h> | 1 | #include <linux/types.h> |
| 2 | #include <linux/atmmpc.h> | 2 | #include <linux/atmmpc.h> |
| 3 | #include <linux/slab.h> | ||
| 3 | #include <linux/time.h> | 4 | #include <linux/time.h> |
| 4 | 5 | ||
| 5 | #include "mpoa_caches.h" | 6 | #include "mpoa_caches.h" |
diff --git a/net/atm/mpoa_proc.c b/net/atm/mpoa_proc.c index b9bdb98427e4..53e500292271 100644 --- a/net/atm/mpoa_proc.c +++ b/net/atm/mpoa_proc.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/uaccess.h> | 12 | #include <linux/uaccess.h> |
| 13 | #include <linux/atmmpc.h> | 13 | #include <linux/atmmpc.h> |
| 14 | #include <linux/atm.h> | 14 | #include <linux/atm.h> |
| 15 | #include <linux/gfp.h> | ||
| 15 | #include "mpc.h" | 16 | #include "mpc.h" |
| 16 | #include "mpoa_caches.h" | 17 | #include "mpoa_caches.h" |
| 17 | 18 | ||
diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c index 400839273c67..e49bb6d948a1 100644 --- a/net/atm/pppoatm.c +++ b/net/atm/pppoatm.c | |||
| @@ -38,6 +38,7 @@ | |||
| 38 | #include <linux/module.h> | 38 | #include <linux/module.h> |
| 39 | #include <linux/init.h> | 39 | #include <linux/init.h> |
| 40 | #include <linux/skbuff.h> | 40 | #include <linux/skbuff.h> |
| 41 | #include <linux/slab.h> | ||
| 41 | #include <linux/atm.h> | 42 | #include <linux/atm.h> |
| 42 | #include <linux/atmdev.h> | 43 | #include <linux/atmdev.h> |
| 43 | #include <linux/capability.h> | 44 | #include <linux/capability.h> |
diff --git a/net/atm/proc.c b/net/atm/proc.c index 7a96b2376bd7..696e218436e5 100644 --- a/net/atm/proc.c +++ b/net/atm/proc.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/netdevice.h> | 22 | #include <linux/netdevice.h> |
| 23 | #include <linux/atmclip.h> | 23 | #include <linux/atmclip.h> |
| 24 | #include <linux/init.h> /* for __init */ | 24 | #include <linux/init.h> /* for __init */ |
| 25 | #include <linux/slab.h> | ||
| 25 | #include <net/net_namespace.h> | 26 | #include <net/net_namespace.h> |
| 26 | #include <net/atmclip.h> | 27 | #include <net/atmclip.h> |
| 27 | #include <linux/uaccess.h> | 28 | #include <linux/uaccess.h> |
diff --git a/net/atm/raw.c b/net/atm/raw.c index d0c4bd047dc4..b4f7b9ff3c74 100644 --- a/net/atm/raw.c +++ b/net/atm/raw.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
| 11 | #include <linux/skbuff.h> | 11 | #include <linux/skbuff.h> |
| 12 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | 14 | ||
| 14 | #include "common.h" | 15 | #include "common.h" |
| 15 | #include "protocols.h" | 16 | #include "protocols.h" |
diff --git a/net/atm/resources.c b/net/atm/resources.c index 90082904f20d..d29e58261511 100644 --- a/net/atm/resources.c +++ b/net/atm/resources.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/capability.h> | 19 | #include <linux/capability.h> |
| 20 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
| 21 | #include <linux/mutex.h> | 21 | #include <linux/mutex.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | 23 | ||
| 23 | #include <net/sock.h> /* for struct sock */ | 24 | #include <net/sock.h> /* for struct sock */ |
| 24 | 25 | ||
diff --git a/net/atm/signaling.c b/net/atm/signaling.c index ad1d28ae512b..6ba6e466ee54 100644 --- a/net/atm/signaling.c +++ b/net/atm/signaling.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/atmsvc.h> | 14 | #include <linux/atmsvc.h> |
| 15 | #include <linux/atmdev.h> | 15 | #include <linux/atmdev.h> |
| 16 | #include <linux/bitops.h> | 16 | #include <linux/bitops.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | 18 | ||
| 18 | #include "resources.h" | 19 | #include "resources.h" |
| 19 | #include "signaling.h" | 20 | #include "signaling.h" |
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index a5beedf43e2d..65c5801261f9 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/string.h> | 25 | #include <linux/string.h> |
| 26 | #include <linux/sockios.h> | 26 | #include <linux/sockios.h> |
| 27 | #include <linux/net.h> | 27 | #include <linux/net.h> |
| 28 | #include <linux/slab.h> | ||
| 28 | #include <net/ax25.h> | 29 | #include <net/ax25.h> |
| 29 | #include <linux/inet.h> | 30 | #include <linux/inet.h> |
| 30 | #include <linux/netdevice.h> | 31 | #include <linux/netdevice.h> |
diff --git a/net/ax25/ax25_dev.c b/net/ax25/ax25_dev.c index a7a0e0c9698b..c1cb982f6e86 100644 --- a/net/ax25/ax25_dev.c +++ b/net/ax25/ax25_dev.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include <linux/errno.h> | 9 | #include <linux/errno.h> |
| 10 | #include <linux/types.h> | 10 | #include <linux/types.h> |
| 11 | #include <linux/socket.h> | 11 | #include <linux/socket.h> |
| 12 | #include <linux/slab.h> | ||
| 12 | #include <linux/in.h> | 13 | #include <linux/in.h> |
| 13 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
| 14 | #include <linux/timer.h> | 15 | #include <linux/timer.h> |
diff --git a/net/ax25/ax25_ds_subr.c b/net/ax25/ax25_ds_subr.c index b5e59787be2f..85816e612dc0 100644 --- a/net/ax25/ax25_ds_subr.c +++ b/net/ax25/ax25_ds_subr.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/sockios.h> | 17 | #include <linux/sockios.h> |
| 18 | #include <linux/spinlock.h> | 18 | #include <linux/spinlock.h> |
| 19 | #include <linux/net.h> | 19 | #include <linux/net.h> |
| 20 | #include <linux/gfp.h> | ||
| 20 | #include <net/ax25.h> | 21 | #include <net/ax25.h> |
| 21 | #include <linux/inet.h> | 22 | #include <linux/inet.h> |
| 22 | #include <linux/netdevice.h> | 23 | #include <linux/netdevice.h> |
diff --git a/net/ax25/ax25_iface.c b/net/ax25/ax25_iface.c index 71338f112108..5a0dda8df492 100644 --- a/net/ax25/ax25_iface.c +++ b/net/ax25/ax25_iface.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/string.h> | 17 | #include <linux/string.h> |
| 18 | #include <linux/sockios.h> | 18 | #include <linux/sockios.h> |
| 19 | #include <linux/net.h> | 19 | #include <linux/net.h> |
| 20 | #include <linux/slab.h> | ||
| 20 | #include <net/ax25.h> | 21 | #include <net/ax25.h> |
| 21 | #include <linux/inet.h> | 22 | #include <linux/inet.h> |
| 22 | #include <linux/netdevice.h> | 23 | #include <linux/netdevice.h> |
diff --git a/net/ax25/ax25_in.c b/net/ax25/ax25_in.c index de56d3983de0..9bb776541203 100644 --- a/net/ax25/ax25_in.c +++ b/net/ax25/ax25_in.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/string.h> | 18 | #include <linux/string.h> |
| 19 | #include <linux/sockios.h> | 19 | #include <linux/sockios.h> |
| 20 | #include <linux/net.h> | 20 | #include <linux/net.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | #include <net/ax25.h> | 22 | #include <net/ax25.h> |
| 22 | #include <linux/inet.h> | 23 | #include <linux/inet.h> |
| 23 | #include <linux/netdevice.h> | 24 | #include <linux/netdevice.h> |
diff --git a/net/ax25/ax25_ip.c b/net/ax25/ax25_ip.c index f047a57aa95c..cf0c47a26530 100644 --- a/net/ax25/ax25_ip.c +++ b/net/ax25/ax25_ip.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/string.h> | 16 | #include <linux/string.h> |
| 17 | #include <linux/sockios.h> | 17 | #include <linux/sockios.h> |
| 18 | #include <linux/net.h> | 18 | #include <linux/net.h> |
| 19 | #include <linux/slab.h> | ||
| 19 | #include <net/ax25.h> | 20 | #include <net/ax25.h> |
| 20 | #include <linux/inet.h> | 21 | #include <linux/inet.h> |
| 21 | #include <linux/netdevice.h> | 22 | #include <linux/netdevice.h> |
diff --git a/net/ax25/ax25_out.c b/net/ax25/ax25_out.c index 14912600ec57..37507d806f65 100644 --- a/net/ax25/ax25_out.c +++ b/net/ax25/ax25_out.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/sockios.h> | 19 | #include <linux/sockios.h> |
| 20 | #include <linux/spinlock.h> | 20 | #include <linux/spinlock.h> |
| 21 | #include <linux/net.h> | 21 | #include <linux/net.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | #include <net/ax25.h> | 23 | #include <net/ax25.h> |
| 23 | #include <linux/inet.h> | 24 | #include <linux/inet.h> |
| 24 | #include <linux/netdevice.h> | 25 | #include <linux/netdevice.h> |
diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c index c833ba4c45a5..7805945a5fd6 100644 --- a/net/ax25/ax25_route.c +++ b/net/ax25/ax25_route.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/string.h> | 23 | #include <linux/string.h> |
| 24 | #include <linux/sockios.h> | 24 | #include <linux/sockios.h> |
| 25 | #include <linux/net.h> | 25 | #include <linux/net.h> |
| 26 | #include <linux/slab.h> | ||
| 26 | #include <net/ax25.h> | 27 | #include <net/ax25.h> |
| 27 | #include <linux/inet.h> | 28 | #include <linux/inet.h> |
| 28 | #include <linux/netdevice.h> | 29 | #include <linux/netdevice.h> |
diff --git a/net/ax25/ax25_subr.c b/net/ax25/ax25_subr.c index 034aa10a5198..c6715ee4ab8f 100644 --- a/net/ax25/ax25_subr.c +++ b/net/ax25/ax25_subr.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/string.h> | 18 | #include <linux/string.h> |
| 19 | #include <linux/sockios.h> | 19 | #include <linux/sockios.h> |
| 20 | #include <linux/net.h> | 20 | #include <linux/net.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | #include <net/ax25.h> | 22 | #include <net/ax25.h> |
| 22 | #include <linux/inet.h> | 23 | #include <linux/inet.h> |
| 23 | #include <linux/netdevice.h> | 24 | #include <linux/netdevice.h> |
diff --git a/net/ax25/ax25_uid.c b/net/ax25/ax25_uid.c index 9f13f6eefcba..d349be9578f5 100644 --- a/net/ax25/ax25_uid.c +++ b/net/ax25/ax25_uid.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/sockios.h> | 18 | #include <linux/sockios.h> |
| 19 | #include <linux/net.h> | 19 | #include <linux/net.h> |
| 20 | #include <linux/spinlock.h> | 20 | #include <linux/spinlock.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | #include <net/ax25.h> | 22 | #include <net/ax25.h> |
| 22 | #include <linux/inet.h> | 23 | #include <linux/inet.h> |
| 23 | #include <linux/netdevice.h> | 24 | #include <linux/netdevice.h> |
diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c index 5159be6b2625..ebe0ef3f1d83 100644 --- a/net/ax25/sysctl_net_ax25.c +++ b/net/ax25/sysctl_net_ax25.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | * Copyright (C) 1996 Mike Shaver (shaver@zeroknowledge.com) | 7 | * Copyright (C) 1996 Mike Shaver (shaver@zeroknowledge.com) |
| 8 | */ | 8 | */ |
| 9 | #include <linux/mm.h> | 9 | #include <linux/mm.h> |
| 10 | #include <linux/slab.h> | ||
| 10 | #include <linux/sysctl.h> | 11 | #include <linux/sysctl.h> |
| 11 | #include <linux/spinlock.h> | 12 | #include <linux/spinlock.h> |
| 12 | #include <net/ax25.h> | 13 | #include <net/ax25.h> |
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index 087cc51f5927..404a8500fd03 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c | |||
| @@ -31,7 +31,6 @@ | |||
| 31 | #include <linux/errno.h> | 31 | #include <linux/errno.h> |
| 32 | #include <linux/kernel.h> | 32 | #include <linux/kernel.h> |
| 33 | #include <linux/sched.h> | 33 | #include <linux/sched.h> |
| 34 | #include <linux/slab.h> | ||
| 35 | #include <linux/skbuff.h> | 34 | #include <linux/skbuff.h> |
| 36 | #include <linux/init.h> | 35 | #include <linux/init.h> |
| 37 | #include <linux/poll.h> | 36 | #include <linux/poll.h> |
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c index ef09c7b3a858..8062dad6d10d 100644 --- a/net/bluetooth/bnep/core.c +++ b/net/bluetooth/bnep/core.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #include <linux/freezer.h> | 35 | #include <linux/freezer.h> |
| 36 | #include <linux/errno.h> | 36 | #include <linux/errno.h> |
| 37 | #include <linux/net.h> | 37 | #include <linux/net.h> |
| 38 | #include <linux/slab.h> | ||
| 38 | #include <net/sock.h> | 39 | #include <net/sock.h> |
| 39 | 40 | ||
| 40 | #include <linux/socket.h> | 41 | #include <linux/socket.h> |
diff --git a/net/bluetooth/bnep/netdev.c b/net/bluetooth/bnep/netdev.c index b6234b73c4cf..5643a2391e76 100644 --- a/net/bluetooth/bnep/netdev.c +++ b/net/bluetooth/bnep/netdev.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | */ | 26 | */ |
| 27 | 27 | ||
| 28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
| 29 | #include <linux/slab.h> | ||
| 29 | 30 | ||
| 30 | #include <linux/socket.h> | 31 | #include <linux/socket.h> |
| 31 | #include <linux/netdevice.h> | 32 | #include <linux/netdevice.h> |
diff --git a/net/bluetooth/bnep/sock.c b/net/bluetooth/bnep/sock.c index 2ff6ac7b2ed4..2862f53b66b1 100644 --- a/net/bluetooth/bnep/sock.c +++ b/net/bluetooth/bnep/sock.c | |||
| @@ -30,7 +30,6 @@ | |||
| 30 | #include <linux/capability.h> | 30 | #include <linux/capability.h> |
| 31 | #include <linux/errno.h> | 31 | #include <linux/errno.h> |
| 32 | #include <linux/kernel.h> | 32 | #include <linux/kernel.h> |
| 33 | #include <linux/slab.h> | ||
| 34 | #include <linux/poll.h> | 33 | #include <linux/poll.h> |
| 35 | #include <linux/fcntl.h> | 34 | #include <linux/fcntl.h> |
| 36 | #include <linux/skbuff.h> | 35 | #include <linux/skbuff.h> |
| @@ -39,6 +38,7 @@ | |||
| 39 | #include <linux/file.h> | 38 | #include <linux/file.h> |
| 40 | #include <linux/init.h> | 39 | #include <linux/init.h> |
| 41 | #include <linux/compat.h> | 40 | #include <linux/compat.h> |
| 41 | #include <linux/gfp.h> | ||
| 42 | #include <net/sock.h> | 42 | #include <net/sock.h> |
| 43 | 43 | ||
| 44 | #include <asm/system.h> | 44 | #include <asm/system.h> |
diff --git a/net/bluetooth/cmtp/sock.c b/net/bluetooth/cmtp/sock.c index 978cc3a718ad..7ea1979a8e4f 100644 --- a/net/bluetooth/cmtp/sock.c +++ b/net/bluetooth/cmtp/sock.c | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | #include <linux/capability.h> | 26 | #include <linux/capability.h> |
| 27 | #include <linux/errno.h> | 27 | #include <linux/errno.h> |
| 28 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
| 29 | #include <linux/slab.h> | ||
| 30 | #include <linux/poll.h> | 29 | #include <linux/poll.h> |
| 31 | #include <linux/fcntl.h> | 30 | #include <linux/fcntl.h> |
| 32 | #include <linux/skbuff.h> | 31 | #include <linux/skbuff.h> |
| @@ -34,6 +33,7 @@ | |||
| 34 | #include <linux/ioctl.h> | 33 | #include <linux/ioctl.h> |
| 35 | #include <linux/file.h> | 34 | #include <linux/file.h> |
| 36 | #include <linux/compat.h> | 35 | #include <linux/compat.h> |
| 36 | #include <linux/gfp.h> | ||
| 37 | #include <net/sock.h> | 37 | #include <net/sock.h> |
| 38 | 38 | ||
| 39 | #include <linux/isdn/capilli.h> | 39 | #include <linux/isdn/capilli.h> |
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c index 1a79a6c7e30e..0e8e1a59856c 100644 --- a/net/bluetooth/hci_sysfs.c +++ b/net/bluetooth/hci_sysfs.c | |||
| @@ -1,14 +1,15 @@ | |||
| 1 | /* Bluetooth HCI driver model support. */ | 1 | /* Bluetooth HCI driver model support. */ |
| 2 | 2 | ||
| 3 | #include <linux/kernel.h> | 3 | #include <linux/kernel.h> |
| 4 | #include <linux/slab.h> | ||
| 4 | #include <linux/init.h> | 5 | #include <linux/init.h> |
| 5 | #include <linux/debugfs.h> | 6 | #include <linux/debugfs.h> |
| 7 | #include <linux/seq_file.h> | ||
| 6 | 8 | ||
| 7 | #include <net/bluetooth/bluetooth.h> | 9 | #include <net/bluetooth/bluetooth.h> |
| 8 | #include <net/bluetooth/hci_core.h> | 10 | #include <net/bluetooth/hci_core.h> |
| 9 | 11 | ||
| 10 | struct class *bt_class = NULL; | 12 | static struct class *bt_class; |
| 11 | EXPORT_SYMBOL_GPL(bt_class); | ||
| 12 | 13 | ||
| 13 | struct dentry *bt_debugfs = NULL; | 14 | struct dentry *bt_debugfs = NULL; |
| 14 | EXPORT_SYMBOL_GPL(bt_debugfs); | 15 | EXPORT_SYMBOL_GPL(bt_debugfs); |
| @@ -405,20 +406,11 @@ static struct device_type bt_host = { | |||
| 405 | .release = bt_host_release, | 406 | .release = bt_host_release, |
| 406 | }; | 407 | }; |
| 407 | 408 | ||
| 408 | static int inquiry_cache_open(struct inode *inode, struct file *file) | 409 | static int inquiry_cache_show(struct seq_file *f, void *p) |
| 409 | { | ||
| 410 | file->private_data = inode->i_private; | ||
| 411 | return 0; | ||
| 412 | } | ||
| 413 | |||
| 414 | static ssize_t inquiry_cache_read(struct file *file, char __user *userbuf, | ||
| 415 | size_t count, loff_t *ppos) | ||
| 416 | { | 410 | { |
| 417 | struct hci_dev *hdev = file->private_data; | 411 | struct hci_dev *hdev = f->private; |
| 418 | struct inquiry_cache *cache = &hdev->inq_cache; | 412 | struct inquiry_cache *cache = &hdev->inq_cache; |
| 419 | struct inquiry_entry *e; | 413 | struct inquiry_entry *e; |
| 420 | char buf[4096]; | ||
| 421 | int n = 0; | ||
| 422 | 414 | ||
| 423 | hci_dev_lock_bh(hdev); | 415 | hci_dev_lock_bh(hdev); |
| 424 | 416 | ||
| @@ -426,23 +418,30 @@ static ssize_t inquiry_cache_read(struct file *file, char __user *userbuf, | |||
| 426 | struct inquiry_data *data = &e->data; | 418 | struct inquiry_data *data = &e->data; |
| 427 | bdaddr_t bdaddr; | 419 | bdaddr_t bdaddr; |
| 428 | baswap(&bdaddr, &data->bdaddr); | 420 | baswap(&bdaddr, &data->bdaddr); |
| 429 | n += sprintf(buf + n, "%s %d %d %d 0x%.2x%.2x%.2x 0x%.4x %d %d %u\n", | 421 | seq_printf(f, "%s %d %d %d 0x%.2x%.2x%.2x 0x%.4x %d %d %u\n", |
| 430 | batostr(&bdaddr), | 422 | batostr(&bdaddr), |
| 431 | data->pscan_rep_mode, data->pscan_period_mode, | 423 | data->pscan_rep_mode, data->pscan_period_mode, |
| 432 | data->pscan_mode, data->dev_class[2], | 424 | data->pscan_mode, data->dev_class[2], |
| 433 | data->dev_class[1], data->dev_class[0], | 425 | data->dev_class[1], data->dev_class[0], |
| 434 | __le16_to_cpu(data->clock_offset), | 426 | __le16_to_cpu(data->clock_offset), |
| 435 | data->rssi, data->ssp_mode, e->timestamp); | 427 | data->rssi, data->ssp_mode, e->timestamp); |
| 436 | } | 428 | } |
| 437 | 429 | ||
| 438 | hci_dev_unlock_bh(hdev); | 430 | hci_dev_unlock_bh(hdev); |
| 439 | 431 | ||
| 440 | return simple_read_from_buffer(userbuf, count, ppos, buf, n); | 432 | return 0; |
| 433 | } | ||
| 434 | |||
| 435 | static int inquiry_cache_open(struct inode *inode, struct file *file) | ||
| 436 | { | ||
| 437 | return single_open(file, inquiry_cache_show, inode->i_private); | ||
| 441 | } | 438 | } |
| 442 | 439 | ||
| 443 | static const struct file_operations inquiry_cache_fops = { | 440 | static const struct file_operations inquiry_cache_fops = { |
| 444 | .open = inquiry_cache_open, | 441 | .open = inquiry_cache_open, |
| 445 | .read = inquiry_cache_read, | 442 | .read = seq_read, |
| 443 | .llseek = seq_lseek, | ||
| 444 | .release = single_release, | ||
| 446 | }; | 445 | }; |
| 447 | 446 | ||
| 448 | int hci_register_sysfs(struct hci_dev *hdev) | 447 | int hci_register_sysfs(struct hci_dev *hdev) |
diff --git a/net/bluetooth/hidp/sock.c b/net/bluetooth/hidp/sock.c index 9cfef68b9fec..250dfd46237d 100644 --- a/net/bluetooth/hidp/sock.c +++ b/net/bluetooth/hidp/sock.c | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | #include <linux/capability.h> | 26 | #include <linux/capability.h> |
| 27 | #include <linux/errno.h> | 27 | #include <linux/errno.h> |
| 28 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
| 29 | #include <linux/slab.h> | ||
| 30 | #include <linux/poll.h> | 29 | #include <linux/poll.h> |
| 31 | #include <linux/fcntl.h> | 30 | #include <linux/fcntl.h> |
| 32 | #include <linux/skbuff.h> | 31 | #include <linux/skbuff.h> |
| @@ -35,6 +34,7 @@ | |||
| 35 | #include <linux/file.h> | 34 | #include <linux/file.h> |
| 36 | #include <linux/init.h> | 35 | #include <linux/init.h> |
| 37 | #include <linux/compat.h> | 36 | #include <linux/compat.h> |
| 37 | #include <linux/gfp.h> | ||
| 38 | #include <net/sock.h> | 38 | #include <net/sock.h> |
| 39 | 39 | ||
| 40 | #include "hidp.h" | 40 | #include "hidp.h" |
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 4db7ae2fe07d..9753b690a8b3 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
| @@ -40,6 +40,8 @@ | |||
| 40 | #include <linux/skbuff.h> | 40 | #include <linux/skbuff.h> |
| 41 | #include <linux/list.h> | 41 | #include <linux/list.h> |
| 42 | #include <linux/device.h> | 42 | #include <linux/device.h> |
| 43 | #include <linux/debugfs.h> | ||
| 44 | #include <linux/seq_file.h> | ||
| 43 | #include <linux/uaccess.h> | 45 | #include <linux/uaccess.h> |
| 44 | #include <linux/crc16.h> | 46 | #include <linux/crc16.h> |
| 45 | #include <net/sock.h> | 47 | #include <net/sock.h> |
| @@ -1000,7 +1002,8 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int al | |||
| 1000 | 1002 | ||
| 1001 | BT_DBG("sk %p", sk); | 1003 | BT_DBG("sk %p", sk); |
| 1002 | 1004 | ||
| 1003 | if (!addr || addr->sa_family != AF_BLUETOOTH) | 1005 | if (!addr || alen < sizeof(addr->sa_family) || |
| 1006 | addr->sa_family != AF_BLUETOOTH) | ||
| 1004 | return -EINVAL; | 1007 | return -EINVAL; |
| 1005 | 1008 | ||
| 1006 | memset(&la, 0, sizeof(la)); | 1009 | memset(&la, 0, sizeof(la)); |
| @@ -1623,7 +1626,10 @@ static int l2cap_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct ms | |||
| 1623 | /* Connectionless channel */ | 1626 | /* Connectionless channel */ |
| 1624 | if (sk->sk_type == SOCK_DGRAM) { | 1627 | if (sk->sk_type == SOCK_DGRAM) { |
| 1625 | skb = l2cap_create_connless_pdu(sk, msg, len); | 1628 | skb = l2cap_create_connless_pdu(sk, msg, len); |
| 1626 | err = l2cap_do_send(sk, skb); | 1629 | if (IS_ERR(skb)) |
| 1630 | err = PTR_ERR(skb); | ||
| 1631 | else | ||
| 1632 | err = l2cap_do_send(sk, skb); | ||
| 1627 | goto done; | 1633 | goto done; |
| 1628 | } | 1634 | } |
| 1629 | 1635 | ||
| @@ -2830,6 +2836,11 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hdr | |||
| 2830 | int len = cmd->len - sizeof(*rsp); | 2836 | int len = cmd->len - sizeof(*rsp); |
| 2831 | char req[64]; | 2837 | char req[64]; |
| 2832 | 2838 | ||
| 2839 | if (len > sizeof(req) - sizeof(struct l2cap_conf_req)) { | ||
| 2840 | l2cap_send_disconn_req(conn, sk); | ||
| 2841 | goto done; | ||
| 2842 | } | ||
| 2843 | |||
| 2833 | /* throw out any old stored conf requests */ | 2844 | /* throw out any old stored conf requests */ |
| 2834 | result = L2CAP_CONF_SUCCESS; | 2845 | result = L2CAP_CONF_SUCCESS; |
| 2835 | len = l2cap_parse_conf_rsp(sk, rsp->data, | 2846 | len = l2cap_parse_conf_rsp(sk, rsp->data, |
| @@ -3937,31 +3948,42 @@ drop: | |||
| 3937 | return 0; | 3948 | return 0; |
| 3938 | } | 3949 | } |
| 3939 | 3950 | ||
| 3940 | static ssize_t l2cap_sysfs_show(struct class *dev, | 3951 | static int l2cap_debugfs_show(struct seq_file *f, void *p) |
| 3941 | struct class_attribute *attr, | ||
| 3942 | char *buf) | ||
| 3943 | { | 3952 | { |
| 3944 | struct sock *sk; | 3953 | struct sock *sk; |
| 3945 | struct hlist_node *node; | 3954 | struct hlist_node *node; |
| 3946 | char *str = buf; | ||
| 3947 | 3955 | ||
| 3948 | read_lock_bh(&l2cap_sk_list.lock); | 3956 | read_lock_bh(&l2cap_sk_list.lock); |
| 3949 | 3957 | ||
| 3950 | sk_for_each(sk, node, &l2cap_sk_list.head) { | 3958 | sk_for_each(sk, node, &l2cap_sk_list.head) { |
| 3951 | struct l2cap_pinfo *pi = l2cap_pi(sk); | 3959 | struct l2cap_pinfo *pi = l2cap_pi(sk); |
| 3952 | 3960 | ||
| 3953 | str += sprintf(str, "%s %s %d %d 0x%4.4x 0x%4.4x %d %d %d\n", | 3961 | seq_printf(f, "%s %s %d %d 0x%4.4x 0x%4.4x %d %d %d\n", |
| 3954 | batostr(&bt_sk(sk)->src), batostr(&bt_sk(sk)->dst), | 3962 | batostr(&bt_sk(sk)->src), |
| 3955 | sk->sk_state, __le16_to_cpu(pi->psm), pi->scid, | 3963 | batostr(&bt_sk(sk)->dst), |
| 3956 | pi->dcid, pi->imtu, pi->omtu, pi->sec_level); | 3964 | sk->sk_state, __le16_to_cpu(pi->psm), |
| 3965 | pi->scid, pi->dcid, | ||
| 3966 | pi->imtu, pi->omtu, pi->sec_level); | ||
| 3957 | } | 3967 | } |
| 3958 | 3968 | ||
| 3959 | read_unlock_bh(&l2cap_sk_list.lock); | 3969 | read_unlock_bh(&l2cap_sk_list.lock); |
| 3960 | 3970 | ||
| 3961 | return str - buf; | 3971 | return 0; |
| 3962 | } | 3972 | } |
| 3963 | 3973 | ||
| 3964 | static CLASS_ATTR(l2cap, S_IRUGO, l2cap_sysfs_show, NULL); | 3974 | static int l2cap_debugfs_open(struct inode *inode, struct file *file) |
| 3975 | { | ||
| 3976 | return single_open(file, l2cap_debugfs_show, inode->i_private); | ||
| 3977 | } | ||
| 3978 | |||
| 3979 | static const struct file_operations l2cap_debugfs_fops = { | ||
| 3980 | .open = l2cap_debugfs_open, | ||
| 3981 | .read = seq_read, | ||
| 3982 | .llseek = seq_lseek, | ||
| 3983 | .release = single_release, | ||
| 3984 | }; | ||
| 3985 | |||
| 3986 | static struct dentry *l2cap_debugfs; | ||
| 3965 | 3987 | ||
| 3966 | static const struct proto_ops l2cap_sock_ops = { | 3988 | static const struct proto_ops l2cap_sock_ops = { |
| 3967 | .family = PF_BLUETOOTH, | 3989 | .family = PF_BLUETOOTH, |
| @@ -4021,8 +4043,12 @@ static int __init l2cap_init(void) | |||
| 4021 | goto error; | 4043 | goto error; |
| 4022 | } | 4044 | } |
| 4023 | 4045 | ||
| 4024 | if (class_create_file(bt_class, &class_attr_l2cap) < 0) | 4046 | if (bt_debugfs) { |
| 4025 | BT_ERR("Failed to create L2CAP info file"); | 4047 | l2cap_debugfs = debugfs_create_file("l2cap", 0444, |
| 4048 | bt_debugfs, NULL, &l2cap_debugfs_fops); | ||
| 4049 | if (!l2cap_debugfs) | ||
| 4050 | BT_ERR("Failed to create L2CAP debug file"); | ||
| 4051 | } | ||
| 4026 | 4052 | ||
| 4027 | BT_INFO("L2CAP ver %s", VERSION); | 4053 | BT_INFO("L2CAP ver %s", VERSION); |
| 4028 | BT_INFO("L2CAP socket layer initialized"); | 4054 | BT_INFO("L2CAP socket layer initialized"); |
| @@ -4036,7 +4062,7 @@ error: | |||
| 4036 | 4062 | ||
| 4037 | static void __exit l2cap_exit(void) | 4063 | static void __exit l2cap_exit(void) |
| 4038 | { | 4064 | { |
| 4039 | class_remove_file(bt_class, &class_attr_l2cap); | 4065 | debugfs_remove(l2cap_debugfs); |
| 4040 | 4066 | ||
| 4041 | if (bt_sock_unregister(BTPROTO_L2CAP) < 0) | 4067 | if (bt_sock_unregister(BTPROTO_L2CAP) < 0) |
| 4042 | BT_ERR("L2CAP socket unregistration failed"); | 4068 | BT_ERR("L2CAP socket unregistration failed"); |
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index db8a68e1a5ba..7dca91bb8c57 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
| @@ -33,9 +33,12 @@ | |||
| 33 | #include <linux/init.h> | 33 | #include <linux/init.h> |
| 34 | #include <linux/wait.h> | 34 | #include <linux/wait.h> |
| 35 | #include <linux/device.h> | 35 | #include <linux/device.h> |
| 36 | #include <linux/debugfs.h> | ||
| 37 | #include <linux/seq_file.h> | ||
| 36 | #include <linux/net.h> | 38 | #include <linux/net.h> |
| 37 | #include <linux/mutex.h> | 39 | #include <linux/mutex.h> |
| 38 | #include <linux/kthread.h> | 40 | #include <linux/kthread.h> |
| 41 | #include <linux/slab.h> | ||
| 39 | 42 | ||
| 40 | #include <net/sock.h> | 43 | #include <net/sock.h> |
| 41 | #include <asm/uaccess.h> | 44 | #include <asm/uaccess.h> |
| @@ -2098,13 +2101,10 @@ static struct hci_cb rfcomm_cb = { | |||
| 2098 | .security_cfm = rfcomm_security_cfm | 2101 | .security_cfm = rfcomm_security_cfm |
| 2099 | }; | 2102 | }; |
| 2100 | 2103 | ||
| 2101 | static ssize_t rfcomm_dlc_sysfs_show(struct class *dev, | 2104 | static int rfcomm_dlc_debugfs_show(struct seq_file *f, void *x) |
| 2102 | struct class_attribute *attr, | ||
| 2103 | char *buf) | ||
| 2104 | { | 2105 | { |
| 2105 | struct rfcomm_session *s; | 2106 | struct rfcomm_session *s; |
| 2106 | struct list_head *pp, *p; | 2107 | struct list_head *pp, *p; |
| 2107 | char *str = buf; | ||
| 2108 | 2108 | ||
| 2109 | rfcomm_lock(); | 2109 | rfcomm_lock(); |
| 2110 | 2110 | ||
| @@ -2114,18 +2114,32 @@ static ssize_t rfcomm_dlc_sysfs_show(struct class *dev, | |||
| 2114 | struct sock *sk = s->sock->sk; | 2114 | struct sock *sk = s->sock->sk; |
| 2115 | struct rfcomm_dlc *d = list_entry(pp, struct rfcomm_dlc, list); | 2115 | struct rfcomm_dlc *d = list_entry(pp, struct rfcomm_dlc, list); |
| 2116 | 2116 | ||
| 2117 | str += sprintf(str, "%s %s %ld %d %d %d %d\n", | 2117 | seq_printf(f, "%s %s %ld %d %d %d %d\n", |
| 2118 | batostr(&bt_sk(sk)->src), batostr(&bt_sk(sk)->dst), | 2118 | batostr(&bt_sk(sk)->src), |
| 2119 | d->state, d->dlci, d->mtu, d->rx_credits, d->tx_credits); | 2119 | batostr(&bt_sk(sk)->dst), |
| 2120 | d->state, d->dlci, d->mtu, | ||
| 2121 | d->rx_credits, d->tx_credits); | ||
| 2120 | } | 2122 | } |
| 2121 | } | 2123 | } |
| 2122 | 2124 | ||
| 2123 | rfcomm_unlock(); | 2125 | rfcomm_unlock(); |
| 2124 | 2126 | ||
| 2125 | return (str - buf); | 2127 | return 0; |
| 2126 | } | 2128 | } |
| 2127 | 2129 | ||
| 2128 | static CLASS_ATTR(rfcomm_dlc, S_IRUGO, rfcomm_dlc_sysfs_show, NULL); | 2130 | static int rfcomm_dlc_debugfs_open(struct inode *inode, struct file *file) |
| 2131 | { | ||
| 2132 | return single_open(file, rfcomm_dlc_debugfs_show, inode->i_private); | ||
| 2133 | } | ||
| 2134 | |||
| 2135 | static const struct file_operations rfcomm_dlc_debugfs_fops = { | ||
| 2136 | .open = rfcomm_dlc_debugfs_open, | ||
| 2137 | .read = seq_read, | ||
| 2138 | .llseek = seq_lseek, | ||
| 2139 | .release = single_release, | ||
| 2140 | }; | ||
| 2141 | |||
| 2142 | static struct dentry *rfcomm_dlc_debugfs; | ||
| 2129 | 2143 | ||
| 2130 | /* ---- Initialization ---- */ | 2144 | /* ---- Initialization ---- */ |
| 2131 | static int __init rfcomm_init(void) | 2145 | static int __init rfcomm_init(void) |
| @@ -2142,8 +2156,12 @@ static int __init rfcomm_init(void) | |||
| 2142 | goto unregister; | 2156 | goto unregister; |
| 2143 | } | 2157 | } |
| 2144 | 2158 | ||
| 2145 | if (class_create_file(bt_class, &class_attr_rfcomm_dlc) < 0) | 2159 | if (bt_debugfs) { |
| 2146 | BT_ERR("Failed to create RFCOMM info file"); | 2160 | rfcomm_dlc_debugfs = debugfs_create_file("rfcomm_dlc", 0444, |
| 2161 | bt_debugfs, NULL, &rfcomm_dlc_debugfs_fops); | ||
| 2162 | if (!rfcomm_dlc_debugfs) | ||
| 2163 | BT_ERR("Failed to create RFCOMM debug file"); | ||
| 2164 | } | ||
| 2147 | 2165 | ||
| 2148 | err = rfcomm_init_ttys(); | 2166 | err = rfcomm_init_ttys(); |
| 2149 | if (err < 0) | 2167 | if (err < 0) |
| @@ -2171,7 +2189,7 @@ unregister: | |||
| 2171 | 2189 | ||
| 2172 | static void __exit rfcomm_exit(void) | 2190 | static void __exit rfcomm_exit(void) |
| 2173 | { | 2191 | { |
| 2174 | class_remove_file(bt_class, &class_attr_rfcomm_dlc); | 2192 | debugfs_remove(rfcomm_dlc_debugfs); |
| 2175 | 2193 | ||
| 2176 | hci_unregister_cb(&rfcomm_cb); | 2194 | hci_unregister_cb(&rfcomm_cb); |
| 2177 | 2195 | ||
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index ca87d6ac6a20..8ed3c37684fa 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c | |||
| @@ -40,6 +40,8 @@ | |||
| 40 | #include <linux/skbuff.h> | 40 | #include <linux/skbuff.h> |
| 41 | #include <linux/list.h> | 41 | #include <linux/list.h> |
| 42 | #include <linux/device.h> | 42 | #include <linux/device.h> |
| 43 | #include <linux/debugfs.h> | ||
| 44 | #include <linux/seq_file.h> | ||
| 43 | #include <net/sock.h> | 45 | #include <net/sock.h> |
| 44 | 46 | ||
| 45 | #include <asm/system.h> | 47 | #include <asm/system.h> |
| @@ -395,7 +397,8 @@ static int rfcomm_sock_connect(struct socket *sock, struct sockaddr *addr, int a | |||
| 395 | 397 | ||
| 396 | BT_DBG("sk %p", sk); | 398 | BT_DBG("sk %p", sk); |
| 397 | 399 | ||
| 398 | if (addr->sa_family != AF_BLUETOOTH || alen < sizeof(struct sockaddr_rc)) | 400 | if (alen < sizeof(struct sockaddr_rc) || |
| 401 | addr->sa_family != AF_BLUETOOTH) | ||
| 399 | return -EINVAL; | 402 | return -EINVAL; |
| 400 | 403 | ||
| 401 | lock_sock(sk); | 404 | lock_sock(sk); |
| @@ -1061,28 +1064,38 @@ done: | |||
| 1061 | return result; | 1064 | return result; |
| 1062 | } | 1065 | } |
| 1063 | 1066 | ||
| 1064 | static ssize_t rfcomm_sock_sysfs_show(struct class *dev, | 1067 | static int rfcomm_sock_debugfs_show(struct seq_file *f, void *p) |
| 1065 | struct class_attribute *attr, | ||
| 1066 | char *buf) | ||
| 1067 | { | 1068 | { |
| 1068 | struct sock *sk; | 1069 | struct sock *sk; |
| 1069 | struct hlist_node *node; | 1070 | struct hlist_node *node; |
| 1070 | char *str = buf; | ||
| 1071 | 1071 | ||
| 1072 | read_lock_bh(&rfcomm_sk_list.lock); | 1072 | read_lock_bh(&rfcomm_sk_list.lock); |
| 1073 | 1073 | ||
| 1074 | sk_for_each(sk, node, &rfcomm_sk_list.head) { | 1074 | sk_for_each(sk, node, &rfcomm_sk_list.head) { |
| 1075 | str += sprintf(str, "%s %s %d %d\n", | 1075 | seq_printf(f, "%s %s %d %d\n", |
| 1076 | batostr(&bt_sk(sk)->src), batostr(&bt_sk(sk)->dst), | 1076 | batostr(&bt_sk(sk)->src), |
| 1077 | batostr(&bt_sk(sk)->dst), | ||
| 1077 | sk->sk_state, rfcomm_pi(sk)->channel); | 1078 | sk->sk_state, rfcomm_pi(sk)->channel); |
| 1078 | } | 1079 | } |
| 1079 | 1080 | ||
| 1080 | read_unlock_bh(&rfcomm_sk_list.lock); | 1081 | read_unlock_bh(&rfcomm_sk_list.lock); |
| 1081 | 1082 | ||
| 1082 | return (str - buf); | 1083 | return 0; |
| 1083 | } | 1084 | } |
| 1084 | 1085 | ||
| 1085 | static CLASS_ATTR(rfcomm, S_IRUGO, rfcomm_sock_sysfs_show, NULL); | 1086 | static int rfcomm_sock_debugfs_open(struct inode *inode, struct file *file) |
| 1087 | { | ||
| 1088 | return single_open(file, rfcomm_sock_debugfs_show, inode->i_private); | ||
| 1089 | } | ||
| 1090 | |||
| 1091 | static const struct file_operations rfcomm_sock_debugfs_fops = { | ||
| 1092 | .open = rfcomm_sock_debugfs_open, | ||
| 1093 | .read = seq_read, | ||
| 1094 | .llseek = seq_lseek, | ||
| 1095 | .release = single_release, | ||
| 1096 | }; | ||
| 1097 | |||
| 1098 | static struct dentry *rfcomm_sock_debugfs; | ||
| 1086 | 1099 | ||
| 1087 | static const struct proto_ops rfcomm_sock_ops = { | 1100 | static const struct proto_ops rfcomm_sock_ops = { |
| 1088 | .family = PF_BLUETOOTH, | 1101 | .family = PF_BLUETOOTH, |
| @@ -1122,8 +1135,12 @@ int __init rfcomm_init_sockets(void) | |||
| 1122 | if (err < 0) | 1135 | if (err < 0) |
| 1123 | goto error; | 1136 | goto error; |
| 1124 | 1137 | ||
| 1125 | if (class_create_file(bt_class, &class_attr_rfcomm) < 0) | 1138 | if (bt_debugfs) { |
| 1126 | BT_ERR("Failed to create RFCOMM info file"); | 1139 | rfcomm_sock_debugfs = debugfs_create_file("rfcomm", 0444, |
| 1140 | bt_debugfs, NULL, &rfcomm_sock_debugfs_fops); | ||
| 1141 | if (!rfcomm_sock_debugfs) | ||
| 1142 | BT_ERR("Failed to create RFCOMM debug file"); | ||
| 1143 | } | ||
| 1127 | 1144 | ||
| 1128 | BT_INFO("RFCOMM socket layer initialized"); | 1145 | BT_INFO("RFCOMM socket layer initialized"); |
| 1129 | 1146 | ||
| @@ -1137,7 +1154,7 @@ error: | |||
| 1137 | 1154 | ||
| 1138 | void rfcomm_cleanup_sockets(void) | 1155 | void rfcomm_cleanup_sockets(void) |
| 1139 | { | 1156 | { |
| 1140 | class_remove_file(bt_class, &class_attr_rfcomm); | 1157 | debugfs_remove(rfcomm_sock_debugfs); |
| 1141 | 1158 | ||
| 1142 | if (bt_sock_unregister(BTPROTO_RFCOMM) < 0) | 1159 | if (bt_sock_unregister(BTPROTO_RFCOMM) < 0) |
| 1143 | BT_ERR("RFCOMM socket layer unregistration failed"); | 1160 | BT_ERR("RFCOMM socket layer unregistration failed"); |
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index f93b939539bc..ca6b2ad1c3fc 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
| @@ -38,6 +38,8 @@ | |||
| 38 | #include <linux/socket.h> | 38 | #include <linux/socket.h> |
| 39 | #include <linux/skbuff.h> | 39 | #include <linux/skbuff.h> |
| 40 | #include <linux/device.h> | 40 | #include <linux/device.h> |
| 41 | #include <linux/debugfs.h> | ||
| 42 | #include <linux/seq_file.h> | ||
| 41 | #include <linux/list.h> | 43 | #include <linux/list.h> |
| 42 | #include <net/sock.h> | 44 | #include <net/sock.h> |
| 43 | 45 | ||
| @@ -497,7 +499,8 @@ static int sco_sock_connect(struct socket *sock, struct sockaddr *addr, int alen | |||
| 497 | 499 | ||
| 498 | BT_DBG("sk %p", sk); | 500 | BT_DBG("sk %p", sk); |
| 499 | 501 | ||
| 500 | if (addr->sa_family != AF_BLUETOOTH || alen < sizeof(struct sockaddr_sco)) | 502 | if (alen < sizeof(struct sockaddr_sco) || |
| 503 | addr->sa_family != AF_BLUETOOTH) | ||
| 501 | return -EINVAL; | 504 | return -EINVAL; |
| 502 | 505 | ||
| 503 | if (sk->sk_state != BT_OPEN && sk->sk_state != BT_BOUND) | 506 | if (sk->sk_state != BT_OPEN && sk->sk_state != BT_BOUND) |
| @@ -953,28 +956,36 @@ drop: | |||
| 953 | return 0; | 956 | return 0; |
| 954 | } | 957 | } |
| 955 | 958 | ||
| 956 | static ssize_t sco_sysfs_show(struct class *dev, | 959 | static int sco_debugfs_show(struct seq_file *f, void *p) |
| 957 | struct class_attribute *attr, | ||
| 958 | char *buf) | ||
| 959 | { | 960 | { |
| 960 | struct sock *sk; | 961 | struct sock *sk; |
| 961 | struct hlist_node *node; | 962 | struct hlist_node *node; |
| 962 | char *str = buf; | ||
| 963 | 963 | ||
| 964 | read_lock_bh(&sco_sk_list.lock); | 964 | read_lock_bh(&sco_sk_list.lock); |
| 965 | 965 | ||
| 966 | sk_for_each(sk, node, &sco_sk_list.head) { | 966 | sk_for_each(sk, node, &sco_sk_list.head) { |
| 967 | str += sprintf(str, "%s %s %d\n", | 967 | seq_printf(f, "%s %s %d\n", batostr(&bt_sk(sk)->src), |
| 968 | batostr(&bt_sk(sk)->src), batostr(&bt_sk(sk)->dst), | 968 | batostr(&bt_sk(sk)->dst), sk->sk_state); |
| 969 | sk->sk_state); | ||
| 970 | } | 969 | } |
| 971 | 970 | ||
| 972 | read_unlock_bh(&sco_sk_list.lock); | 971 | read_unlock_bh(&sco_sk_list.lock); |
| 973 | 972 | ||
| 974 | return (str - buf); | 973 | return 0; |
| 975 | } | 974 | } |
| 976 | 975 | ||
| 977 | static CLASS_ATTR(sco, S_IRUGO, sco_sysfs_show, NULL); | 976 | static int sco_debugfs_open(struct inode *inode, struct file *file) |
| 977 | { | ||
| 978 | return single_open(file, sco_debugfs_show, inode->i_private); | ||
| 979 | } | ||
| 980 | |||
| 981 | static const struct file_operations sco_debugfs_fops = { | ||
| 982 | .open = sco_debugfs_open, | ||
| 983 | .read = seq_read, | ||
| 984 | .llseek = seq_lseek, | ||
| 985 | .release = single_release, | ||
| 986 | }; | ||
| 987 | |||
| 988 | static struct dentry *sco_debugfs; | ||
| 978 | 989 | ||
| 979 | static const struct proto_ops sco_sock_ops = { | 990 | static const struct proto_ops sco_sock_ops = { |
| 980 | .family = PF_BLUETOOTH, | 991 | .family = PF_BLUETOOTH, |
| @@ -1032,8 +1043,12 @@ static int __init sco_init(void) | |||
| 1032 | goto error; | 1043 | goto error; |
| 1033 | } | 1044 | } |
| 1034 | 1045 | ||
| 1035 | if (class_create_file(bt_class, &class_attr_sco) < 0) | 1046 | if (bt_debugfs) { |
| 1036 | BT_ERR("Failed to create SCO info file"); | 1047 | sco_debugfs = debugfs_create_file("sco", 0444, |
| 1048 | bt_debugfs, NULL, &sco_debugfs_fops); | ||
| 1049 | if (!sco_debugfs) | ||
| 1050 | BT_ERR("Failed to create SCO debug file"); | ||
| 1051 | } | ||
| 1037 | 1052 | ||
| 1038 | BT_INFO("SCO (Voice Link) ver %s", VERSION); | 1053 | BT_INFO("SCO (Voice Link) ver %s", VERSION); |
| 1039 | BT_INFO("SCO socket layer initialized"); | 1054 | BT_INFO("SCO socket layer initialized"); |
| @@ -1047,7 +1062,7 @@ error: | |||
| 1047 | 1062 | ||
| 1048 | static void __exit sco_exit(void) | 1063 | static void __exit sco_exit(void) |
| 1049 | { | 1064 | { |
| 1050 | class_remove_file(bt_class, &class_attr_sco); | 1065 | debugfs_remove(sco_debugfs); |
| 1051 | 1066 | ||
| 1052 | if (bt_sock_unregister(BTPROTO_SCO) < 0) | 1067 | if (bt_sock_unregister(BTPROTO_SCO) < 0) |
| 1053 | BT_ERR("SCO socket unregistration failed"); | 1068 | BT_ERR("SCO socket unregistration failed"); |
diff --git a/net/bridge/Kconfig b/net/bridge/Kconfig index 19a6b9629c51..d115d5cea5b6 100644 --- a/net/bridge/Kconfig +++ b/net/bridge/Kconfig | |||
| @@ -35,6 +35,7 @@ config BRIDGE | |||
| 35 | config BRIDGE_IGMP_SNOOPING | 35 | config BRIDGE_IGMP_SNOOPING |
| 36 | bool "IGMP snooping" | 36 | bool "IGMP snooping" |
| 37 | depends on BRIDGE | 37 | depends on BRIDGE |
| 38 | depends on INET | ||
| 38 | default y | 39 | default y |
| 39 | ---help--- | 40 | ---help--- |
| 40 | If you say Y here, then the Ethernet bridge will be able selectively | 41 | If you say Y here, then the Ethernet bridge will be able selectively |
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index eb7062d2e9e5..90a9024e5c1e 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c | |||
| @@ -40,7 +40,7 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 40 | goto out; | 40 | goto out; |
| 41 | 41 | ||
| 42 | mdst = br_mdb_get(br, skb); | 42 | mdst = br_mdb_get(br, skb); |
| 43 | if (mdst || BR_INPUT_SKB_CB(skb)->mrouters_only) | 43 | if (mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb)) |
| 44 | br_multicast_deliver(mdst, skb); | 44 | br_multicast_deliver(mdst, skb); |
| 45 | else | 45 | else |
| 46 | br_flood_deliver(br, skb); | 46 | br_flood_deliver(br, skb); |
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index 3b8e038ab32c..9101a4e56201 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/etherdevice.h> | 20 | #include <linux/etherdevice.h> |
| 21 | #include <linux/jhash.h> | 21 | #include <linux/jhash.h> |
| 22 | #include <linux/random.h> | 22 | #include <linux/random.h> |
| 23 | #include <linux/slab.h> | ||
| 23 | #include <asm/atomic.h> | 24 | #include <asm/atomic.h> |
| 24 | #include <asm/unaligned.h> | 25 | #include <asm/unaligned.h> |
| 25 | #include "br_private.h" | 26 | #include "br_private.h" |
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c index d61e6f741125..7a241c396981 100644 --- a/net/bridge/br_forward.c +++ b/net/bridge/br_forward.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | */ | 12 | */ |
| 13 | 13 | ||
| 14 | #include <linux/err.h> | 14 | #include <linux/err.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
| 16 | #include <linux/netdevice.h> | 17 | #include <linux/netdevice.h> |
| 17 | #include <linux/skbuff.h> | 18 | #include <linux/skbuff.h> |
| @@ -19,6 +20,11 @@ | |||
| 19 | #include <linux/netfilter_bridge.h> | 20 | #include <linux/netfilter_bridge.h> |
| 20 | #include "br_private.h" | 21 | #include "br_private.h" |
| 21 | 22 | ||
| 23 | static int deliver_clone(const struct net_bridge_port *prev, | ||
| 24 | struct sk_buff *skb, | ||
| 25 | void (*__packet_hook)(const struct net_bridge_port *p, | ||
| 26 | struct sk_buff *skb)); | ||
| 27 | |||
| 22 | /* Don't forward packets to originating port or forwarding diasabled */ | 28 | /* Don't forward packets to originating port or forwarding diasabled */ |
| 23 | static inline int should_deliver(const struct net_bridge_port *p, | 29 | static inline int should_deliver(const struct net_bridge_port *p, |
| 24 | const struct sk_buff *skb) | 30 | const struct sk_buff *skb) |
| @@ -94,17 +100,22 @@ void br_deliver(const struct net_bridge_port *to, struct sk_buff *skb) | |||
| 94 | } | 100 | } |
| 95 | 101 | ||
| 96 | /* called with rcu_read_lock */ | 102 | /* called with rcu_read_lock */ |
| 97 | void br_forward(const struct net_bridge_port *to, struct sk_buff *skb) | 103 | void br_forward(const struct net_bridge_port *to, struct sk_buff *skb, struct sk_buff *skb0) |
| 98 | { | 104 | { |
| 99 | if (should_deliver(to, skb)) { | 105 | if (should_deliver(to, skb)) { |
| 100 | __br_forward(to, skb); | 106 | if (skb0) |
| 107 | deliver_clone(to, skb, __br_forward); | ||
| 108 | else | ||
| 109 | __br_forward(to, skb); | ||
| 101 | return; | 110 | return; |
| 102 | } | 111 | } |
| 103 | 112 | ||
| 104 | kfree_skb(skb); | 113 | if (!skb0) |
| 114 | kfree_skb(skb); | ||
| 105 | } | 115 | } |
| 106 | 116 | ||
| 107 | static int deliver_clone(struct net_bridge_port *prev, struct sk_buff *skb, | 117 | static int deliver_clone(const struct net_bridge_port *prev, |
| 118 | struct sk_buff *skb, | ||
| 108 | void (*__packet_hook)(const struct net_bridge_port *p, | 119 | void (*__packet_hook)(const struct net_bridge_port *p, |
| 109 | struct sk_buff *skb)) | 120 | struct sk_buff *skb)) |
| 110 | { | 121 | { |
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index b6a3872f5681..0b6b1f2ff7ac 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
| 20 | #include <linux/rtnetlink.h> | 20 | #include <linux/rtnetlink.h> |
| 21 | #include <linux/if_ether.h> | 21 | #include <linux/if_ether.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | #include <net/sock.h> | 23 | #include <net/sock.h> |
| 23 | 24 | ||
| 24 | #include "br_private.h" | 25 | #include "br_private.h" |
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c index 53b39851d87d..a82dde2d2ead 100644 --- a/net/bridge/br_input.c +++ b/net/bridge/br_input.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | * 2 of the License, or (at your option) any later version. | 11 | * 2 of the License, or (at your option) any later version. |
| 12 | */ | 12 | */ |
| 13 | 13 | ||
| 14 | #include <linux/slab.h> | ||
| 14 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
| 15 | #include <linux/netdevice.h> | 16 | #include <linux/netdevice.h> |
| 16 | #include <linux/etherdevice.h> | 17 | #include <linux/etherdevice.h> |
| @@ -70,7 +71,7 @@ int br_handle_frame_finish(struct sk_buff *skb) | |||
| 70 | 71 | ||
| 71 | if (is_multicast_ether_addr(dest)) { | 72 | if (is_multicast_ether_addr(dest)) { |
| 72 | mdst = br_mdb_get(br, skb); | 73 | mdst = br_mdb_get(br, skb); |
| 73 | if (mdst || BR_INPUT_SKB_CB(skb)->mrouters_only) { | 74 | if (mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb)) { |
| 74 | if ((mdst && !hlist_unhashed(&mdst->mglist)) || | 75 | if ((mdst && !hlist_unhashed(&mdst->mglist)) || |
| 75 | br_multicast_is_router(br)) | 76 | br_multicast_is_router(br)) |
| 76 | skb2 = skb; | 77 | skb2 = skb; |
| @@ -90,7 +91,7 @@ int br_handle_frame_finish(struct sk_buff *skb) | |||
| 90 | 91 | ||
| 91 | if (skb) { | 92 | if (skb) { |
| 92 | if (dst) | 93 | if (dst) |
| 93 | br_forward(dst->dst, skb); | 94 | br_forward(dst->dst, skb, skb2); |
| 94 | else | 95 | else |
| 95 | br_flood_forward(br, skb, skb2); | 96 | br_flood_forward(br, skb, skb2); |
| 96 | } | 97 | } |
diff --git a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c index 2af6e4a90262..995afc4b04dc 100644 --- a/net/bridge/br_ioctl.c +++ b/net/bridge/br_ioctl.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
| 16 | #include <linux/if_bridge.h> | 16 | #include <linux/if_bridge.h> |
| 17 | #include <linux/netdevice.h> | 17 | #include <linux/netdevice.h> |
| 18 | #include <linux/slab.h> | ||
| 18 | #include <linux/times.h> | 19 | #include <linux/times.h> |
| 19 | #include <net/net_namespace.h> | 20 | #include <net/net_namespace.h> |
| 20 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 2559fb539836..eaa0e1bae49b 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
| @@ -38,7 +38,7 @@ static struct net_bridge_mdb_entry *__br_mdb_ip_get( | |||
| 38 | struct net_bridge_mdb_entry *mp; | 38 | struct net_bridge_mdb_entry *mp; |
| 39 | struct hlist_node *p; | 39 | struct hlist_node *p; |
| 40 | 40 | ||
| 41 | hlist_for_each_entry(mp, p, &mdb->mhash[hash], hlist[mdb->ver]) { | 41 | hlist_for_each_entry_rcu(mp, p, &mdb->mhash[hash], hlist[mdb->ver]) { |
| 42 | if (dst == mp->addr) | 42 | if (dst == mp->addr) |
| 43 | return mp; | 43 | return mp; |
| 44 | } | 44 | } |
| @@ -49,22 +49,23 @@ static struct net_bridge_mdb_entry *__br_mdb_ip_get( | |||
| 49 | static struct net_bridge_mdb_entry *br_mdb_ip_get( | 49 | static struct net_bridge_mdb_entry *br_mdb_ip_get( |
| 50 | struct net_bridge_mdb_htable *mdb, __be32 dst) | 50 | struct net_bridge_mdb_htable *mdb, __be32 dst) |
| 51 | { | 51 | { |
| 52 | if (!mdb) | ||
| 53 | return NULL; | ||
| 54 | |||
| 52 | return __br_mdb_ip_get(mdb, dst, br_ip_hash(mdb, dst)); | 55 | return __br_mdb_ip_get(mdb, dst, br_ip_hash(mdb, dst)); |
| 53 | } | 56 | } |
| 54 | 57 | ||
| 55 | struct net_bridge_mdb_entry *br_mdb_get(struct net_bridge *br, | 58 | struct net_bridge_mdb_entry *br_mdb_get(struct net_bridge *br, |
| 56 | struct sk_buff *skb) | 59 | struct sk_buff *skb) |
| 57 | { | 60 | { |
| 58 | struct net_bridge_mdb_htable *mdb = br->mdb; | 61 | if (br->multicast_disabled) |
| 59 | |||
| 60 | if (!mdb || br->multicast_disabled) | ||
| 61 | return NULL; | 62 | return NULL; |
| 62 | 63 | ||
| 63 | switch (skb->protocol) { | 64 | switch (skb->protocol) { |
| 64 | case htons(ETH_P_IP): | 65 | case htons(ETH_P_IP): |
| 65 | if (BR_INPUT_SKB_CB(skb)->igmp) | 66 | if (BR_INPUT_SKB_CB(skb)->igmp) |
| 66 | break; | 67 | break; |
| 67 | return br_mdb_ip_get(mdb, ip_hdr(skb)->daddr); | 68 | return br_mdb_ip_get(br->mdb, ip_hdr(skb)->daddr); |
| 68 | } | 69 | } |
| 69 | 70 | ||
| 70 | return NULL; | 71 | return NULL; |
| @@ -627,8 +628,8 @@ static void br_multicast_port_query_expired(unsigned long data) | |||
| 627 | struct net_bridge *br = port->br; | 628 | struct net_bridge *br = port->br; |
| 628 | 629 | ||
| 629 | spin_lock(&br->multicast_lock); | 630 | spin_lock(&br->multicast_lock); |
| 630 | if (port && (port->state == BR_STATE_DISABLED || | 631 | if (port->state == BR_STATE_DISABLED || |
| 631 | port->state == BR_STATE_BLOCKING)) | 632 | port->state == BR_STATE_BLOCKING) |
| 632 | goto out; | 633 | goto out; |
| 633 | 634 | ||
| 634 | if (port->multicast_startup_queries_sent < | 635 | if (port->multicast_startup_queries_sent < |
| @@ -722,11 +723,11 @@ static int br_multicast_igmp3_report(struct net_bridge *br, | |||
| 722 | if (!pskb_may_pull(skb, len)) | 723 | if (!pskb_may_pull(skb, len)) |
| 723 | return -EINVAL; | 724 | return -EINVAL; |
| 724 | 725 | ||
| 725 | grec = (void *)(skb->data + len); | 726 | grec = (void *)(skb->data + len - sizeof(*grec)); |
| 726 | group = grec->grec_mca; | 727 | group = grec->grec_mca; |
| 727 | type = grec->grec_type; | 728 | type = grec->grec_type; |
| 728 | 729 | ||
| 729 | len += grec->grec_nsrcs * 4; | 730 | len += ntohs(grec->grec_nsrcs) * 4; |
| 730 | if (!pskb_may_pull(skb, len)) | 731 | if (!pskb_may_pull(skb, len)) |
| 731 | return -EINVAL; | 732 | return -EINVAL; |
| 732 | 733 | ||
| @@ -823,6 +824,7 @@ static int br_multicast_query(struct net_bridge *br, | |||
| 823 | unsigned long max_delay; | 824 | unsigned long max_delay; |
| 824 | unsigned long now = jiffies; | 825 | unsigned long now = jiffies; |
| 825 | __be32 group; | 826 | __be32 group; |
| 827 | int err = 0; | ||
| 826 | 828 | ||
| 827 | spin_lock(&br->multicast_lock); | 829 | spin_lock(&br->multicast_lock); |
| 828 | if (!netif_running(br->dev) || | 830 | if (!netif_running(br->dev) || |
| @@ -841,15 +843,17 @@ static int br_multicast_query(struct net_bridge *br, | |||
| 841 | group = 0; | 843 | group = 0; |
| 842 | } | 844 | } |
| 843 | } else { | 845 | } else { |
| 844 | if (!pskb_may_pull(skb, sizeof(struct igmpv3_query))) | 846 | if (!pskb_may_pull(skb, sizeof(struct igmpv3_query))) { |
| 845 | return -EINVAL; | 847 | err = -EINVAL; |
| 848 | goto out; | ||
| 849 | } | ||
| 846 | 850 | ||
| 847 | ih3 = igmpv3_query_hdr(skb); | 851 | ih3 = igmpv3_query_hdr(skb); |
| 848 | if (ih3->nsrcs) | 852 | if (ih3->nsrcs) |
| 849 | return 0; | 853 | goto out; |
| 850 | 854 | ||
| 851 | max_delay = ih3->code ? 1 : | 855 | max_delay = ih3->code ? |
| 852 | IGMPV3_MRC(ih3->code) * (HZ / IGMP_TIMER_SCALE); | 856 | IGMPV3_MRC(ih3->code) * (HZ / IGMP_TIMER_SCALE) : 1; |
| 853 | } | 857 | } |
| 854 | 858 | ||
| 855 | if (!group) | 859 | if (!group) |
| @@ -876,7 +880,7 @@ static int br_multicast_query(struct net_bridge *br, | |||
| 876 | 880 | ||
| 877 | out: | 881 | out: |
| 878 | spin_unlock(&br->multicast_lock); | 882 | spin_unlock(&br->multicast_lock); |
| 879 | return 0; | 883 | return err; |
| 880 | } | 884 | } |
| 881 | 885 | ||
| 882 | static void br_multicast_leave_group(struct net_bridge *br, | 886 | static void br_multicast_leave_group(struct net_bridge *br, |
| @@ -953,9 +957,6 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br, | |||
| 953 | unsigned offset; | 957 | unsigned offset; |
| 954 | int err; | 958 | int err; |
| 955 | 959 | ||
| 956 | BR_INPUT_SKB_CB(skb)->igmp = 0; | ||
| 957 | BR_INPUT_SKB_CB(skb)->mrouters_only = 0; | ||
| 958 | |||
| 959 | /* We treat OOM as packet loss for now. */ | 960 | /* We treat OOM as packet loss for now. */ |
| 960 | if (!pskb_may_pull(skb, sizeof(*iph))) | 961 | if (!pskb_may_pull(skb, sizeof(*iph))) |
| 961 | return -EINVAL; | 962 | return -EINVAL; |
| @@ -987,7 +988,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br, | |||
| 987 | 988 | ||
| 988 | err = pskb_trim_rcsum(skb2, len); | 989 | err = pskb_trim_rcsum(skb2, len); |
| 989 | if (err) | 990 | if (err) |
| 990 | return err; | 991 | goto err_out; |
| 991 | } | 992 | } |
| 992 | 993 | ||
| 993 | len -= ip_hdrlen(skb2); | 994 | len -= ip_hdrlen(skb2); |
| @@ -1009,7 +1010,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br, | |||
| 1009 | case CHECKSUM_NONE: | 1010 | case CHECKSUM_NONE: |
| 1010 | skb2->csum = 0; | 1011 | skb2->csum = 0; |
| 1011 | if (skb_checksum_complete(skb2)) | 1012 | if (skb_checksum_complete(skb2)) |
| 1012 | return -EINVAL; | 1013 | goto out; |
| 1013 | } | 1014 | } |
| 1014 | 1015 | ||
| 1015 | err = 0; | 1016 | err = 0; |
| @@ -1036,6 +1037,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br, | |||
| 1036 | 1037 | ||
| 1037 | out: | 1038 | out: |
| 1038 | __skb_push(skb2, offset); | 1039 | __skb_push(skb2, offset); |
| 1040 | err_out: | ||
| 1039 | if (skb2 != skb) | 1041 | if (skb2 != skb) |
| 1040 | kfree_skb(skb2); | 1042 | kfree_skb(skb2); |
| 1041 | return err; | 1043 | return err; |
| @@ -1044,6 +1046,9 @@ out: | |||
| 1044 | int br_multicast_rcv(struct net_bridge *br, struct net_bridge_port *port, | 1046 | int br_multicast_rcv(struct net_bridge *br, struct net_bridge_port *port, |
| 1045 | struct sk_buff *skb) | 1047 | struct sk_buff *skb) |
| 1046 | { | 1048 | { |
| 1049 | BR_INPUT_SKB_CB(skb)->igmp = 0; | ||
| 1050 | BR_INPUT_SKB_CB(skb)->mrouters_only = 0; | ||
| 1051 | |||
| 1047 | if (br->multicast_disabled) | 1052 | if (br->multicast_disabled) |
| 1048 | return 0; | 1053 | return 0; |
| 1049 | 1054 | ||
| @@ -1135,7 +1140,7 @@ void br_multicast_stop(struct net_bridge *br) | |||
| 1135 | 1140 | ||
| 1136 | if (mdb->old) { | 1141 | if (mdb->old) { |
| 1137 | spin_unlock_bh(&br->multicast_lock); | 1142 | spin_unlock_bh(&br->multicast_lock); |
| 1138 | synchronize_rcu_bh(); | 1143 | rcu_barrier_bh(); |
| 1139 | spin_lock_bh(&br->multicast_lock); | 1144 | spin_lock_bh(&br->multicast_lock); |
| 1140 | WARN_ON(mdb->old); | 1145 | WARN_ON(mdb->old); |
| 1141 | } | 1146 | } |
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index 268e2e725888..4c4977d12fd6 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
| 25 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
| 26 | #include <linux/slab.h> | ||
| 26 | #include <linux/ip.h> | 27 | #include <linux/ip.h> |
| 27 | #include <linux/netdevice.h> | 28 | #include <linux/netdevice.h> |
| 28 | #include <linux/skbuff.h> | 29 | #include <linux/skbuff.h> |
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c index fcffb3fb1177..aa56ac2c8829 100644 --- a/net/bridge/br_netlink.c +++ b/net/bridge/br_netlink.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | */ | 11 | */ |
| 12 | 12 | ||
| 13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
| 14 | #include <linux/slab.h> | ||
| 14 | #include <net/rtnetlink.h> | 15 | #include <net/rtnetlink.h> |
| 15 | #include <net/net_namespace.h> | 16 | #include <net/net_namespace.h> |
| 16 | #include <net/sock.h> | 17 | #include <net/sock.h> |
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index fef0384e3c0b..846d7d1e2075 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
| @@ -206,12 +206,20 @@ struct net_bridge | |||
| 206 | 206 | ||
| 207 | struct br_input_skb_cb { | 207 | struct br_input_skb_cb { |
| 208 | struct net_device *brdev; | 208 | struct net_device *brdev; |
| 209 | #ifdef CONFIG_BRIDGE_IGMP_SNOOPING | ||
| 209 | int igmp; | 210 | int igmp; |
| 210 | int mrouters_only; | 211 | int mrouters_only; |
| 212 | #endif | ||
| 211 | }; | 213 | }; |
| 212 | 214 | ||
| 213 | #define BR_INPUT_SKB_CB(__skb) ((struct br_input_skb_cb *)(__skb)->cb) | 215 | #define BR_INPUT_SKB_CB(__skb) ((struct br_input_skb_cb *)(__skb)->cb) |
| 214 | 216 | ||
| 217 | #ifdef CONFIG_BRIDGE_IGMP_SNOOPING | ||
| 218 | # define BR_INPUT_SKB_CB_MROUTERS_ONLY(__skb) (BR_INPUT_SKB_CB(__skb)->mrouters_only) | ||
| 219 | #else | ||
| 220 | # define BR_INPUT_SKB_CB_MROUTERS_ONLY(__skb) (0) | ||
| 221 | #endif | ||
| 222 | |||
| 215 | extern struct notifier_block br_device_notifier; | 223 | extern struct notifier_block br_device_notifier; |
| 216 | extern const u8 br_group_address[ETH_ALEN]; | 224 | extern const u8 br_group_address[ETH_ALEN]; |
| 217 | 225 | ||
| @@ -252,7 +260,7 @@ extern void br_deliver(const struct net_bridge_port *to, | |||
| 252 | struct sk_buff *skb); | 260 | struct sk_buff *skb); |
| 253 | extern int br_dev_queue_push_xmit(struct sk_buff *skb); | 261 | extern int br_dev_queue_push_xmit(struct sk_buff *skb); |
| 254 | extern void br_forward(const struct net_bridge_port *to, | 262 | extern void br_forward(const struct net_bridge_port *to, |
| 255 | struct sk_buff *skb); | 263 | struct sk_buff *skb, struct sk_buff *skb0); |
| 256 | extern int br_forward_finish(struct sk_buff *skb); | 264 | extern int br_forward_finish(struct sk_buff *skb); |
| 257 | extern void br_flood_deliver(struct net_bridge *br, struct sk_buff *skb); | 265 | extern void br_flood_deliver(struct net_bridge *br, struct sk_buff *skb); |
| 258 | extern void br_flood_forward(struct net_bridge *br, struct sk_buff *skb, | 266 | extern void br_flood_forward(struct net_bridge *br, struct sk_buff *skb, |
diff --git a/net/bridge/br_stp_bpdu.c b/net/bridge/br_stp_bpdu.c index 81ae40b3f655..d66cce11f3bf 100644 --- a/net/bridge/br_stp_bpdu.c +++ b/net/bridge/br_stp_bpdu.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/netfilter_bridge.h> | 15 | #include <linux/netfilter_bridge.h> |
| 16 | #include <linux/etherdevice.h> | 16 | #include <linux/etherdevice.h> |
| 17 | #include <linux/llc.h> | 17 | #include <linux/llc.h> |
| 18 | #include <linux/slab.h> | ||
| 18 | #include <net/net_namespace.h> | 19 | #include <net/net_namespace.h> |
| 19 | #include <net/llc.h> | 20 | #include <net/llc.h> |
| 20 | #include <net/llc_pdu.h> | 21 | #include <net/llc_pdu.h> |
diff --git a/net/bridge/netfilter/ebt_ulog.c b/net/bridge/netfilter/ebt_ulog.c index c6ac657074a6..f9560f3dbdc7 100644 --- a/net/bridge/netfilter/ebt_ulog.c +++ b/net/bridge/netfilter/ebt_ulog.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | */ | 29 | */ |
| 30 | 30 | ||
| 31 | #include <linux/module.h> | 31 | #include <linux/module.h> |
| 32 | #include <linux/slab.h> | ||
| 32 | #include <linux/spinlock.h> | 33 | #include <linux/spinlock.h> |
| 33 | #include <linux/socket.h> | 34 | #include <linux/socket.h> |
| 34 | #include <linux/skbuff.h> | 35 | #include <linux/skbuff.h> |
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index dfb58056a89a..f0865fd1e3ec 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/netfilter_bridge/ebtables.h> | 23 | #include <linux/netfilter_bridge/ebtables.h> |
| 24 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
| 25 | #include <linux/mutex.h> | 25 | #include <linux/mutex.h> |
| 26 | #include <linux/slab.h> | ||
| 26 | #include <asm/uaccess.h> | 27 | #include <asm/uaccess.h> |
| 27 | #include <linux/smp.h> | 28 | #include <linux/smp.h> |
| 28 | #include <linux/cpumask.h> | 29 | #include <linux/cpumask.h> |
diff --git a/net/can/bcm.c b/net/can/bcm.c index e32af52238a2..907dc871fac8 100644 --- a/net/can/bcm.c +++ b/net/can/bcm.c | |||
| @@ -56,6 +56,7 @@ | |||
| 56 | #include <linux/can.h> | 56 | #include <linux/can.h> |
| 57 | #include <linux/can/core.h> | 57 | #include <linux/can/core.h> |
| 58 | #include <linux/can/bcm.h> | 58 | #include <linux/can/bcm.h> |
| 59 | #include <linux/slab.h> | ||
| 59 | #include <net/sock.h> | 60 | #include <net/sock.h> |
| 60 | #include <net/net_namespace.h> | 61 | #include <net/net_namespace.h> |
| 61 | 62 | ||
| @@ -1478,6 +1479,9 @@ static int bcm_connect(struct socket *sock, struct sockaddr *uaddr, int len, | |||
| 1478 | struct sock *sk = sock->sk; | 1479 | struct sock *sk = sock->sk; |
| 1479 | struct bcm_sock *bo = bcm_sk(sk); | 1480 | struct bcm_sock *bo = bcm_sk(sk); |
| 1480 | 1481 | ||
| 1482 | if (len < sizeof(*addr)) | ||
| 1483 | return -EINVAL; | ||
| 1484 | |||
| 1481 | if (bo->bound) | 1485 | if (bo->bound) |
| 1482 | return -EISCONN; | 1486 | return -EISCONN; |
| 1483 | 1487 | ||
diff --git a/net/can/raw.c b/net/can/raw.c index abca920440b5..da99cf153b33 100644 --- a/net/can/raw.c +++ b/net/can/raw.c | |||
| @@ -45,6 +45,7 @@ | |||
| 45 | #include <linux/init.h> | 45 | #include <linux/init.h> |
| 46 | #include <linux/uio.h> | 46 | #include <linux/uio.h> |
| 47 | #include <linux/net.h> | 47 | #include <linux/net.h> |
| 48 | #include <linux/slab.h> | ||
| 48 | #include <linux/netdevice.h> | 49 | #include <linux/netdevice.h> |
| 49 | #include <linux/socket.h> | 50 | #include <linux/socket.h> |
| 50 | #include <linux/if_arp.h> | 51 | #include <linux/if_arp.h> |
| @@ -444,7 +445,7 @@ static int raw_setsockopt(struct socket *sock, int level, int optname, | |||
| 444 | return -EFAULT; | 445 | return -EFAULT; |
| 445 | } | 446 | } |
| 446 | } else if (count == 1) { | 447 | } else if (count == 1) { |
| 447 | if (copy_from_user(&sfilter, optval, optlen)) | 448 | if (copy_from_user(&sfilter, optval, sizeof(sfilter))) |
| 448 | return -EFAULT; | 449 | return -EFAULT; |
| 449 | } | 450 | } |
| 450 | 451 | ||
diff --git a/net/compat.c b/net/compat.c index a1fb1b079a82..ec24d9edb025 100644 --- a/net/compat.c +++ b/net/compat.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | */ | 12 | */ |
| 13 | 13 | ||
| 14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
| 15 | #include <linux/gfp.h> | ||
| 15 | #include <linux/fs.h> | 16 | #include <linux/fs.h> |
| 16 | #include <linux/types.h> | 17 | #include <linux/types.h> |
| 17 | #include <linux/file.h> | 18 | #include <linux/file.h> |
diff --git a/net/core/datagram.c b/net/core/datagram.c index 95c2e0840d0d..2dccd4ee591b 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c | |||
| @@ -48,6 +48,7 @@ | |||
| 48 | #include <linux/poll.h> | 48 | #include <linux/poll.h> |
| 49 | #include <linux/highmem.h> | 49 | #include <linux/highmem.h> |
| 50 | #include <linux/spinlock.h> | 50 | #include <linux/spinlock.h> |
| 51 | #include <linux/slab.h> | ||
| 51 | 52 | ||
| 52 | #include <net/protocol.h> | 53 | #include <net/protocol.h> |
| 53 | #include <linux/skbuff.h> | 54 | #include <linux/skbuff.h> |
diff --git a/net/core/dev.c b/net/core/dev.c index bcc490cc9452..264137fce3a2 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -80,6 +80,7 @@ | |||
| 80 | #include <linux/types.h> | 80 | #include <linux/types.h> |
| 81 | #include <linux/kernel.h> | 81 | #include <linux/kernel.h> |
| 82 | #include <linux/hash.h> | 82 | #include <linux/hash.h> |
| 83 | #include <linux/slab.h> | ||
| 83 | #include <linux/sched.h> | 84 | #include <linux/sched.h> |
| 84 | #include <linux/mutex.h> | 85 | #include <linux/mutex.h> |
| 85 | #include <linux/string.h> | 86 | #include <linux/string.h> |
| @@ -1450,7 +1451,7 @@ static inline void net_timestamp(struct sk_buff *skb) | |||
| 1450 | * | 1451 | * |
| 1451 | * return values: | 1452 | * return values: |
| 1452 | * NET_RX_SUCCESS (no congestion) | 1453 | * NET_RX_SUCCESS (no congestion) |
| 1453 | * NET_RX_DROP (packet was dropped) | 1454 | * NET_RX_DROP (packet was dropped, but freed) |
| 1454 | * | 1455 | * |
| 1455 | * dev_forward_skb can be used for injecting an skb from the | 1456 | * dev_forward_skb can be used for injecting an skb from the |
| 1456 | * start_xmit function of one device into the receive queue | 1457 | * start_xmit function of one device into the receive queue |
| @@ -1464,12 +1465,11 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) | |||
| 1464 | { | 1465 | { |
| 1465 | skb_orphan(skb); | 1466 | skb_orphan(skb); |
| 1466 | 1467 | ||
| 1467 | if (!(dev->flags & IFF_UP)) | 1468 | if (!(dev->flags & IFF_UP) || |
| 1468 | return NET_RX_DROP; | 1469 | (skb->len > (dev->mtu + dev->hard_header_len))) { |
| 1469 | 1470 | kfree_skb(skb); | |
| 1470 | if (skb->len > (dev->mtu + dev->hard_header_len)) | ||
| 1471 | return NET_RX_DROP; | 1471 | return NET_RX_DROP; |
| 1472 | 1472 | } | |
| 1473 | skb_set_dev(skb, dev); | 1473 | skb_set_dev(skb, dev); |
| 1474 | skb->tstamp.tv64 = 0; | 1474 | skb->tstamp.tv64 = 0; |
| 1475 | skb->pkt_type = PACKET_HOST; | 1475 | skb->pkt_type = PACKET_HOST; |
| @@ -1988,8 +1988,12 @@ static struct netdev_queue *dev_pick_tx(struct net_device *dev, | |||
| 1988 | if (dev->real_num_tx_queues > 1) | 1988 | if (dev->real_num_tx_queues > 1) |
| 1989 | queue_index = skb_tx_hash(dev, skb); | 1989 | queue_index = skb_tx_hash(dev, skb); |
| 1990 | 1990 | ||
| 1991 | if (sk && sk->sk_dst_cache) | 1991 | if (sk) { |
| 1992 | sk_tx_queue_set(sk, queue_index); | 1992 | struct dst_entry *dst = rcu_dereference_bh(sk->sk_dst_cache); |
| 1993 | |||
| 1994 | if (dst && skb_dst(skb) == dst) | ||
| 1995 | sk_tx_queue_set(sk, queue_index); | ||
| 1996 | } | ||
| 1993 | } | 1997 | } |
| 1994 | } | 1998 | } |
| 1995 | 1999 | ||
| @@ -2483,6 +2487,7 @@ int netif_receive_skb(struct sk_buff *skb) | |||
| 2483 | { | 2487 | { |
| 2484 | struct packet_type *ptype, *pt_prev; | 2488 | struct packet_type *ptype, *pt_prev; |
| 2485 | struct net_device *orig_dev; | 2489 | struct net_device *orig_dev; |
| 2490 | struct net_device *master; | ||
| 2486 | struct net_device *null_or_orig; | 2491 | struct net_device *null_or_orig; |
| 2487 | struct net_device *null_or_bond; | 2492 | struct net_device *null_or_bond; |
| 2488 | int ret = NET_RX_DROP; | 2493 | int ret = NET_RX_DROP; |
| @@ -2503,11 +2508,12 @@ int netif_receive_skb(struct sk_buff *skb) | |||
| 2503 | 2508 | ||
| 2504 | null_or_orig = NULL; | 2509 | null_or_orig = NULL; |
| 2505 | orig_dev = skb->dev; | 2510 | orig_dev = skb->dev; |
| 2506 | if (orig_dev->master) { | 2511 | master = ACCESS_ONCE(orig_dev->master); |
| 2507 | if (skb_bond_should_drop(skb)) | 2512 | if (master) { |
| 2513 | if (skb_bond_should_drop(skb, master)) | ||
| 2508 | null_or_orig = orig_dev; /* deliver only exact match */ | 2514 | null_or_orig = orig_dev; /* deliver only exact match */ |
| 2509 | else | 2515 | else |
| 2510 | skb->dev = orig_dev->master; | 2516 | skb->dev = master; |
| 2511 | } | 2517 | } |
| 2512 | 2518 | ||
| 2513 | __get_cpu_var(netdev_rx_stat).total++; | 2519 | __get_cpu_var(netdev_rx_stat).total++; |
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c index fd91569e2394..3dc295beb483 100644 --- a/net/core/dev_mcast.c +++ b/net/core/dev_mcast.c | |||
| @@ -97,8 +97,9 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl) | |||
| 97 | 97 | ||
| 98 | netif_addr_lock_bh(dev); | 98 | netif_addr_lock_bh(dev); |
| 99 | if (alen != dev->addr_len) | 99 | if (alen != dev->addr_len) |
| 100 | return -EINVAL; | 100 | err = -EINVAL; |
| 101 | err = __dev_addr_add(&dev->mc_list, &dev->mc_count, addr, alen, glbl); | 101 | else |
| 102 | err = __dev_addr_add(&dev->mc_list, &dev->mc_count, addr, alen, glbl); | ||
| 102 | if (!err) | 103 | if (!err) |
| 103 | __dev_set_rx_mode(dev); | 104 | __dev_set_rx_mode(dev); |
| 104 | netif_addr_unlock_bh(dev); | 105 | netif_addr_unlock_bh(dev); |
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c index f8c874975350..cf208d8042b1 100644 --- a/net/core/drop_monitor.c +++ b/net/core/drop_monitor.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/percpu.h> | 21 | #include <linux/percpu.h> |
| 22 | #include <linux/timer.h> | 22 | #include <linux/timer.h> |
| 23 | #include <linux/bitops.h> | 23 | #include <linux/bitops.h> |
| 24 | #include <linux/slab.h> | ||
| 24 | #include <net/genetlink.h> | 25 | #include <net/genetlink.h> |
| 25 | #include <net/netevent.h> | 26 | #include <net/netevent.h> |
| 26 | 27 | ||
diff --git a/net/core/dst.c b/net/core/dst.c index cb1b3488b739..f307bc18f6a0 100644 --- a/net/core/dst.c +++ b/net/core/dst.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/workqueue.h> | 12 | #include <linux/workqueue.h> |
| 13 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
| 14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | #include <linux/netdevice.h> | 16 | #include <linux/netdevice.h> |
| 16 | #include <linux/skbuff.h> | 17 | #include <linux/skbuff.h> |
| 17 | #include <linux/string.h> | 18 | #include <linux/string.h> |
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 0f2f82185ec4..9d55c57f318a 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
| @@ -17,6 +17,8 @@ | |||
| 17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
| 18 | #include <linux/ethtool.h> | 18 | #include <linux/ethtool.h> |
| 19 | #include <linux/netdevice.h> | 19 | #include <linux/netdevice.h> |
| 20 | #include <linux/bitops.h> | ||
| 21 | #include <linux/slab.h> | ||
| 20 | #include <asm/uaccess.h> | 22 | #include <asm/uaccess.h> |
| 21 | 23 | ||
| 22 | /* | 24 | /* |
| @@ -199,10 +201,7 @@ static int ethtool_set_settings(struct net_device *dev, void __user *useraddr) | |||
| 199 | return dev->ethtool_ops->set_settings(dev, &cmd); | 201 | return dev->ethtool_ops->set_settings(dev, &cmd); |
| 200 | } | 202 | } |
| 201 | 203 | ||
| 202 | /* | 204 | static noinline_for_stack int ethtool_get_drvinfo(struct net_device *dev, void __user *useraddr) |
| 203 | * noinline attribute so that gcc doesnt use too much stack in dev_ethtool() | ||
| 204 | */ | ||
| 205 | static noinline int ethtool_get_drvinfo(struct net_device *dev, void __user *useraddr) | ||
| 206 | { | 205 | { |
| 207 | struct ethtool_drvinfo info; | 206 | struct ethtool_drvinfo info; |
| 208 | const struct ethtool_ops *ops = dev->ethtool_ops; | 207 | const struct ethtool_ops *ops = dev->ethtool_ops; |
| @@ -214,6 +213,10 @@ static noinline int ethtool_get_drvinfo(struct net_device *dev, void __user *use | |||
| 214 | info.cmd = ETHTOOL_GDRVINFO; | 213 | info.cmd = ETHTOOL_GDRVINFO; |
| 215 | ops->get_drvinfo(dev, &info); | 214 | ops->get_drvinfo(dev, &info); |
| 216 | 215 | ||
| 216 | /* | ||
| 217 | * this method of obtaining string set info is deprecated; | ||
| 218 | * Use ETHTOOL_GSSET_INFO instead. | ||
| 219 | */ | ||
| 217 | if (ops->get_sset_count) { | 220 | if (ops->get_sset_count) { |
| 218 | int rc; | 221 | int rc; |
| 219 | 222 | ||
| @@ -237,10 +240,67 @@ static noinline int ethtool_get_drvinfo(struct net_device *dev, void __user *use | |||
| 237 | return 0; | 240 | return 0; |
| 238 | } | 241 | } |
| 239 | 242 | ||
| 240 | /* | 243 | static noinline_for_stack int ethtool_get_sset_info(struct net_device *dev, |
| 241 | * noinline attribute so that gcc doesnt use too much stack in dev_ethtool() | 244 | void __user *useraddr) |
| 242 | */ | 245 | { |
| 243 | static noinline int ethtool_set_rxnfc(struct net_device *dev, void __user *useraddr) | 246 | struct ethtool_sset_info info; |
| 247 | const struct ethtool_ops *ops = dev->ethtool_ops; | ||
| 248 | u64 sset_mask; | ||
| 249 | int i, idx = 0, n_bits = 0, ret, rc; | ||
| 250 | u32 *info_buf = NULL; | ||
| 251 | |||
| 252 | if (!ops->get_sset_count) | ||
| 253 | return -EOPNOTSUPP; | ||
| 254 | |||
| 255 | if (copy_from_user(&info, useraddr, sizeof(info))) | ||
| 256 | return -EFAULT; | ||
| 257 | |||
| 258 | /* store copy of mask, because we zero struct later on */ | ||
| 259 | sset_mask = info.sset_mask; | ||
| 260 | if (!sset_mask) | ||
| 261 | return 0; | ||
| 262 | |||
| 263 | /* calculate size of return buffer */ | ||
| 264 | n_bits = hweight64(sset_mask); | ||
| 265 | |||
| 266 | memset(&info, 0, sizeof(info)); | ||
| 267 | info.cmd = ETHTOOL_GSSET_INFO; | ||
| 268 | |||
| 269 | info_buf = kzalloc(n_bits * sizeof(u32), GFP_USER); | ||
| 270 | if (!info_buf) | ||
| 271 | return -ENOMEM; | ||
| 272 | |||
| 273 | /* | ||
| 274 | * fill return buffer based on input bitmask and successful | ||
| 275 | * get_sset_count return | ||
| 276 | */ | ||
| 277 | for (i = 0; i < 64; i++) { | ||
| 278 | if (!(sset_mask & (1ULL << i))) | ||
| 279 | continue; | ||
| 280 | |||
| 281 | rc = ops->get_sset_count(dev, i); | ||
| 282 | if (rc >= 0) { | ||
| 283 | info.sset_mask |= (1ULL << i); | ||
| 284 | info_buf[idx++] = rc; | ||
| 285 | } | ||
| 286 | } | ||
| 287 | |||
| 288 | ret = -EFAULT; | ||
| 289 | if (copy_to_user(useraddr, &info, sizeof(info))) | ||
| 290 | goto out; | ||
| 291 | |||
| 292 | useraddr += offsetof(struct ethtool_sset_info, data); | ||
| 293 | if (copy_to_user(useraddr, info_buf, idx * sizeof(u32))) | ||
| 294 | goto out; | ||
| 295 | |||
| 296 | ret = 0; | ||
| 297 | |||
| 298 | out: | ||
| 299 | kfree(info_buf); | ||
| 300 | return ret; | ||
| 301 | } | ||
| 302 | |||
| 303 | static noinline_for_stack int ethtool_set_rxnfc(struct net_device *dev, void __user *useraddr) | ||
| 244 | { | 304 | { |
| 245 | struct ethtool_rxnfc cmd; | 305 | struct ethtool_rxnfc cmd; |
| 246 | 306 | ||
| @@ -253,10 +313,7 @@ static noinline int ethtool_set_rxnfc(struct net_device *dev, void __user *usera | |||
| 253 | return dev->ethtool_ops->set_rxnfc(dev, &cmd); | 313 | return dev->ethtool_ops->set_rxnfc(dev, &cmd); |
| 254 | } | 314 | } |
| 255 | 315 | ||
| 256 | /* | 316 | static noinline_for_stack int ethtool_get_rxnfc(struct net_device *dev, void __user *useraddr) |
| 257 | * noinline attribute so that gcc doesnt use too much stack in dev_ethtool() | ||
| 258 | */ | ||
| 259 | static noinline int ethtool_get_rxnfc(struct net_device *dev, void __user *useraddr) | ||
| 260 | { | 317 | { |
| 261 | struct ethtool_rxnfc info; | 318 | struct ethtool_rxnfc info; |
| 262 | const struct ethtool_ops *ops = dev->ethtool_ops; | 319 | const struct ethtool_ops *ops = dev->ethtool_ops; |
| @@ -328,10 +385,7 @@ static void __rx_ntuple_filter_add(struct ethtool_rx_ntuple_list *list, | |||
| 328 | list->count++; | 385 | list->count++; |
| 329 | } | 386 | } |
| 330 | 387 | ||
| 331 | /* | 388 | static noinline_for_stack int ethtool_set_rx_ntuple(struct net_device *dev, void __user *useraddr) |
| 332 | * noinline attribute so that gcc doesnt use too much stack in dev_ethtool() | ||
| 333 | */ | ||
| 334 | static noinline int ethtool_set_rx_ntuple(struct net_device *dev, void __user *useraddr) | ||
| 335 | { | 389 | { |
| 336 | struct ethtool_rx_ntuple cmd; | 390 | struct ethtool_rx_ntuple cmd; |
| 337 | const struct ethtool_ops *ops = dev->ethtool_ops; | 391 | const struct ethtool_ops *ops = dev->ethtool_ops; |
| @@ -799,10 +853,7 @@ static int ethtool_set_eeprom(struct net_device *dev, void __user *useraddr) | |||
| 799 | return ret; | 853 | return ret; |
| 800 | } | 854 | } |
| 801 | 855 | ||
| 802 | /* | 856 | static noinline_for_stack int ethtool_get_coalesce(struct net_device *dev, void __user *useraddr) |
| 803 | * noinline attribute so that gcc doesnt use too much stack in dev_ethtool() | ||
| 804 | */ | ||
| 805 | static noinline int ethtool_get_coalesce(struct net_device *dev, void __user *useraddr) | ||
| 806 | { | 857 | { |
| 807 | struct ethtool_coalesce coalesce = { .cmd = ETHTOOL_GCOALESCE }; | 858 | struct ethtool_coalesce coalesce = { .cmd = ETHTOOL_GCOALESCE }; |
| 808 | 859 | ||
| @@ -816,10 +867,7 @@ static noinline int ethtool_get_coalesce(struct net_device *dev, void __user *us | |||
| 816 | return 0; | 867 | return 0; |
| 817 | } | 868 | } |
| 818 | 869 | ||
| 819 | /* | 870 | static noinline_for_stack int ethtool_set_coalesce(struct net_device *dev, void __user *useraddr) |
| 820 | * noinline attribute so that gcc doesnt use too much stack in dev_ethtool() | ||
| 821 | */ | ||
| 822 | static noinline int ethtool_set_coalesce(struct net_device *dev, void __user *useraddr) | ||
| 823 | { | 871 | { |
| 824 | struct ethtool_coalesce coalesce; | 872 | struct ethtool_coalesce coalesce; |
| 825 | 873 | ||
| @@ -1229,10 +1277,7 @@ static int ethtool_set_value(struct net_device *dev, char __user *useraddr, | |||
| 1229 | return actor(dev, edata.data); | 1277 | return actor(dev, edata.data); |
| 1230 | } | 1278 | } |
| 1231 | 1279 | ||
| 1232 | /* | 1280 | static noinline_for_stack int ethtool_flash_device(struct net_device *dev, char __user *useraddr) |
| 1233 | * noinline attribute so that gcc doesnt use too much stack in dev_ethtool() | ||
| 1234 | */ | ||
| 1235 | static noinline int ethtool_flash_device(struct net_device *dev, char __user *useraddr) | ||
| 1236 | { | 1281 | { |
| 1237 | struct ethtool_flash efl; | 1282 | struct ethtool_flash efl; |
| 1238 | 1283 | ||
| @@ -1471,6 +1516,9 @@ int dev_ethtool(struct net *net, struct ifreq *ifr) | |||
| 1471 | case ETHTOOL_GRXNTUPLE: | 1516 | case ETHTOOL_GRXNTUPLE: |
| 1472 | rc = ethtool_get_rx_ntuple(dev, useraddr); | 1517 | rc = ethtool_get_rx_ntuple(dev, useraddr); |
| 1473 | break; | 1518 | break; |
| 1519 | case ETHTOOL_GSSET_INFO: | ||
| 1520 | rc = ethtool_get_sset_info(dev, useraddr); | ||
| 1521 | break; | ||
| 1474 | default: | 1522 | default: |
| 1475 | rc = -EOPNOTSUPP; | 1523 | rc = -EOPNOTSUPP; |
| 1476 | } | 1524 | } |
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 9a24377146bf..d2c3e7dc2e5f 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <linux/list.h> | 14 | #include <linux/list.h> |
| 14 | #include <net/net_namespace.h> | 15 | #include <net/net_namespace.h> |
| 15 | #include <net/sock.h> | 16 | #include <net/sock.h> |
diff --git a/net/core/filter.c b/net/core/filter.c index d38ef7fd50f0..ff943bed21af 100644 --- a/net/core/filter.c +++ b/net/core/filter.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/inet.h> | 25 | #include <linux/inet.h> |
| 26 | #include <linux/netdevice.h> | 26 | #include <linux/netdevice.h> |
| 27 | #include <linux/if_packet.h> | 27 | #include <linux/if_packet.h> |
| 28 | #include <linux/gfp.h> | ||
| 28 | #include <net/ip.h> | 29 | #include <net/ip.h> |
| 29 | #include <net/protocol.h> | 30 | #include <net/protocol.h> |
| 30 | #include <net/netlink.h> | 31 | #include <net/netlink.h> |
diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c index 493775f4f2f1..cf8e70392fe0 100644 --- a/net/core/gen_estimator.c +++ b/net/core/gen_estimator.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include <linux/rtnetlink.h> | 32 | #include <linux/rtnetlink.h> |
| 33 | #include <linux/init.h> | 33 | #include <linux/init.h> |
| 34 | #include <linux/rbtree.h> | 34 | #include <linux/rbtree.h> |
| 35 | #include <linux/slab.h> | ||
| 35 | #include <net/sock.h> | 36 | #include <net/sock.h> |
| 36 | #include <net/gen_stats.h> | 37 | #include <net/gen_stats.h> |
| 37 | 38 | ||
diff --git a/net/core/iovec.c b/net/core/iovec.c index 16ad45d4882b..1e7f4e91a935 100644 --- a/net/core/iovec.c +++ b/net/core/iovec.c | |||
| @@ -20,7 +20,6 @@ | |||
| 20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
| 21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
| 22 | #include <linux/mm.h> | 22 | #include <linux/mm.h> |
| 23 | #include <linux/slab.h> | ||
| 24 | #include <linux/net.h> | 23 | #include <linux/net.h> |
| 25 | #include <linux/in6.h> | 24 | #include <linux/in6.h> |
| 26 | #include <asm/uaccess.h> | 25 | #include <asm/uaccess.h> |
diff --git a/net/core/link_watch.c b/net/core/link_watch.c index 5910b555a54a..bdbce2f5875b 100644 --- a/net/core/link_watch.c +++ b/net/core/link_watch.c | |||
| @@ -19,7 +19,6 @@ | |||
| 19 | #include <linux/rtnetlink.h> | 19 | #include <linux/rtnetlink.h> |
| 20 | #include <linux/jiffies.h> | 20 | #include <linux/jiffies.h> |
| 21 | #include <linux/spinlock.h> | 21 | #include <linux/spinlock.h> |
| 22 | #include <linux/slab.h> | ||
| 23 | #include <linux/workqueue.h> | 22 | #include <linux/workqueue.h> |
| 24 | #include <linux/bitops.h> | 23 | #include <linux/bitops.h> |
| 25 | #include <asm/types.h> | 24 | #include <asm/types.h> |
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index d102f6d9abdc..bff37908bd55 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | * Harald Welte Add neighbour cache statistics like rtstat | 15 | * Harald Welte Add neighbour cache statistics like rtstat |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include <linux/slab.h> | ||
| 18 | #include <linux/types.h> | 19 | #include <linux/types.h> |
| 19 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
| 20 | #include <linux/module.h> | 21 | #include <linux/module.h> |
| @@ -771,6 +772,8 @@ static __inline__ int neigh_max_probes(struct neighbour *n) | |||
| 771 | } | 772 | } |
| 772 | 773 | ||
| 773 | static void neigh_invalidate(struct neighbour *neigh) | 774 | static void neigh_invalidate(struct neighbour *neigh) |
| 775 | __releases(neigh->lock) | ||
| 776 | __acquires(neigh->lock) | ||
| 774 | { | 777 | { |
| 775 | struct sk_buff *skb; | 778 | struct sk_buff *skb; |
| 776 | 779 | ||
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 099c753c4213..59cfc7d8fc45 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
| 14 | #include <linux/netdevice.h> | 14 | #include <linux/netdevice.h> |
| 15 | #include <linux/if_arp.h> | 15 | #include <linux/if_arp.h> |
| 16 | #include <linux/slab.h> | ||
| 16 | #include <net/sock.h> | 17 | #include <net/sock.h> |
| 17 | #include <linux/rtnetlink.h> | 18 | #include <linux/rtnetlink.h> |
| 18 | #include <linux/wireless.h> | 19 | #include <linux/wireless.h> |
diff --git a/net/core/net-traces.c b/net/core/net-traces.c index f1e982c508bb..afa6380ed88a 100644 --- a/net/core/net-traces.c +++ b/net/core/net-traces.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/workqueue.h> | 19 | #include <linux/workqueue.h> |
| 20 | #include <linux/netlink.h> | 20 | #include <linux/netlink.h> |
| 21 | #include <linux/net_dropmon.h> | 21 | #include <linux/net_dropmon.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | 23 | ||
| 23 | #include <asm/unaligned.h> | 24 | #include <asm/unaligned.h> |
| 24 | #include <asm/bitops.h> | 25 | #include <asm/bitops.h> |
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 7aa697253765..a58f59b97597 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
| 23 | #include <linux/rcupdate.h> | 23 | #include <linux/rcupdate.h> |
| 24 | #include <linux/workqueue.h> | 24 | #include <linux/workqueue.h> |
| 25 | #include <linux/slab.h> | ||
| 25 | #include <net/tcp.h> | 26 | #include <net/tcp.h> |
| 26 | #include <net/udp.h> | 27 | #include <net/udp.h> |
| 27 | #include <asm/unaligned.h> | 28 | #include <asm/unaligned.h> |
| @@ -614,7 +615,7 @@ void netpoll_print_options(struct netpoll *np) | |||
| 614 | np->name, np->local_port); | 615 | np->name, np->local_port); |
| 615 | printk(KERN_INFO "%s: local IP %pI4\n", | 616 | printk(KERN_INFO "%s: local IP %pI4\n", |
| 616 | np->name, &np->local_ip); | 617 | np->name, &np->local_ip); |
| 617 | printk(KERN_INFO "%s: interface %s\n", | 618 | printk(KERN_INFO "%s: interface '%s'\n", |
| 618 | np->name, np->dev_name); | 619 | np->name, np->dev_name); |
| 619 | printk(KERN_INFO "%s: remote port %d\n", | 620 | printk(KERN_INFO "%s: remote port %d\n", |
| 620 | np->name, np->remote_port); | 621 | np->name, np->remote_port); |
| @@ -661,6 +662,9 @@ int netpoll_parse_options(struct netpoll *np, char *opt) | |||
| 661 | if ((delim = strchr(cur, '@')) == NULL) | 662 | if ((delim = strchr(cur, '@')) == NULL) |
| 662 | goto parse_failed; | 663 | goto parse_failed; |
| 663 | *delim = 0; | 664 | *delim = 0; |
| 665 | if (*cur == ' ' || *cur == '\t') | ||
| 666 | printk(KERN_INFO "%s: warning: whitespace" | ||
| 667 | "is not allowed\n", np->name); | ||
| 664 | np->remote_port = simple_strtol(cur, NULL, 10); | 668 | np->remote_port = simple_strtol(cur, NULL, 10); |
| 665 | cur = delim; | 669 | cur = delim; |
| 666 | } | 670 | } |
| @@ -708,7 +712,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt) | |||
| 708 | return 0; | 712 | return 0; |
| 709 | 713 | ||
| 710 | parse_failed: | 714 | parse_failed: |
| 711 | printk(KERN_INFO "%s: couldn't parse config at %s!\n", | 715 | printk(KERN_INFO "%s: couldn't parse config at '%s'!\n", |
| 712 | np->name, cur); | 716 | np->name, cur); |
| 713 | return -1; | 717 | return -1; |
| 714 | } | 718 | } |
| @@ -735,7 +739,7 @@ int netpoll_setup(struct netpoll *np) | |||
| 735 | npinfo = kmalloc(sizeof(*npinfo), GFP_KERNEL); | 739 | npinfo = kmalloc(sizeof(*npinfo), GFP_KERNEL); |
| 736 | if (!npinfo) { | 740 | if (!npinfo) { |
| 737 | err = -ENOMEM; | 741 | err = -ENOMEM; |
| 738 | goto release; | 742 | goto put; |
| 739 | } | 743 | } |
| 740 | 744 | ||
| 741 | npinfo->rx_flags = 0; | 745 | npinfo->rx_flags = 0; |
| @@ -845,7 +849,7 @@ int netpoll_setup(struct netpoll *np) | |||
| 845 | 849 | ||
| 846 | kfree(npinfo); | 850 | kfree(npinfo); |
| 847 | } | 851 | } |
| 848 | 852 | put: | |
| 849 | dev_put(ndev); | 853 | dev_put(ndev); |
| 850 | return err; | 854 | return err; |
| 851 | } | 855 | } |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 4568120d8533..31e85d327aa2 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
| @@ -602,12 +602,19 @@ static void copy_rtnl_link_stats(struct rtnl_link_stats *a, | |||
| 602 | a->tx_compressed = b->tx_compressed; | 602 | a->tx_compressed = b->tx_compressed; |
| 603 | }; | 603 | }; |
| 604 | 604 | ||
| 605 | /* All VF info */ | ||
| 605 | static inline int rtnl_vfinfo_size(const struct net_device *dev) | 606 | static inline int rtnl_vfinfo_size(const struct net_device *dev) |
| 606 | { | 607 | { |
| 607 | if (dev->dev.parent && dev_is_pci(dev->dev.parent)) | 608 | if (dev->dev.parent && dev_is_pci(dev->dev.parent)) { |
| 608 | return dev_num_vf(dev->dev.parent) * | 609 | |
| 609 | sizeof(struct ifla_vf_info); | 610 | int num_vfs = dev_num_vf(dev->dev.parent); |
| 610 | else | 611 | size_t size = nlmsg_total_size(sizeof(struct nlattr)); |
| 612 | size += nlmsg_total_size(num_vfs * sizeof(struct nlattr)); | ||
| 613 | size += num_vfs * (sizeof(struct ifla_vf_mac) + | ||
| 614 | sizeof(struct ifla_vf_vlan) + | ||
| 615 | sizeof(struct ifla_vf_tx_rate)); | ||
| 616 | return size; | ||
| 617 | } else | ||
| 611 | return 0; | 618 | return 0; |
| 612 | } | 619 | } |
| 613 | 620 | ||
| @@ -629,7 +636,7 @@ static inline size_t if_nlmsg_size(const struct net_device *dev) | |||
| 629 | + nla_total_size(1) /* IFLA_OPERSTATE */ | 636 | + nla_total_size(1) /* IFLA_OPERSTATE */ |
| 630 | + nla_total_size(1) /* IFLA_LINKMODE */ | 637 | + nla_total_size(1) /* IFLA_LINKMODE */ |
| 631 | + nla_total_size(4) /* IFLA_NUM_VF */ | 638 | + nla_total_size(4) /* IFLA_NUM_VF */ |
| 632 | + nla_total_size(rtnl_vfinfo_size(dev)) /* IFLA_VFINFO */ | 639 | + rtnl_vfinfo_size(dev) /* IFLA_VFINFO_LIST */ |
| 633 | + rtnl_link_get_size(dev); /* IFLA_LINKINFO */ | 640 | + rtnl_link_get_size(dev); /* IFLA_LINKINFO */ |
| 634 | } | 641 | } |
| 635 | 642 | ||
| @@ -700,14 +707,37 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, | |||
| 700 | 707 | ||
| 701 | if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent) { | 708 | if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent) { |
| 702 | int i; | 709 | int i; |
| 703 | struct ifla_vf_info ivi; | ||
| 704 | 710 | ||
| 705 | NLA_PUT_U32(skb, IFLA_NUM_VF, dev_num_vf(dev->dev.parent)); | 711 | struct nlattr *vfinfo, *vf; |
| 706 | for (i = 0; i < dev_num_vf(dev->dev.parent); i++) { | 712 | int num_vfs = dev_num_vf(dev->dev.parent); |
| 713 | |||
| 714 | NLA_PUT_U32(skb, IFLA_NUM_VF, num_vfs); | ||
| 715 | vfinfo = nla_nest_start(skb, IFLA_VFINFO_LIST); | ||
| 716 | if (!vfinfo) | ||
| 717 | goto nla_put_failure; | ||
| 718 | for (i = 0; i < num_vfs; i++) { | ||
| 719 | struct ifla_vf_info ivi; | ||
| 720 | struct ifla_vf_mac vf_mac; | ||
| 721 | struct ifla_vf_vlan vf_vlan; | ||
| 722 | struct ifla_vf_tx_rate vf_tx_rate; | ||
| 707 | if (dev->netdev_ops->ndo_get_vf_config(dev, i, &ivi)) | 723 | if (dev->netdev_ops->ndo_get_vf_config(dev, i, &ivi)) |
| 708 | break; | 724 | break; |
| 709 | NLA_PUT(skb, IFLA_VFINFO, sizeof(ivi), &ivi); | 725 | vf_mac.vf = vf_vlan.vf = vf_tx_rate.vf = ivi.vf; |
| 726 | memcpy(vf_mac.mac, ivi.mac, sizeof(ivi.mac)); | ||
| 727 | vf_vlan.vlan = ivi.vlan; | ||
| 728 | vf_vlan.qos = ivi.qos; | ||
| 729 | vf_tx_rate.rate = ivi.tx_rate; | ||
| 730 | vf = nla_nest_start(skb, IFLA_VF_INFO); | ||
| 731 | if (!vf) { | ||
| 732 | nla_nest_cancel(skb, vfinfo); | ||
| 733 | goto nla_put_failure; | ||
| 734 | } | ||
| 735 | NLA_PUT(skb, IFLA_VF_MAC, sizeof(vf_mac), &vf_mac); | ||
| 736 | NLA_PUT(skb, IFLA_VF_VLAN, sizeof(vf_vlan), &vf_vlan); | ||
| 737 | NLA_PUT(skb, IFLA_VF_TX_RATE, sizeof(vf_tx_rate), &vf_tx_rate); | ||
| 738 | nla_nest_end(skb, vf); | ||
| 710 | } | 739 | } |
| 740 | nla_nest_end(skb, vfinfo); | ||
| 711 | } | 741 | } |
| 712 | if (dev->rtnl_link_ops) { | 742 | if (dev->rtnl_link_ops) { |
| 713 | if (rtnl_link_fill(skb, dev) < 0) | 743 | if (rtnl_link_fill(skb, dev) < 0) |
| @@ -769,12 +799,7 @@ const struct nla_policy ifla_policy[IFLA_MAX+1] = { | |||
| 769 | [IFLA_LINKINFO] = { .type = NLA_NESTED }, | 799 | [IFLA_LINKINFO] = { .type = NLA_NESTED }, |
| 770 | [IFLA_NET_NS_PID] = { .type = NLA_U32 }, | 800 | [IFLA_NET_NS_PID] = { .type = NLA_U32 }, |
| 771 | [IFLA_IFALIAS] = { .type = NLA_STRING, .len = IFALIASZ-1 }, | 801 | [IFLA_IFALIAS] = { .type = NLA_STRING, .len = IFALIASZ-1 }, |
| 772 | [IFLA_VF_MAC] = { .type = NLA_BINARY, | 802 | [IFLA_VFINFO_LIST] = {. type = NLA_NESTED }, |
| 773 | .len = sizeof(struct ifla_vf_mac) }, | ||
| 774 | [IFLA_VF_VLAN] = { .type = NLA_BINARY, | ||
| 775 | .len = sizeof(struct ifla_vf_vlan) }, | ||
| 776 | [IFLA_VF_TX_RATE] = { .type = NLA_BINARY, | ||
| 777 | .len = sizeof(struct ifla_vf_tx_rate) }, | ||
| 778 | }; | 803 | }; |
| 779 | EXPORT_SYMBOL(ifla_policy); | 804 | EXPORT_SYMBOL(ifla_policy); |
| 780 | 805 | ||
| @@ -783,6 +808,19 @@ static const struct nla_policy ifla_info_policy[IFLA_INFO_MAX+1] = { | |||
| 783 | [IFLA_INFO_DATA] = { .type = NLA_NESTED }, | 808 | [IFLA_INFO_DATA] = { .type = NLA_NESTED }, |
| 784 | }; | 809 | }; |
| 785 | 810 | ||
| 811 | static const struct nla_policy ifla_vfinfo_policy[IFLA_VF_INFO_MAX+1] = { | ||
| 812 | [IFLA_VF_INFO] = { .type = NLA_NESTED }, | ||
| 813 | }; | ||
| 814 | |||
| 815 | static const struct nla_policy ifla_vf_policy[IFLA_VF_MAX+1] = { | ||
| 816 | [IFLA_VF_MAC] = { .type = NLA_BINARY, | ||
| 817 | .len = sizeof(struct ifla_vf_mac) }, | ||
| 818 | [IFLA_VF_VLAN] = { .type = NLA_BINARY, | ||
| 819 | .len = sizeof(struct ifla_vf_vlan) }, | ||
| 820 | [IFLA_VF_TX_RATE] = { .type = NLA_BINARY, | ||
| 821 | .len = sizeof(struct ifla_vf_tx_rate) }, | ||
| 822 | }; | ||
| 823 | |||
| 786 | struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]) | 824 | struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]) |
| 787 | { | 825 | { |
| 788 | struct net *net; | 826 | struct net *net; |
| @@ -812,6 +850,52 @@ static int validate_linkmsg(struct net_device *dev, struct nlattr *tb[]) | |||
| 812 | return 0; | 850 | return 0; |
| 813 | } | 851 | } |
| 814 | 852 | ||
| 853 | static int do_setvfinfo(struct net_device *dev, struct nlattr *attr) | ||
| 854 | { | ||
| 855 | int rem, err = -EINVAL; | ||
| 856 | struct nlattr *vf; | ||
| 857 | const struct net_device_ops *ops = dev->netdev_ops; | ||
| 858 | |||
| 859 | nla_for_each_nested(vf, attr, rem) { | ||
| 860 | switch (nla_type(vf)) { | ||
| 861 | case IFLA_VF_MAC: { | ||
| 862 | struct ifla_vf_mac *ivm; | ||
| 863 | ivm = nla_data(vf); | ||
| 864 | err = -EOPNOTSUPP; | ||
| 865 | if (ops->ndo_set_vf_mac) | ||
| 866 | err = ops->ndo_set_vf_mac(dev, ivm->vf, | ||
| 867 | ivm->mac); | ||
| 868 | break; | ||
| 869 | } | ||
| 870 | case IFLA_VF_VLAN: { | ||
| 871 | struct ifla_vf_vlan *ivv; | ||
| 872 | ivv = nla_data(vf); | ||
| 873 | err = -EOPNOTSUPP; | ||
| 874 | if (ops->ndo_set_vf_vlan) | ||
| 875 | err = ops->ndo_set_vf_vlan(dev, ivv->vf, | ||
| 876 | ivv->vlan, | ||
| 877 | ivv->qos); | ||
| 878 | break; | ||
| 879 | } | ||
| 880 | case IFLA_VF_TX_RATE: { | ||
| 881 | struct ifla_vf_tx_rate *ivt; | ||
| 882 | ivt = nla_data(vf); | ||
| 883 | err = -EOPNOTSUPP; | ||
| 884 | if (ops->ndo_set_vf_tx_rate) | ||
| 885 | err = ops->ndo_set_vf_tx_rate(dev, ivt->vf, | ||
| 886 | ivt->rate); | ||
| 887 | break; | ||
| 888 | } | ||
| 889 | default: | ||
| 890 | err = -EINVAL; | ||
| 891 | break; | ||
| 892 | } | ||
| 893 | if (err) | ||
| 894 | break; | ||
| 895 | } | ||
| 896 | return err; | ||
| 897 | } | ||
| 898 | |||
| 815 | static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm, | 899 | static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm, |
| 816 | struct nlattr **tb, char *ifname, int modified) | 900 | struct nlattr **tb, char *ifname, int modified) |
| 817 | { | 901 | { |
| @@ -942,40 +1026,17 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm, | |||
| 942 | write_unlock_bh(&dev_base_lock); | 1026 | write_unlock_bh(&dev_base_lock); |
| 943 | } | 1027 | } |
| 944 | 1028 | ||
| 945 | if (tb[IFLA_VF_MAC]) { | 1029 | if (tb[IFLA_VFINFO_LIST]) { |
| 946 | struct ifla_vf_mac *ivm; | 1030 | struct nlattr *attr; |
| 947 | ivm = nla_data(tb[IFLA_VF_MAC]); | 1031 | int rem; |
| 948 | err = -EOPNOTSUPP; | 1032 | nla_for_each_nested(attr, tb[IFLA_VFINFO_LIST], rem) { |
| 949 | if (ops->ndo_set_vf_mac) | 1033 | if (nla_type(attr) != IFLA_VF_INFO) |
| 950 | err = ops->ndo_set_vf_mac(dev, ivm->vf, ivm->mac); | 1034 | goto errout; |
| 951 | if (err < 0) | 1035 | err = do_setvfinfo(dev, attr); |
| 952 | goto errout; | 1036 | if (err < 0) |
| 953 | modified = 1; | 1037 | goto errout; |
| 954 | } | 1038 | modified = 1; |
| 955 | 1039 | } | |
| 956 | if (tb[IFLA_VF_VLAN]) { | ||
| 957 | struct ifla_vf_vlan *ivv; | ||
| 958 | ivv = nla_data(tb[IFLA_VF_VLAN]); | ||
| 959 | err = -EOPNOTSUPP; | ||
| 960 | if (ops->ndo_set_vf_vlan) | ||
| 961 | err = ops->ndo_set_vf_vlan(dev, ivv->vf, | ||
| 962 | ivv->vlan, | ||
| 963 | ivv->qos); | ||
| 964 | if (err < 0) | ||
| 965 | goto errout; | ||
| 966 | modified = 1; | ||
| 967 | } | ||
| 968 | err = 0; | ||
| 969 | |||
| 970 | if (tb[IFLA_VF_TX_RATE]) { | ||
| 971 | struct ifla_vf_tx_rate *ivt; | ||
| 972 | ivt = nla_data(tb[IFLA_VF_TX_RATE]); | ||
| 973 | err = -EOPNOTSUPP; | ||
| 974 | if (ops->ndo_set_vf_tx_rate) | ||
| 975 | err = ops->ndo_set_vf_tx_rate(dev, ivt->vf, ivt->rate); | ||
| 976 | if (err < 0) | ||
| 977 | goto errout; | ||
| 978 | modified = 1; | ||
| 979 | } | 1040 | } |
| 980 | err = 0; | 1041 | err = 0; |
| 981 | 1042 | ||
| @@ -1270,10 +1331,11 @@ replay: | |||
| 1270 | err = ops->newlink(net, dev, tb, data); | 1331 | err = ops->newlink(net, dev, tb, data); |
| 1271 | else | 1332 | else |
| 1272 | err = register_netdevice(dev); | 1333 | err = register_netdevice(dev); |
| 1273 | if (err < 0 && !IS_ERR(dev)) { | 1334 | |
| 1335 | if (err < 0 && !IS_ERR(dev)) | ||
| 1274 | free_netdev(dev); | 1336 | free_netdev(dev); |
| 1337 | if (err < 0) | ||
| 1275 | goto out; | 1338 | goto out; |
| 1276 | } | ||
| 1277 | 1339 | ||
| 1278 | err = rtnl_configure_link(dev, ifm); | 1340 | err = rtnl_configure_link(dev, ifm); |
| 1279 | if (err < 0) | 1341 | if (err < 0) |
diff --git a/net/core/scm.c b/net/core/scm.c index 9b264634acfd..b88f6f9d0b97 100644 --- a/net/core/scm.c +++ b/net/core/scm.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/security.h> | 26 | #include <linux/security.h> |
| 27 | #include <linux/pid.h> | 27 | #include <linux/pid.h> |
| 28 | #include <linux/nsproxy.h> | 28 | #include <linux/nsproxy.h> |
| 29 | #include <linux/slab.h> | ||
| 29 | 30 | ||
| 30 | #include <asm/system.h> | 31 | #include <asm/system.h> |
| 31 | #include <asm/uaccess.h> | 32 | #include <asm/uaccess.h> |
diff --git a/net/core/sock.c b/net/core/sock.c index fcd397a762ff..c5812bbc2cc9 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
| @@ -340,8 +340,12 @@ int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested) | |||
| 340 | rc = sk_backlog_rcv(sk, skb); | 340 | rc = sk_backlog_rcv(sk, skb); |
| 341 | 341 | ||
| 342 | mutex_release(&sk->sk_lock.dep_map, 1, _RET_IP_); | 342 | mutex_release(&sk->sk_lock.dep_map, 1, _RET_IP_); |
| 343 | } else | 343 | } else if (sk_add_backlog(sk, skb)) { |
| 344 | sk_add_backlog(sk, skb); | 344 | bh_unlock_sock(sk); |
| 345 | atomic_inc(&sk->sk_drops); | ||
| 346 | goto discard_and_relse; | ||
| 347 | } | ||
| 348 | |||
| 345 | bh_unlock_sock(sk); | 349 | bh_unlock_sock(sk); |
| 346 | out: | 350 | out: |
| 347 | sock_put(sk); | 351 | sock_put(sk); |
| @@ -1139,6 +1143,7 @@ struct sock *sk_clone(const struct sock *sk, const gfp_t priority) | |||
| 1139 | sock_lock_init(newsk); | 1143 | sock_lock_init(newsk); |
| 1140 | bh_lock_sock(newsk); | 1144 | bh_lock_sock(newsk); |
| 1141 | newsk->sk_backlog.head = newsk->sk_backlog.tail = NULL; | 1145 | newsk->sk_backlog.head = newsk->sk_backlog.tail = NULL; |
| 1146 | newsk->sk_backlog.len = 0; | ||
| 1142 | 1147 | ||
| 1143 | atomic_set(&newsk->sk_rmem_alloc, 0); | 1148 | atomic_set(&newsk->sk_rmem_alloc, 0); |
| 1144 | /* | 1149 | /* |
| @@ -1542,6 +1547,12 @@ static void __release_sock(struct sock *sk) | |||
| 1542 | 1547 | ||
| 1543 | bh_lock_sock(sk); | 1548 | bh_lock_sock(sk); |
| 1544 | } while ((skb = sk->sk_backlog.head) != NULL); | 1549 | } while ((skb = sk->sk_backlog.head) != NULL); |
| 1550 | |||
| 1551 | /* | ||
| 1552 | * Doing the zeroing here guarantee we can not loop forever | ||
| 1553 | * while a wild producer attempts to flood us. | ||
| 1554 | */ | ||
| 1555 | sk->sk_backlog.len = 0; | ||
| 1545 | } | 1556 | } |
| 1546 | 1557 | ||
| 1547 | /** | 1558 | /** |
| @@ -1874,6 +1885,7 @@ void sock_init_data(struct socket *sock, struct sock *sk) | |||
| 1874 | sk->sk_allocation = GFP_KERNEL; | 1885 | sk->sk_allocation = GFP_KERNEL; |
| 1875 | sk->sk_rcvbuf = sysctl_rmem_default; | 1886 | sk->sk_rcvbuf = sysctl_rmem_default; |
| 1876 | sk->sk_sndbuf = sysctl_wmem_default; | 1887 | sk->sk_sndbuf = sysctl_wmem_default; |
| 1888 | sk->sk_backlog.limit = sk->sk_rcvbuf << 1; | ||
| 1877 | sk->sk_state = TCP_CLOSE; | 1889 | sk->sk_state = TCP_CLOSE; |
| 1878 | sk_set_socket(sk, sock); | 1890 | sk_set_socket(sk, sock); |
| 1879 | 1891 | ||
| @@ -2276,7 +2288,8 @@ out_free_request_sock_slab: | |||
| 2276 | prot->rsk_prot->slab = NULL; | 2288 | prot->rsk_prot->slab = NULL; |
| 2277 | } | 2289 | } |
| 2278 | out_free_request_sock_slab_name: | 2290 | out_free_request_sock_slab_name: |
| 2279 | kfree(prot->rsk_prot->slab_name); | 2291 | if (prot->rsk_prot) |
| 2292 | kfree(prot->rsk_prot->slab_name); | ||
| 2280 | out_free_sock_slab: | 2293 | out_free_sock_slab: |
| 2281 | kmem_cache_destroy(prot->slab); | 2294 | kmem_cache_destroy(prot->slab); |
| 2282 | prot->slab = NULL; | 2295 | prot->slab = NULL; |
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c index 06124872af5b..b7b6b8208f75 100644 --- a/net/core/sysctl_net_core.c +++ b/net/core/sysctl_net_core.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/netdevice.h> | 12 | #include <linux/netdevice.h> |
| 13 | #include <linux/ratelimit.h> | 13 | #include <linux/ratelimit.h> |
| 14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | 16 | ||
| 16 | #include <net/ip.h> | 17 | #include <net/ip.h> |
| 17 | #include <net/sock.h> | 18 | #include <net/sock.h> |
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index 813e399220a7..19ac2b985485 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | #include <linux/netdevice.h> | 20 | #include <linux/netdevice.h> |
| 21 | #include <linux/netlink.h> | 21 | #include <linux/netlink.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | #include <net/netlink.h> | 23 | #include <net/netlink.h> |
| 23 | #include <net/rtnetlink.h> | 24 | #include <net/rtnetlink.h> |
| 24 | #include <linux/dcbnl.h> | 25 | #include <linux/dcbnl.h> |
diff --git a/net/dccp/ccid.c b/net/dccp/ccid.c index 49d27c556bec..36479ca61e03 100644 --- a/net/dccp/ccid.c +++ b/net/dccp/ccid.c | |||
| @@ -11,6 +11,8 @@ | |||
| 11 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
| 12 | */ | 12 | */ |
| 13 | 13 | ||
| 14 | #include <linux/slab.h> | ||
| 15 | |||
| 14 | #include "ccid.h" | 16 | #include "ccid.h" |
| 15 | #include "ccids/lib/tfrc.h" | 17 | #include "ccids/lib/tfrc.h" |
| 16 | 18 | ||
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c index a47a8c918ee8..9b3ae9922be1 100644 --- a/net/dccp/ccids/ccid2.c +++ b/net/dccp/ccids/ccid2.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | /* | 23 | /* |
| 24 | * This implementation should follow RFC 4341 | 24 | * This implementation should follow RFC 4341 |
| 25 | */ | 25 | */ |
| 26 | #include <linux/slab.h> | ||
| 26 | #include "../feat.h" | 27 | #include "../feat.h" |
| 27 | #include "../ccid.h" | 28 | #include "../ccid.h" |
| 28 | #include "../dccp.h" | 29 | #include "../dccp.h" |
diff --git a/net/dccp/feat.c b/net/dccp/feat.c index 972b8dc918d6..df7dd26cf07e 100644 --- a/net/dccp/feat.c +++ b/net/dccp/feat.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | * 2 of the License, or (at your option) any later version. | 22 | * 2 of the License, or (at your option) any later version. |
| 23 | */ | 23 | */ |
| 24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
| 25 | #include <linux/slab.h> | ||
| 25 | #include "ccid.h" | 26 | #include "ccid.h" |
| 26 | #include "feat.h" | 27 | #include "feat.h" |
| 27 | 28 | ||
diff --git a/net/dccp/input.c b/net/dccp/input.c index 7648f316310f..9ec717426024 100644 --- a/net/dccp/input.c +++ b/net/dccp/input.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | #include <linux/dccp.h> | 13 | #include <linux/dccp.h> |
| 14 | #include <linux/skbuff.h> | 14 | #include <linux/skbuff.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | 16 | ||
| 16 | #include <net/sock.h> | 17 | #include <net/sock.h> |
| 17 | 18 | ||
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index b195c4feaa0a..52ffa1cde15a 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | #include <linux/dccp.h> | 13 | #include <linux/dccp.h> |
| 14 | #include <linux/icmp.h> | 14 | #include <linux/icmp.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | #include <linux/module.h> | 16 | #include <linux/module.h> |
| 16 | #include <linux/skbuff.h> | 17 | #include <linux/skbuff.h> |
| 17 | #include <linux/random.h> | 18 | #include <linux/random.h> |
| @@ -998,11 +999,11 @@ static struct inet_protosw dccp_v4_protosw = { | |||
| 998 | 999 | ||
| 999 | static int __net_init dccp_v4_init_net(struct net *net) | 1000 | static int __net_init dccp_v4_init_net(struct net *net) |
| 1000 | { | 1001 | { |
| 1001 | int err; | 1002 | if (dccp_hashinfo.bhash == NULL) |
| 1003 | return -ESOCKTNOSUPPORT; | ||
| 1002 | 1004 | ||
| 1003 | err = inet_ctl_sock_create(&net->dccp.v4_ctl_sk, PF_INET, | 1005 | return inet_ctl_sock_create(&net->dccp.v4_ctl_sk, PF_INET, |
| 1004 | SOCK_DCCP, IPPROTO_DCCP, net); | 1006 | SOCK_DCCP, IPPROTO_DCCP, net); |
| 1005 | return err; | ||
| 1006 | } | 1007 | } |
| 1007 | 1008 | ||
| 1008 | static void __net_exit dccp_v4_exit_net(struct net *net) | 1009 | static void __net_exit dccp_v4_exit_net(struct net *net) |
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 1aec6349e858..3b11e41a2929 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 16 | #include <linux/random.h> | 16 | #include <linux/random.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | #include <linux/xfrm.h> | 18 | #include <linux/xfrm.h> |
| 18 | 19 | ||
| 19 | #include <net/addrconf.h> | 20 | #include <net/addrconf.h> |
| @@ -1191,11 +1192,11 @@ static struct inet_protosw dccp_v6_protosw = { | |||
| 1191 | 1192 | ||
| 1192 | static int __net_init dccp_v6_init_net(struct net *net) | 1193 | static int __net_init dccp_v6_init_net(struct net *net) |
| 1193 | { | 1194 | { |
| 1194 | int err; | 1195 | if (dccp_hashinfo.bhash == NULL) |
| 1196 | return -ESOCKTNOSUPPORT; | ||
| 1195 | 1197 | ||
| 1196 | err = inet_ctl_sock_create(&net->dccp.v6_ctl_sk, PF_INET6, | 1198 | return inet_ctl_sock_create(&net->dccp.v6_ctl_sk, PF_INET6, |
| 1197 | SOCK_DCCP, IPPROTO_DCCP, net); | 1199 | SOCK_DCCP, IPPROTO_DCCP, net); |
| 1198 | return err; | ||
| 1199 | } | 1200 | } |
| 1200 | 1201 | ||
| 1201 | static void __net_exit dccp_v6_exit_net(struct net *net) | 1202 | static void __net_exit dccp_v6_exit_net(struct net *net) |
diff --git a/net/dccp/minisocks.c b/net/dccp/minisocks.c index af226a063141..128b089d3aef 100644 --- a/net/dccp/minisocks.c +++ b/net/dccp/minisocks.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | */ | 11 | */ |
| 12 | 12 | ||
| 13 | #include <linux/dccp.h> | 13 | #include <linux/dccp.h> |
| 14 | #include <linux/gfp.h> | ||
| 14 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
| 15 | #include <linux/skbuff.h> | 16 | #include <linux/skbuff.h> |
| 16 | #include <linux/timer.h> | 17 | #include <linux/timer.h> |
| @@ -254,7 +255,7 @@ int dccp_child_process(struct sock *parent, struct sock *child, | |||
| 254 | * in main socket hash table and lock on listening | 255 | * in main socket hash table and lock on listening |
| 255 | * socket does not protect us more. | 256 | * socket does not protect us more. |
| 256 | */ | 257 | */ |
| 257 | sk_add_backlog(child, skb); | 258 | __sk_add_backlog(child, skb); |
| 258 | } | 259 | } |
| 259 | 260 | ||
| 260 | bh_unlock_sock(child); | 261 | bh_unlock_sock(child); |
diff --git a/net/dccp/output.c b/net/dccp/output.c index d6bb753bf6ad..fc3f436440b4 100644 --- a/net/dccp/output.c +++ b/net/dccp/output.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/dccp.h> | 13 | #include <linux/dccp.h> |
| 14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
| 15 | #include <linux/skbuff.h> | 15 | #include <linux/skbuff.h> |
| 16 | #include <linux/slab.h> | ||
| 16 | 17 | ||
| 17 | #include <net/inet_sock.h> | 18 | #include <net/inet_sock.h> |
| 18 | #include <net/sock.h> | 19 | #include <net/sock.h> |
diff --git a/net/dccp/probe.c b/net/dccp/probe.c index f5b3464f1242..078e48d442fd 100644 --- a/net/dccp/probe.c +++ b/net/dccp/probe.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
| 31 | #include <linux/kfifo.h> | 31 | #include <linux/kfifo.h> |
| 32 | #include <linux/vmalloc.h> | 32 | #include <linux/vmalloc.h> |
| 33 | #include <linux/gfp.h> | ||
| 33 | #include <net/net_namespace.h> | 34 | #include <net/net_namespace.h> |
| 34 | 35 | ||
| 35 | #include "dccp.h" | 36 | #include "dccp.h" |
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 0ef7061920c0..a0e38d8018f5 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/if_arp.h> | 20 | #include <linux/if_arp.h> |
| 21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
| 22 | #include <linux/random.h> | 22 | #include <linux/random.h> |
| 23 | #include <linux/slab.h> | ||
| 23 | #include <net/checksum.h> | 24 | #include <net/checksum.h> |
| 24 | 25 | ||
| 25 | #include <net/inet_sock.h> | 26 | #include <net/inet_sock.h> |
| @@ -1036,7 +1037,7 @@ static int __init dccp_init(void) | |||
| 1036 | FIELD_SIZEOF(struct sk_buff, cb)); | 1037 | FIELD_SIZEOF(struct sk_buff, cb)); |
| 1037 | rc = percpu_counter_init(&dccp_orphan_count, 0); | 1038 | rc = percpu_counter_init(&dccp_orphan_count, 0); |
| 1038 | if (rc) | 1039 | if (rc) |
| 1039 | goto out; | 1040 | goto out_fail; |
| 1040 | rc = -ENOBUFS; | 1041 | rc = -ENOBUFS; |
| 1041 | inet_hashinfo_init(&dccp_hashinfo); | 1042 | inet_hashinfo_init(&dccp_hashinfo); |
| 1042 | dccp_hashinfo.bind_bucket_cachep = | 1043 | dccp_hashinfo.bind_bucket_cachep = |
| @@ -1125,8 +1126,9 @@ static int __init dccp_init(void) | |||
| 1125 | goto out_sysctl_exit; | 1126 | goto out_sysctl_exit; |
| 1126 | 1127 | ||
| 1127 | dccp_timestamping_init(); | 1128 | dccp_timestamping_init(); |
| 1128 | out: | 1129 | |
| 1129 | return rc; | 1130 | return 0; |
| 1131 | |||
| 1130 | out_sysctl_exit: | 1132 | out_sysctl_exit: |
| 1131 | dccp_sysctl_exit(); | 1133 | dccp_sysctl_exit(); |
| 1132 | out_ackvec_exit: | 1134 | out_ackvec_exit: |
| @@ -1135,18 +1137,19 @@ out_free_dccp_mib: | |||
| 1135 | dccp_mib_exit(); | 1137 | dccp_mib_exit(); |
| 1136 | out_free_dccp_bhash: | 1138 | out_free_dccp_bhash: |
| 1137 | free_pages((unsigned long)dccp_hashinfo.bhash, bhash_order); | 1139 | free_pages((unsigned long)dccp_hashinfo.bhash, bhash_order); |
| 1138 | dccp_hashinfo.bhash = NULL; | ||
| 1139 | out_free_dccp_locks: | 1140 | out_free_dccp_locks: |
| 1140 | inet_ehash_locks_free(&dccp_hashinfo); | 1141 | inet_ehash_locks_free(&dccp_hashinfo); |
| 1141 | out_free_dccp_ehash: | 1142 | out_free_dccp_ehash: |
| 1142 | free_pages((unsigned long)dccp_hashinfo.ehash, ehash_order); | 1143 | free_pages((unsigned long)dccp_hashinfo.ehash, ehash_order); |
| 1143 | dccp_hashinfo.ehash = NULL; | ||
| 1144 | out_free_bind_bucket_cachep: | 1144 | out_free_bind_bucket_cachep: |
| 1145 | kmem_cache_destroy(dccp_hashinfo.bind_bucket_cachep); | 1145 | kmem_cache_destroy(dccp_hashinfo.bind_bucket_cachep); |
| 1146 | dccp_hashinfo.bind_bucket_cachep = NULL; | ||
| 1147 | out_free_percpu: | 1146 | out_free_percpu: |
| 1148 | percpu_counter_destroy(&dccp_orphan_count); | 1147 | percpu_counter_destroy(&dccp_orphan_count); |
| 1149 | goto out; | 1148 | out_fail: |
| 1149 | dccp_hashinfo.bhash = NULL; | ||
| 1150 | dccp_hashinfo.ehash = NULL; | ||
| 1151 | dccp_hashinfo.bind_bucket_cachep = NULL; | ||
| 1152 | return rc; | ||
| 1150 | } | 1153 | } |
| 1151 | 1154 | ||
| 1152 | static void __exit dccp_fini(void) | 1155 | static void __exit dccp_fini(void) |
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index 238af093495b..cead68eb254c 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
| @@ -40,6 +40,7 @@ | |||
| 40 | #include <linux/skbuff.h> | 40 | #include <linux/skbuff.h> |
| 41 | #include <linux/sysctl.h> | 41 | #include <linux/sysctl.h> |
| 42 | #include <linux/notifier.h> | 42 | #include <linux/notifier.h> |
| 43 | #include <linux/slab.h> | ||
| 43 | #include <asm/uaccess.h> | 44 | #include <asm/uaccess.h> |
| 44 | #include <asm/system.h> | 45 | #include <asm/system.h> |
| 45 | #include <net/net_namespace.h> | 46 | #include <net/net_namespace.h> |
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c index e9d48700e83a..4ab96c15166d 100644 --- a/net/decnet/dn_fib.c +++ b/net/decnet/dn_fib.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/string.h> | 20 | #include <linux/string.h> |
| 21 | #include <linux/net.h> | 21 | #include <linux/net.h> |
| 22 | #include <linux/socket.h> | 22 | #include <linux/socket.h> |
| 23 | #include <linux/slab.h> | ||
| 23 | #include <linux/sockios.h> | 24 | #include <linux/sockios.h> |
| 24 | #include <linux/init.h> | 25 | #include <linux/init.h> |
| 25 | #include <linux/skbuff.h> | 26 | #include <linux/skbuff.h> |
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c index 794b5bf95af1..deb723dba44b 100644 --- a/net/decnet/dn_neigh.c +++ b/net/decnet/dn_neigh.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
| 29 | #include <linux/socket.h> | 29 | #include <linux/socket.h> |
| 30 | #include <linux/if_arp.h> | 30 | #include <linux/if_arp.h> |
| 31 | #include <linux/slab.h> | ||
| 31 | #include <linux/if_ether.h> | 32 | #include <linux/if_ether.h> |
| 32 | #include <linux/init.h> | 33 | #include <linux/init.h> |
| 33 | #include <linux/proc_fs.h> | 34 | #include <linux/proc_fs.h> |
diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c index 932408dca86d..25a37299bc65 100644 --- a/net/decnet/dn_nsp_in.c +++ b/net/decnet/dn_nsp_in.c | |||
| @@ -57,6 +57,7 @@ | |||
| 57 | #include <linux/netdevice.h> | 57 | #include <linux/netdevice.h> |
| 58 | #include <linux/inet.h> | 58 | #include <linux/inet.h> |
| 59 | #include <linux/route.h> | 59 | #include <linux/route.h> |
| 60 | #include <linux/slab.h> | ||
| 60 | #include <net/sock.h> | 61 | #include <net/sock.h> |
| 61 | #include <net/tcp_states.h> | 62 | #include <net/tcp_states.h> |
| 62 | #include <asm/system.h> | 63 | #include <asm/system.h> |
diff --git a/net/decnet/dn_nsp_out.c b/net/decnet/dn_nsp_out.c index a65e929ce76c..baeb1eaf011b 100644 --- a/net/decnet/dn_nsp_out.c +++ b/net/decnet/dn_nsp_out.c | |||
| @@ -50,6 +50,7 @@ | |||
| 50 | #include <linux/netdevice.h> | 50 | #include <linux/netdevice.h> |
| 51 | #include <linux/inet.h> | 51 | #include <linux/inet.h> |
| 52 | #include <linux/route.h> | 52 | #include <linux/route.h> |
| 53 | #include <linux/slab.h> | ||
| 53 | #include <net/sock.h> | 54 | #include <net/sock.h> |
| 54 | #include <asm/system.h> | 55 | #include <asm/system.h> |
| 55 | #include <linux/fcntl.h> | 56 | #include <linux/fcntl.h> |
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index a7bf03ca0a36..70ebe74027d5 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c | |||
| @@ -66,6 +66,7 @@ | |||
| 66 | #include <linux/inet.h> | 66 | #include <linux/inet.h> |
| 67 | #include <linux/route.h> | 67 | #include <linux/route.h> |
| 68 | #include <linux/in_route.h> | 68 | #include <linux/in_route.h> |
| 69 | #include <linux/slab.h> | ||
| 69 | #include <net/sock.h> | 70 | #include <net/sock.h> |
| 70 | #include <linux/mm.h> | 71 | #include <linux/mm.h> |
| 71 | #include <linux/proc_fs.h> | 72 | #include <linux/proc_fs.h> |
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c index b9a33bb5e9cc..f2abd3755690 100644 --- a/net/decnet/dn_table.c +++ b/net/decnet/dn_table.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/string.h> | 15 | #include <linux/string.h> |
| 16 | #include <linux/net.h> | 16 | #include <linux/net.h> |
| 17 | #include <linux/socket.h> | 17 | #include <linux/socket.h> |
| 18 | #include <linux/slab.h> | ||
| 18 | #include <linux/sockios.h> | 19 | #include <linux/sockios.h> |
| 19 | #include <linux/init.h> | 20 | #include <linux/init.h> |
| 20 | #include <linux/skbuff.h> | 21 | #include <linux/skbuff.h> |
diff --git a/net/decnet/netfilter/dn_rtmsg.c b/net/decnet/netfilter/dn_rtmsg.c index 6d2bd3202048..64a7f39e069f 100644 --- a/net/decnet/netfilter/dn_rtmsg.c +++ b/net/decnet/netfilter/dn_rtmsg.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | */ | 14 | */ |
| 15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 16 | #include <linux/skbuff.h> | 16 | #include <linux/skbuff.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | #include <linux/init.h> | 18 | #include <linux/init.h> |
| 18 | #include <linux/netdevice.h> | 19 | #include <linux/netdevice.h> |
| 19 | #include <linux/netfilter.h> | 20 | #include <linux/netfilter.h> |
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 71489f69a42c..6112a12578b2 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/list.h> | 11 | #include <linux/list.h> |
| 12 | #include <linux/netdevice.h> | 12 | #include <linux/netdevice.h> |
| 13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
| 14 | #include <linux/slab.h> | ||
| 14 | #include <net/dsa.h> | 15 | #include <net/dsa.h> |
| 15 | #include "dsa_priv.h" | 16 | #include "dsa_priv.h" |
| 16 | 17 | ||
diff --git a/net/dsa/tag_dsa.c b/net/dsa/tag_dsa.c index cdf2d28a0297..98dfe80b4538 100644 --- a/net/dsa/tag_dsa.c +++ b/net/dsa/tag_dsa.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/etherdevice.h> | 11 | #include <linux/etherdevice.h> |
| 12 | #include <linux/list.h> | 12 | #include <linux/list.h> |
| 13 | #include <linux/netdevice.h> | 13 | #include <linux/netdevice.h> |
| 14 | #include <linux/slab.h> | ||
| 14 | #include "dsa_priv.h" | 15 | #include "dsa_priv.h" |
| 15 | 16 | ||
| 16 | #define DSA_HLEN 4 | 17 | #define DSA_HLEN 4 |
diff --git a/net/dsa/tag_edsa.c b/net/dsa/tag_edsa.c index 8f53948cff4f..6f383322ad25 100644 --- a/net/dsa/tag_edsa.c +++ b/net/dsa/tag_edsa.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/etherdevice.h> | 11 | #include <linux/etherdevice.h> |
| 12 | #include <linux/list.h> | 12 | #include <linux/list.h> |
| 13 | #include <linux/netdevice.h> | 13 | #include <linux/netdevice.h> |
| 14 | #include <linux/slab.h> | ||
| 14 | #include "dsa_priv.h" | 15 | #include "dsa_priv.h" |
| 15 | 16 | ||
| 16 | #define DSA_HLEN 4 | 17 | #define DSA_HLEN 4 |
diff --git a/net/dsa/tag_trailer.c b/net/dsa/tag_trailer.c index a85c829853c0..d6d7d0add3cb 100644 --- a/net/dsa/tag_trailer.c +++ b/net/dsa/tag_trailer.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/etherdevice.h> | 11 | #include <linux/etherdevice.h> |
| 12 | #include <linux/list.h> | 12 | #include <linux/list.h> |
| 13 | #include <linux/netdevice.h> | 13 | #include <linux/netdevice.h> |
| 14 | #include <linux/slab.h> | ||
| 14 | #include "dsa_priv.h" | 15 | #include "dsa_priv.h" |
| 15 | 16 | ||
| 16 | netdev_tx_t trailer_xmit(struct sk_buff *skb, struct net_device *dev) | 17 | netdev_tx_t trailer_xmit(struct sk_buff *skb, struct net_device *dev) |
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c index 29b4931aae52..2a5a8053e000 100644 --- a/net/econet/af_econet.c +++ b/net/econet/af_econet.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <linux/wireless.h> | 30 | #include <linux/wireless.h> |
| 31 | #include <linux/skbuff.h> | 31 | #include <linux/skbuff.h> |
| 32 | #include <linux/udp.h> | 32 | #include <linux/udp.h> |
| 33 | #include <linux/slab.h> | ||
| 33 | #include <net/sock.h> | 34 | #include <net/sock.h> |
| 34 | #include <net/inet_common.h> | 35 | #include <net/inet_common.h> |
| 35 | #include <linux/stat.h> | 36 | #include <linux/stat.h> |
diff --git a/net/ethernet/pe2.c b/net/ethernet/pe2.c index d60e15d9365e..eb00796758c3 100644 --- a/net/ethernet/pe2.c +++ b/net/ethernet/pe2.c | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | #include <linux/module.h> | 3 | #include <linux/module.h> |
| 4 | #include <linux/netdevice.h> | 4 | #include <linux/netdevice.h> |
| 5 | #include <linux/skbuff.h> | 5 | #include <linux/skbuff.h> |
| 6 | #include <linux/slab.h> | ||
| 6 | 7 | ||
| 7 | #include <net/datalink.h> | 8 | #include <net/datalink.h> |
| 8 | 9 | ||
diff --git a/net/ieee802154/af_ieee802154.c b/net/ieee802154/af_ieee802154.c index bad1c49fd960..93c91b633a56 100644 --- a/net/ieee802154/af_ieee802154.c +++ b/net/ieee802154/af_ieee802154.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/if.h> | 28 | #include <linux/if.h> |
| 29 | #include <linux/termios.h> /* For TIOCOUTQ/INQ */ | 29 | #include <linux/termios.h> /* For TIOCOUTQ/INQ */ |
| 30 | #include <linux/list.h> | 30 | #include <linux/list.h> |
| 31 | #include <linux/slab.h> | ||
| 31 | #include <net/datalink.h> | 32 | #include <net/datalink.h> |
| 32 | #include <net/psnap.h> | 33 | #include <net/psnap.h> |
| 33 | #include <net/sock.h> | 34 | #include <net/sock.h> |
| @@ -126,6 +127,9 @@ static int ieee802154_sock_connect(struct socket *sock, struct sockaddr *uaddr, | |||
| 126 | { | 127 | { |
| 127 | struct sock *sk = sock->sk; | 128 | struct sock *sk = sock->sk; |
| 128 | 129 | ||
| 130 | if (addr_len < sizeof(uaddr->sa_family)) | ||
| 131 | return -EINVAL; | ||
| 132 | |||
| 129 | if (uaddr->sa_family == AF_UNSPEC) | 133 | if (uaddr->sa_family == AF_UNSPEC) |
| 130 | return sk->sk_prot->disconnect(sk, flags); | 134 | return sk->sk_prot->disconnect(sk, flags); |
| 131 | 135 | ||
| @@ -147,6 +151,9 @@ static int ieee802154_dev_ioctl(struct sock *sk, struct ifreq __user *arg, | |||
| 147 | dev_load(sock_net(sk), ifr.ifr_name); | 151 | dev_load(sock_net(sk), ifr.ifr_name); |
| 148 | dev = dev_get_by_name(sock_net(sk), ifr.ifr_name); | 152 | dev = dev_get_by_name(sock_net(sk), ifr.ifr_name); |
| 149 | 153 | ||
| 154 | if (!dev) | ||
| 155 | return -ENODEV; | ||
| 156 | |||
| 150 | if (dev->type == ARPHRD_IEEE802154 && dev->netdev_ops->ndo_do_ioctl) | 157 | if (dev->type == ARPHRD_IEEE802154 && dev->netdev_ops->ndo_do_ioctl) |
| 151 | ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, cmd); | 158 | ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, cmd); |
| 152 | 159 | ||
diff --git a/net/ieee802154/dgram.c b/net/ieee802154/dgram.c index 9aac5aee1575..1a3334c2609a 100644 --- a/net/ieee802154/dgram.c +++ b/net/ieee802154/dgram.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
| 26 | #include <linux/if_arp.h> | 26 | #include <linux/if_arp.h> |
| 27 | #include <linux/list.h> | 27 | #include <linux/list.h> |
| 28 | #include <linux/slab.h> | ||
| 28 | #include <net/sock.h> | 29 | #include <net/sock.h> |
| 29 | #include <net/af_ieee802154.h> | 30 | #include <net/af_ieee802154.h> |
| 30 | #include <net/ieee802154.h> | 31 | #include <net/ieee802154.h> |
diff --git a/net/ieee802154/netlink.c b/net/ieee802154/netlink.c index 33137b99e471..c8097ae2482f 100644 --- a/net/ieee802154/netlink.c +++ b/net/ieee802154/netlink.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
| 26 | #include <linux/gfp.h> | ||
| 26 | #include <net/genetlink.h> | 27 | #include <net/genetlink.h> |
| 27 | #include <linux/nl802154.h> | 28 | #include <linux/nl802154.h> |
| 28 | 29 | ||
diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c index 135c1678fb11..71ee1108d4f8 100644 --- a/net/ieee802154/nl-mac.c +++ b/net/ieee802154/nl-mac.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | * Maxim Osipov <maxim.osipov@siemens.com> | 22 | * Maxim Osipov <maxim.osipov@siemens.com> |
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | #include <linux/gfp.h> | ||
| 25 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
| 26 | #include <linux/if_arp.h> | 27 | #include <linux/if_arp.h> |
| 27 | #include <linux/netdevice.h> | 28 | #include <linux/netdevice.h> |
diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c index 199a2d9d12f9..ed0eab39f531 100644 --- a/net/ieee802154/nl-phy.c +++ b/net/ieee802154/nl-phy.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
| 26 | #include <linux/slab.h> | ||
| 26 | #include <net/netlink.h> | 27 | #include <net/netlink.h> |
| 27 | #include <net/genetlink.h> | 28 | #include <net/genetlink.h> |
| 28 | #include <net/wpan-phy.h> | 29 | #include <net/wpan-phy.h> |
diff --git a/net/ieee802154/raw.c b/net/ieee802154/raw.c index 9c9b85c00033..10970ca85748 100644 --- a/net/ieee802154/raw.c +++ b/net/ieee802154/raw.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
| 26 | #include <linux/if_arp.h> | 26 | #include <linux/if_arp.h> |
| 27 | #include <linux/list.h> | 27 | #include <linux/list.h> |
| 28 | #include <linux/slab.h> | ||
| 28 | #include <net/sock.h> | 29 | #include <net/sock.h> |
| 29 | #include <net/af_ieee802154.h> | 30 | #include <net/af_ieee802154.h> |
| 30 | 31 | ||
diff --git a/net/ieee802154/wpan-class.c b/net/ieee802154/wpan-class.c index 268691256a6d..3d803a1b9fb6 100644 --- a/net/ieee802154/wpan-class.c +++ b/net/ieee802154/wpan-class.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | * | 16 | * |
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | #include <linux/slab.h> | ||
| 19 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
| 20 | #include <linux/module.h> | 21 | #include <linux/module.h> |
| 21 | #include <linux/device.h> | 22 | #include <linux/device.h> |
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 33b7dffa7732..f71357422380 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
| @@ -86,6 +86,7 @@ | |||
| 86 | #include <linux/poll.h> | 86 | #include <linux/poll.h> |
| 87 | #include <linux/netfilter_ipv4.h> | 87 | #include <linux/netfilter_ipv4.h> |
| 88 | #include <linux/random.h> | 88 | #include <linux/random.h> |
| 89 | #include <linux/slab.h> | ||
| 89 | 90 | ||
| 90 | #include <asm/uaccess.h> | 91 | #include <asm/uaccess.h> |
| 91 | #include <asm/system.h> | 92 | #include <asm/system.h> |
| @@ -530,6 +531,8 @@ int inet_dgram_connect(struct socket *sock, struct sockaddr * uaddr, | |||
| 530 | { | 531 | { |
| 531 | struct sock *sk = sock->sk; | 532 | struct sock *sk = sock->sk; |
| 532 | 533 | ||
| 534 | if (addr_len < sizeof(uaddr->sa_family)) | ||
| 535 | return -EINVAL; | ||
| 533 | if (uaddr->sa_family == AF_UNSPEC) | 536 | if (uaddr->sa_family == AF_UNSPEC) |
| 534 | return sk->sk_prot->disconnect(sk, flags); | 537 | return sk->sk_prot->disconnect(sk, flags); |
| 535 | 538 | ||
| @@ -573,6 +576,9 @@ int inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, | |||
| 573 | int err; | 576 | int err; |
| 574 | long timeo; | 577 | long timeo; |
| 575 | 578 | ||
| 579 | if (addr_len < sizeof(uaddr->sa_family)) | ||
| 580 | return -EINVAL; | ||
| 581 | |||
| 576 | lock_sock(sk); | 582 | lock_sock(sk); |
| 577 | 583 | ||
| 578 | if (uaddr->sa_family == AF_UNSPEC) { | 584 | if (uaddr->sa_family == AF_UNSPEC) { |
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c index 987b47dc69ad..880a5ec6dce0 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #include <crypto/hash.h> | 1 | #include <crypto/hash.h> |
| 2 | #include <linux/err.h> | 2 | #include <linux/err.h> |
| 3 | #include <linux/module.h> | 3 | #include <linux/module.h> |
| 4 | #include <linux/slab.h> | ||
| 4 | #include <net/ip.h> | 5 | #include <net/ip.h> |
| 5 | #include <net/xfrm.h> | 6 | #include <net/xfrm.h> |
| 6 | #include <net/ah.h> | 7 | #include <net/ah.h> |
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index c4dd13542802..80769f1f9fab 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
| @@ -98,6 +98,7 @@ | |||
| 98 | #include <linux/net.h> | 98 | #include <linux/net.h> |
| 99 | #include <linux/rcupdate.h> | 99 | #include <linux/rcupdate.h> |
| 100 | #include <linux/jhash.h> | 100 | #include <linux/jhash.h> |
| 101 | #include <linux/slab.h> | ||
| 101 | #ifdef CONFIG_SYSCTL | 102 | #ifdef CONFIG_SYSCTL |
| 102 | #include <linux/sysctl.h> | 103 | #include <linux/sysctl.h> |
| 103 | #endif | 104 | #endif |
| @@ -660,13 +661,13 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, | |||
| 660 | #endif | 661 | #endif |
| 661 | #endif | 662 | #endif |
| 662 | 663 | ||
| 663 | #ifdef CONFIG_FDDI | 664 | #if defined(CONFIG_FDDI) || defined(CONFIG_FDDI_MODULE) |
| 664 | case ARPHRD_FDDI: | 665 | case ARPHRD_FDDI: |
| 665 | arp->ar_hrd = htons(ARPHRD_ETHER); | 666 | arp->ar_hrd = htons(ARPHRD_ETHER); |
| 666 | arp->ar_pro = htons(ETH_P_IP); | 667 | arp->ar_pro = htons(ETH_P_IP); |
| 667 | break; | 668 | break; |
| 668 | #endif | 669 | #endif |
| 669 | #ifdef CONFIG_TR | 670 | #if defined(CONFIG_TR) || defined(CONFIG_TR_MODULE) |
| 670 | case ARPHRD_IEEE802_TR: | 671 | case ARPHRD_IEEE802_TR: |
| 671 | arp->ar_hrd = htons(ARPHRD_IEEE802); | 672 | arp->ar_hrd = htons(ARPHRD_IEEE802); |
| 672 | arp->ar_pro = htons(ETH_P_IP); | 673 | arp->ar_pro = htons(ETH_P_IP); |
| @@ -1050,7 +1051,7 @@ static int arp_req_set(struct net *net, struct arpreq *r, | |||
| 1050 | return -EINVAL; | 1051 | return -EINVAL; |
| 1051 | } | 1052 | } |
| 1052 | switch (dev->type) { | 1053 | switch (dev->type) { |
| 1053 | #ifdef CONFIG_FDDI | 1054 | #if defined(CONFIG_FDDI) || defined(CONFIG_FDDI_MODULE) |
| 1054 | case ARPHRD_FDDI: | 1055 | case ARPHRD_FDDI: |
| 1055 | /* | 1056 | /* |
| 1056 | * According to RFC 1390, FDDI devices should accept ARP | 1057 | * According to RFC 1390, FDDI devices should accept ARP |
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c index 1e029dc75455..c97cd9ff697e 100644 --- a/net/ipv4/cipso_ipv4.c +++ b/net/ipv4/cipso_ipv4.c | |||
| @@ -44,6 +44,7 @@ | |||
| 44 | #include <linux/string.h> | 44 | #include <linux/string.h> |
| 45 | #include <linux/jhash.h> | 45 | #include <linux/jhash.h> |
| 46 | #include <linux/audit.h> | 46 | #include <linux/audit.h> |
| 47 | #include <linux/slab.h> | ||
| 47 | #include <net/ip.h> | 48 | #include <net/ip.h> |
| 48 | #include <net/icmp.h> | 49 | #include <net/icmp.h> |
| 49 | #include <net/tcp.h> | 50 | #include <net/tcp.h> |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 51ca946e3392..90e3d6379a42 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
| @@ -50,6 +50,7 @@ | |||
| 50 | #include <linux/notifier.h> | 50 | #include <linux/notifier.h> |
| 51 | #include <linux/inetdevice.h> | 51 | #include <linux/inetdevice.h> |
| 52 | #include <linux/igmp.h> | 52 | #include <linux/igmp.h> |
| 53 | #include <linux/slab.h> | ||
| 53 | #ifdef CONFIG_SYSCTL | 54 | #ifdef CONFIG_SYSCTL |
| 54 | #include <linux/sysctl.h> | 55 | #include <linux/sysctl.h> |
| 55 | #endif | 56 | #endif |
| @@ -1194,7 +1195,7 @@ static int inet_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb) | |||
| 1194 | hlist_for_each_entry_rcu(dev, node, head, index_hlist) { | 1195 | hlist_for_each_entry_rcu(dev, node, head, index_hlist) { |
| 1195 | if (idx < s_idx) | 1196 | if (idx < s_idx) |
| 1196 | goto cont; | 1197 | goto cont; |
| 1197 | if (idx > s_idx) | 1198 | if (h > s_h || idx > s_idx) |
| 1198 | s_ip_idx = 0; | 1199 | s_ip_idx = 0; |
| 1199 | in_dev = __in_dev_get_rcu(dev); | 1200 | in_dev = __in_dev_get_rcu(dev); |
| 1200 | if (!in_dev) | 1201 | if (!in_dev) |
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 9b3e28ed5240..4f0ed458c883 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <linux/skbuff.h> | 34 | #include <linux/skbuff.h> |
| 35 | #include <linux/init.h> | 35 | #include <linux/init.h> |
| 36 | #include <linux/list.h> | 36 | #include <linux/list.h> |
| 37 | #include <linux/slab.h> | ||
| 37 | 38 | ||
| 38 | #include <net/ip.h> | 39 | #include <net/ip.h> |
| 39 | #include <net/protocol.h> | 40 | #include <net/protocol.h> |
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c index 14972017b9c2..4ed7e0dea1bc 100644 --- a/net/ipv4/fib_hash.c +++ b/net/ipv4/fib_hash.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include <linux/skbuff.h> | 32 | #include <linux/skbuff.h> |
| 33 | #include <linux/netlink.h> | 33 | #include <linux/netlink.h> |
| 34 | #include <linux/init.h> | 34 | #include <linux/init.h> |
| 35 | #include <linux/slab.h> | ||
| 35 | 36 | ||
| 36 | #include <net/net_namespace.h> | 37 | #include <net/net_namespace.h> |
| 37 | #include <net/ip.h> | 38 | #include <net/ip.h> |
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 1af0ea0fb6a2..20f09c5b31e8 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include <linux/proc_fs.h> | 32 | #include <linux/proc_fs.h> |
| 33 | #include <linux/skbuff.h> | 33 | #include <linux/skbuff.h> |
| 34 | #include <linux/init.h> | 34 | #include <linux/init.h> |
| 35 | #include <linux/slab.h> | ||
| 35 | 36 | ||
| 36 | #include <net/arp.h> | 37 | #include <net/arp.h> |
| 37 | #include <net/ip.h> | 38 | #include <net/ip.h> |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index af5d89792860..c98f115fb0fd 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
| @@ -71,6 +71,7 @@ | |||
| 71 | #include <linux/netlink.h> | 71 | #include <linux/netlink.h> |
| 72 | #include <linux/init.h> | 72 | #include <linux/init.h> |
| 73 | #include <linux/list.h> | 73 | #include <linux/list.h> |
| 74 | #include <linux/slab.h> | ||
| 74 | #include <net/net_namespace.h> | 75 | #include <net/net_namespace.h> |
| 75 | #include <net/ip.h> | 76 | #include <net/ip.h> |
| 76 | #include <net/protocol.h> | 77 | #include <net/protocol.h> |
| @@ -208,7 +209,9 @@ static inline struct node *tnode_get_child_rcu(struct tnode *tn, unsigned int i) | |||
| 208 | { | 209 | { |
| 209 | struct node *ret = tnode_get_child(tn, i); | 210 | struct node *ret = tnode_get_child(tn, i); |
| 210 | 211 | ||
| 211 | return rcu_dereference(ret); | 212 | return rcu_dereference_check(ret, |
| 213 | rcu_read_lock_held() || | ||
| 214 | lockdep_rtnl_is_held()); | ||
| 212 | } | 215 | } |
| 213 | 216 | ||
| 214 | static inline int tnode_child_length(const struct tnode *tn) | 217 | static inline int tnode_child_length(const struct tnode *tn) |
| @@ -961,7 +964,9 @@ fib_find_node(struct trie *t, u32 key) | |||
| 961 | struct node *n; | 964 | struct node *n; |
| 962 | 965 | ||
| 963 | pos = 0; | 966 | pos = 0; |
| 964 | n = rcu_dereference(t->trie); | 967 | n = rcu_dereference_check(t->trie, |
| 968 | rcu_read_lock_held() || | ||
| 969 | lockdep_rtnl_is_held()); | ||
| 965 | 970 | ||
| 966 | while (n != NULL && NODE_TYPE(n) == T_TNODE) { | 971 | while (n != NULL && NODE_TYPE(n) == T_TNODE) { |
| 967 | tn = (struct tnode *) n; | 972 | tn = (struct tnode *) n; |
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 4b4c2bcd15db..ac4dec132735 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
| @@ -74,6 +74,7 @@ | |||
| 74 | #include <linux/netdevice.h> | 74 | #include <linux/netdevice.h> |
| 75 | #include <linux/string.h> | 75 | #include <linux/string.h> |
| 76 | #include <linux/netfilter_ipv4.h> | 76 | #include <linux/netfilter_ipv4.h> |
| 77 | #include <linux/slab.h> | ||
| 77 | #include <net/snmp.h> | 78 | #include <net/snmp.h> |
| 78 | #include <net/ip.h> | 79 | #include <net/ip.h> |
| 79 | #include <net/route.h> | 80 | #include <net/route.h> |
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 63bf298ca109..15d3eeda92f5 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
| @@ -71,6 +71,7 @@ | |||
| 71 | */ | 71 | */ |
| 72 | 72 | ||
| 73 | #include <linux/module.h> | 73 | #include <linux/module.h> |
| 74 | #include <linux/slab.h> | ||
| 74 | #include <asm/uaccess.h> | 75 | #include <asm/uaccess.h> |
| 75 | #include <asm/system.h> | 76 | #include <asm/system.h> |
| 76 | #include <linux/types.h> | 77 | #include <linux/types.h> |
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 1aaa8110d84b..e5fa2ddce320 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
| 15 | #include <linux/fcntl.h> | 15 | #include <linux/fcntl.h> |
| 16 | #include <linux/random.h> | 16 | #include <linux/random.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | #include <linux/cache.h> | 18 | #include <linux/cache.h> |
| 18 | #include <linux/init.h> | 19 | #include <linux/init.h> |
| 19 | #include <linux/time.h> | 20 | #include <linux/time.h> |
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c index eaf3e2c8646a..a2ca6aed763b 100644 --- a/net/ipv4/inet_fragment.c +++ b/net/ipv4/inet_fragment.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/random.h> | 19 | #include <linux/random.h> |
| 20 | #include <linux/skbuff.h> | 20 | #include <linux/skbuff.h> |
| 21 | #include <linux/rtnetlink.h> | 21 | #include <linux/rtnetlink.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | 23 | ||
| 23 | #include <net/inet_frag.h> | 24 | #include <net/inet_frag.h> |
| 24 | 25 | ||
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c index cc94cc2d8b2d..c5af909cf701 100644 --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
| 12 | #include <linux/kmemcheck.h> | 12 | #include <linux/kmemcheck.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <net/inet_hashtables.h> | 14 | #include <net/inet_hashtables.h> |
| 14 | #include <net/inet_timewait_sock.h> | 15 | #include <net/inet_timewait_sock.h> |
| 15 | #include <net/ip.h> | 16 | #include <net/ip.h> |
diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c index a2991bc8e32e..af10942b326c 100644 --- a/net/ipv4/ip_forward.c +++ b/net/ipv4/ip_forward.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/ip.h> | 25 | #include <linux/ip.h> |
| 26 | #include <linux/icmp.h> | 26 | #include <linux/icmp.h> |
| 27 | #include <linux/netdevice.h> | 27 | #include <linux/netdevice.h> |
| 28 | #include <linux/slab.h> | ||
| 28 | #include <net/sock.h> | 29 | #include <net/sock.h> |
| 29 | #include <net/ip.h> | 30 | #include <net/ip.h> |
| 30 | #include <net/tcp.h> | 31 | #include <net/tcp.h> |
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index b59430bc041c..75347ea70ea0 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include <linux/netdevice.h> | 32 | #include <linux/netdevice.h> |
| 33 | #include <linux/jhash.h> | 33 | #include <linux/jhash.h> |
| 34 | #include <linux/random.h> | 34 | #include <linux/random.h> |
| 35 | #include <linux/slab.h> | ||
| 35 | #include <net/route.h> | 36 | #include <net/route.h> |
| 36 | #include <net/dst.h> | 37 | #include <net/dst.h> |
| 37 | #include <net/sock.h> | 38 | #include <net/sock.h> |
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index c0c5274d0271..fe381d12ecdd 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
| 15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
| 16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | #include <asm/uaccess.h> | 18 | #include <asm/uaccess.h> |
| 18 | #include <linux/skbuff.h> | 19 | #include <linux/skbuff.h> |
| 19 | #include <linux/netdevice.h> | 20 | #include <linux/netdevice.h> |
| @@ -810,11 +811,13 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev | |||
| 810 | tunnel->err_count = 0; | 811 | tunnel->err_count = 0; |
| 811 | } | 812 | } |
| 812 | 813 | ||
| 813 | max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen; | 814 | max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen + rt->u.dst.header_len; |
| 814 | 815 | ||
| 815 | if (skb_headroom(skb) < max_headroom || skb_shared(skb)|| | 816 | if (skb_headroom(skb) < max_headroom || skb_shared(skb)|| |
| 816 | (skb_cloned(skb) && !skb_clone_writable(skb, 0))) { | 817 | (skb_cloned(skb) && !skb_clone_writable(skb, 0))) { |
| 817 | struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom); | 818 | struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom); |
| 819 | if (max_headroom > dev->needed_headroom) | ||
| 820 | dev->needed_headroom = max_headroom; | ||
| 818 | if (!new_skb) { | 821 | if (!new_skb) { |
| 819 | ip_rt_put(rt); | 822 | ip_rt_put(rt); |
| 820 | txq->tx_dropped++; | 823 | txq->tx_dropped++; |
| @@ -1144,12 +1147,9 @@ static int ipgre_header(struct sk_buff *skb, struct net_device *dev, | |||
| 1144 | 1147 | ||
| 1145 | if (saddr) | 1148 | if (saddr) |
| 1146 | memcpy(&iph->saddr, saddr, 4); | 1149 | memcpy(&iph->saddr, saddr, 4); |
| 1147 | 1150 | if (daddr) | |
| 1148 | if (daddr) { | ||
| 1149 | memcpy(&iph->daddr, daddr, 4); | 1151 | memcpy(&iph->daddr, daddr, 4); |
| 1150 | return t->hlen; | 1152 | if (iph->daddr) |
| 1151 | } | ||
| 1152 | if (iph->daddr && !ipv4_is_multicast(iph->daddr)) | ||
| 1153 | return t->hlen; | 1153 | return t->hlen; |
| 1154 | 1154 | ||
| 1155 | return -t->hlen; | 1155 | return -t->hlen; |
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index c29de9879fda..f8ab7a380d4a 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c | |||
| @@ -119,6 +119,7 @@ | |||
| 119 | #include <linux/kernel.h> | 119 | #include <linux/kernel.h> |
| 120 | #include <linux/string.h> | 120 | #include <linux/string.h> |
| 121 | #include <linux/errno.h> | 121 | #include <linux/errno.h> |
| 122 | #include <linux/slab.h> | ||
| 122 | 123 | ||
| 123 | #include <linux/net.h> | 124 | #include <linux/net.h> |
| 124 | #include <linux/socket.h> | 125 | #include <linux/socket.h> |
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c index 94bf105ef3c9..4c09a31fd140 100644 --- a/net/ipv4/ip_options.c +++ b/net/ipv4/ip_options.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | #include <linux/capability.h> | 12 | #include <linux/capability.h> |
| 13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
| 14 | #include <linux/slab.h> | ||
| 14 | #include <linux/types.h> | 15 | #include <linux/types.h> |
| 15 | #include <asm/uaccess.h> | 16 | #include <asm/uaccess.h> |
| 16 | #include <linux/skbuff.h> | 17 | #include <linux/skbuff.h> |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 3451799e3dbf..d1bcc9f21d4f 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
| @@ -51,6 +51,7 @@ | |||
| 51 | #include <linux/string.h> | 51 | #include <linux/string.h> |
| 52 | #include <linux/errno.h> | 52 | #include <linux/errno.h> |
| 53 | #include <linux/highmem.h> | 53 | #include <linux/highmem.h> |
| 54 | #include <linux/slab.h> | ||
| 54 | 55 | ||
| 55 | #include <linux/socket.h> | 56 | #include <linux/socket.h> |
| 56 | #include <linux/sockios.h> | 57 | #include <linux/sockios.h> |
| @@ -119,7 +120,7 @@ static int ip_dev_loopback_xmit(struct sk_buff *newskb) | |||
| 119 | newskb->pkt_type = PACKET_LOOPBACK; | 120 | newskb->pkt_type = PACKET_LOOPBACK; |
| 120 | newskb->ip_summed = CHECKSUM_UNNECESSARY; | 121 | newskb->ip_summed = CHECKSUM_UNNECESSARY; |
| 121 | WARN_ON(!skb_dst(newskb)); | 122 | WARN_ON(!skb_dst(newskb)); |
| 122 | netif_rx(newskb); | 123 | netif_rx_ni(newskb); |
| 123 | return 0; | 124 | return 0; |
| 124 | } | 125 | } |
| 125 | 126 | ||
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 644dc43a55de..1e64dabbd232 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/icmp.h> | 23 | #include <linux/icmp.h> |
| 24 | #include <linux/inetdevice.h> | 24 | #include <linux/inetdevice.h> |
| 25 | #include <linux/netdevice.h> | 25 | #include <linux/netdevice.h> |
| 26 | #include <linux/slab.h> | ||
| 26 | #include <net/sock.h> | 27 | #include <net/sock.h> |
| 27 | #include <net/ip.h> | 28 | #include <net/ip.h> |
| 28 | #include <net/icmp.h> | 29 | #include <net/icmp.h> |
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 10a6a604bf32..067ce9e043dc 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
| @@ -53,6 +53,7 @@ | |||
| 53 | #include <linux/root_dev.h> | 53 | #include <linux/root_dev.h> |
| 54 | #include <linux/delay.h> | 54 | #include <linux/delay.h> |
| 55 | #include <linux/nfs_fs.h> | 55 | #include <linux/nfs_fs.h> |
| 56 | #include <linux/slab.h> | ||
| 56 | #include <net/net_namespace.h> | 57 | #include <net/net_namespace.h> |
| 57 | #include <net/arp.h> | 58 | #include <net/arp.h> |
| 58 | #include <net/ip.h> | 59 | #include <net/ip.h> |
| @@ -187,6 +188,16 @@ struct ic_device { | |||
| 187 | static struct ic_device *ic_first_dev __initdata = NULL;/* List of open device */ | 188 | static struct ic_device *ic_first_dev __initdata = NULL;/* List of open device */ |
| 188 | static struct net_device *ic_dev __initdata = NULL; /* Selected device */ | 189 | static struct net_device *ic_dev __initdata = NULL; /* Selected device */ |
| 189 | 190 | ||
| 191 | static bool __init ic_device_match(struct net_device *dev) | ||
| 192 | { | ||
| 193 | if (user_dev_name[0] ? !strcmp(dev->name, user_dev_name) : | ||
| 194 | (!(dev->flags & IFF_LOOPBACK) && | ||
| 195 | (dev->flags & (IFF_POINTOPOINT|IFF_BROADCAST)) && | ||
| 196 | strncmp(dev->name, "dummy", 5))) | ||
| 197 | return true; | ||
| 198 | return false; | ||
| 199 | } | ||
| 200 | |||
| 190 | static int __init ic_open_devs(void) | 201 | static int __init ic_open_devs(void) |
| 191 | { | 202 | { |
| 192 | struct ic_device *d, **last; | 203 | struct ic_device *d, **last; |
| @@ -207,10 +218,7 @@ static int __init ic_open_devs(void) | |||
| 207 | for_each_netdev(&init_net, dev) { | 218 | for_each_netdev(&init_net, dev) { |
| 208 | if (dev->flags & IFF_LOOPBACK) | 219 | if (dev->flags & IFF_LOOPBACK) |
| 209 | continue; | 220 | continue; |
| 210 | if (user_dev_name[0] ? !strcmp(dev->name, user_dev_name) : | 221 | if (ic_device_match(dev)) { |
| 211 | (!(dev->flags & IFF_LOOPBACK) && | ||
| 212 | (dev->flags & (IFF_POINTOPOINT|IFF_BROADCAST)) && | ||
| 213 | strncmp(dev->name, "dummy", 5))) { | ||
| 214 | int able = 0; | 222 | int able = 0; |
| 215 | if (dev->mtu >= 364) | 223 | if (dev->mtu >= 364) |
| 216 | able |= IC_BOOTP; | 224 | able |= IC_BOOTP; |
| @@ -228,7 +236,7 @@ static int __init ic_open_devs(void) | |||
| 228 | } | 236 | } |
| 229 | if (!(d = kmalloc(sizeof(struct ic_device), GFP_KERNEL))) { | 237 | if (!(d = kmalloc(sizeof(struct ic_device), GFP_KERNEL))) { |
| 230 | rtnl_unlock(); | 238 | rtnl_unlock(); |
| 231 | return -1; | 239 | return -ENOMEM; |
| 232 | } | 240 | } |
| 233 | d->dev = dev; | 241 | d->dev = dev; |
| 234 | *last = d; | 242 | *last = d; |
| @@ -253,7 +261,7 @@ static int __init ic_open_devs(void) | |||
| 253 | printk(KERN_ERR "IP-Config: Device `%s' not found.\n", user_dev_name); | 261 | printk(KERN_ERR "IP-Config: Device `%s' not found.\n", user_dev_name); |
| 254 | else | 262 | else |
| 255 | printk(KERN_ERR "IP-Config: No network devices available.\n"); | 263 | printk(KERN_ERR "IP-Config: No network devices available.\n"); |
| 256 | return -1; | 264 | return -ENODEV; |
| 257 | } | 265 | } |
| 258 | return 0; | 266 | return 0; |
| 259 | } | 267 | } |
| @@ -1303,6 +1311,32 @@ __be32 __init root_nfs_parse_addr(char *name) | |||
| 1303 | return addr; | 1311 | return addr; |
| 1304 | } | 1312 | } |
| 1305 | 1313 | ||
| 1314 | #define DEVICE_WAIT_MAX 12 /* 12 seconds */ | ||
| 1315 | |||
| 1316 | static int __init wait_for_devices(void) | ||
| 1317 | { | ||
| 1318 | int i; | ||
| 1319 | |||
| 1320 | msleep(CONF_PRE_OPEN); | ||
| 1321 | for (i = 0; i < DEVICE_WAIT_MAX; i++) { | ||
| 1322 | struct net_device *dev; | ||
| 1323 | int found = 0; | ||
| 1324 | |||
| 1325 | rtnl_lock(); | ||
| 1326 | for_each_netdev(&init_net, dev) { | ||
| 1327 | if (ic_device_match(dev)) { | ||
| 1328 | found = 1; | ||
| 1329 | break; | ||
| 1330 | } | ||
| 1331 | } | ||
| 1332 | rtnl_unlock(); | ||
| 1333 | if (found) | ||
| 1334 | return 0; | ||
| 1335 | ssleep(1); | ||
| 1336 | } | ||
| 1337 | return -ENODEV; | ||
| 1338 | } | ||
| 1339 | |||
| 1306 | /* | 1340 | /* |
| 1307 | * IP Autoconfig dispatcher. | 1341 | * IP Autoconfig dispatcher. |
| 1308 | */ | 1342 | */ |
| @@ -1313,6 +1347,7 @@ static int __init ip_auto_config(void) | |||
| 1313 | #ifdef IPCONFIG_DYNAMIC | 1347 | #ifdef IPCONFIG_DYNAMIC |
| 1314 | int retries = CONF_OPEN_RETRIES; | 1348 | int retries = CONF_OPEN_RETRIES; |
| 1315 | #endif | 1349 | #endif |
| 1350 | int err; | ||
| 1316 | 1351 | ||
| 1317 | #ifdef CONFIG_PROC_FS | 1352 | #ifdef CONFIG_PROC_FS |
| 1318 | proc_net_fops_create(&init_net, "pnp", S_IRUGO, &pnp_seq_fops); | 1353 | proc_net_fops_create(&init_net, "pnp", S_IRUGO, &pnp_seq_fops); |
| @@ -1325,12 +1360,15 @@ static int __init ip_auto_config(void) | |||
| 1325 | #ifdef IPCONFIG_DYNAMIC | 1360 | #ifdef IPCONFIG_DYNAMIC |
| 1326 | try_try_again: | 1361 | try_try_again: |
| 1327 | #endif | 1362 | #endif |
| 1328 | /* Give hardware a chance to settle */ | 1363 | /* Wait for devices to appear */ |
| 1329 | msleep(CONF_PRE_OPEN); | 1364 | err = wait_for_devices(); |
| 1365 | if (err) | ||
| 1366 | return err; | ||
| 1330 | 1367 | ||
| 1331 | /* Setup all network devices */ | 1368 | /* Setup all network devices */ |
| 1332 | if (ic_open_devs() < 0) | 1369 | err = ic_open_devs(); |
| 1333 | return -1; | 1370 | if (err) |
| 1371 | return err; | ||
| 1334 | 1372 | ||
| 1335 | /* Give drivers a chance to settle */ | 1373 | /* Give drivers a chance to settle */ |
| 1336 | ssleep(CONF_POST_OPEN); | 1374 | ssleep(CONF_POST_OPEN); |
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 2f302d3ac9a3..0b27b14dcc9d 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c | |||
| @@ -95,6 +95,7 @@ | |||
| 95 | #include <linux/module.h> | 95 | #include <linux/module.h> |
| 96 | #include <linux/types.h> | 96 | #include <linux/types.h> |
| 97 | #include <linux/kernel.h> | 97 | #include <linux/kernel.h> |
| 98 | #include <linux/slab.h> | ||
| 98 | #include <asm/uaccess.h> | 99 | #include <asm/uaccess.h> |
| 99 | #include <linux/skbuff.h> | 100 | #include <linux/skbuff.h> |
| 100 | #include <linux/netdevice.h> | 101 | #include <linux/netdevice.h> |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 8582e12e4a62..ec19a890c9a0 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
| @@ -47,6 +47,7 @@ | |||
| 47 | #include <linux/mroute.h> | 47 | #include <linux/mroute.h> |
| 48 | #include <linux/init.h> | 48 | #include <linux/init.h> |
| 49 | #include <linux/if_ether.h> | 49 | #include <linux/if_ether.h> |
| 50 | #include <linux/slab.h> | ||
| 50 | #include <net/net_namespace.h> | 51 | #include <net/net_namespace.h> |
| 51 | #include <net/ip.h> | 52 | #include <net/ip.h> |
| 52 | #include <net/protocol.h> | 53 | #include <net/protocol.h> |
| @@ -753,7 +754,8 @@ ipmr_cache_unresolved(struct net *net, vifi_t vifi, struct sk_buff *skb) | |||
| 753 | c->next = mfc_unres_queue; | 754 | c->next = mfc_unres_queue; |
| 754 | mfc_unres_queue = c; | 755 | mfc_unres_queue = c; |
| 755 | 756 | ||
| 756 | mod_timer(&ipmr_expire_timer, c->mfc_un.unres.expires); | 757 | if (atomic_read(&net->ipv4.cache_resolve_queue_len) == 1) |
| 758 | mod_timer(&ipmr_expire_timer, c->mfc_un.unres.expires); | ||
| 757 | } | 759 | } |
| 758 | 760 | ||
| 759 | /* | 761 | /* |
| @@ -802,6 +804,9 @@ static int ipmr_mfc_add(struct net *net, struct mfcctl *mfc, int mrtsock) | |||
| 802 | int line; | 804 | int line; |
| 803 | struct mfc_cache *uc, *c, **cp; | 805 | struct mfc_cache *uc, *c, **cp; |
| 804 | 806 | ||
| 807 | if (mfc->mfcc_parent >= MAXVIFS) | ||
| 808 | return -ENFILE; | ||
| 809 | |||
| 805 | line = MFC_HASH(mfc->mfcc_mcastgrp.s_addr, mfc->mfcc_origin.s_addr); | 810 | line = MFC_HASH(mfc->mfcc_mcastgrp.s_addr, mfc->mfcc_origin.s_addr); |
| 806 | 811 | ||
| 807 | for (cp = &net->ipv4.mfc_cache_array[line]; | 812 | for (cp = &net->ipv4.mfc_cache_array[line]; |
| @@ -1613,17 +1618,20 @@ ipmr_fill_mroute(struct sk_buff *skb, struct mfc_cache *c, struct rtmsg *rtm) | |||
| 1613 | int ct; | 1618 | int ct; |
| 1614 | struct rtnexthop *nhp; | 1619 | struct rtnexthop *nhp; |
| 1615 | struct net *net = mfc_net(c); | 1620 | struct net *net = mfc_net(c); |
| 1616 | struct net_device *dev = net->ipv4.vif_table[c->mfc_parent].dev; | ||
| 1617 | u8 *b = skb_tail_pointer(skb); | 1621 | u8 *b = skb_tail_pointer(skb); |
| 1618 | struct rtattr *mp_head; | 1622 | struct rtattr *mp_head; |
| 1619 | 1623 | ||
| 1620 | if (dev) | 1624 | /* If cache is unresolved, don't try to parse IIF and OIF */ |
| 1621 | RTA_PUT(skb, RTA_IIF, 4, &dev->ifindex); | 1625 | if (c->mfc_parent > MAXVIFS) |
| 1626 | return -ENOENT; | ||
| 1627 | |||
| 1628 | if (VIF_EXISTS(net, c->mfc_parent)) | ||
| 1629 | RTA_PUT(skb, RTA_IIF, 4, &net->ipv4.vif_table[c->mfc_parent].dev->ifindex); | ||
| 1622 | 1630 | ||
| 1623 | mp_head = (struct rtattr *)skb_put(skb, RTA_LENGTH(0)); | 1631 | mp_head = (struct rtattr *)skb_put(skb, RTA_LENGTH(0)); |
| 1624 | 1632 | ||
| 1625 | for (ct = c->mfc_un.res.minvif; ct < c->mfc_un.res.maxvif; ct++) { | 1633 | for (ct = c->mfc_un.res.minvif; ct < c->mfc_un.res.maxvif; ct++) { |
| 1626 | if (c->mfc_un.res.ttls[ct] < 255) { | 1634 | if (VIF_EXISTS(net, ct) && c->mfc_un.res.ttls[ct] < 255) { |
| 1627 | if (skb_tailroom(skb) < RTA_ALIGN(RTA_ALIGN(sizeof(*nhp)) + 4)) | 1635 | if (skb_tailroom(skb) < RTA_ALIGN(RTA_ALIGN(sizeof(*nhp)) + 4)) |
| 1628 | goto rtattr_failure; | 1636 | goto rtattr_failure; |
| 1629 | nhp = (struct rtnexthop *)skb_put(skb, RTA_ALIGN(sizeof(*nhp))); | 1637 | nhp = (struct rtnexthop *)skb_put(skb, RTA_ALIGN(sizeof(*nhp))); |
diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c index c14623fc4d5e..82fb43c5c59e 100644 --- a/net/ipv4/netfilter.c +++ b/net/ipv4/netfilter.c | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #include <linux/netfilter_ipv4.h> | 4 | #include <linux/netfilter_ipv4.h> |
| 5 | #include <linux/ip.h> | 5 | #include <linux/ip.h> |
| 6 | #include <linux/skbuff.h> | 6 | #include <linux/skbuff.h> |
| 7 | #include <linux/gfp.h> | ||
| 7 | #include <net/route.h> | 8 | #include <net/route.h> |
| 8 | #include <net/xfrm.h> | 9 | #include <net/xfrm.h> |
| 9 | #include <net/ip.h> | 10 | #include <net/ip.h> |
diff --git a/net/ipv4/netfilter/arptable_filter.c b/net/ipv4/netfilter/arptable_filter.c index bfe26f32b930..79ca5e70d497 100644 --- a/net/ipv4/netfilter/arptable_filter.c +++ b/net/ipv4/netfilter/arptable_filter.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <linux/module.h> | 8 | #include <linux/module.h> |
| 9 | #include <linux/netfilter/x_tables.h> | 9 | #include <linux/netfilter/x_tables.h> |
| 10 | #include <linux/netfilter_arp/arp_tables.h> | 10 | #include <linux/netfilter_arp/arp_tables.h> |
| 11 | #include <linux/slab.h> | ||
| 11 | 12 | ||
| 12 | MODULE_LICENSE("GPL"); | 13 | MODULE_LICENSE("GPL"); |
| 13 | MODULE_AUTHOR("David S. Miller <davem@redhat.com>"); | 14 | MODULE_AUTHOR("David S. Miller <davem@redhat.com>"); |
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c index 2855f1f38cbc..e2787048aa0a 100644 --- a/net/ipv4/netfilter/ip_queue.c +++ b/net/ipv4/netfilter/ip_queue.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/security.h> | 26 | #include <linux/security.h> |
| 27 | #include <linux/net.h> | 27 | #include <linux/net.h> |
| 28 | #include <linux/mutex.h> | 28 | #include <linux/mutex.h> |
| 29 | #include <linux/slab.h> | ||
| 29 | #include <net/net_namespace.h> | 30 | #include <net/net_namespace.h> |
| 30 | #include <net/sock.h> | 31 | #include <net/sock.h> |
| 31 | #include <net/route.h> | 32 | #include <net/route.h> |
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index 0886f96c736b..ab828400ed71 100644 --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/jhash.h> | 14 | #include <linux/jhash.h> |
| 15 | #include <linux/bitops.h> | 15 | #include <linux/bitops.h> |
| 16 | #include <linux/skbuff.h> | 16 | #include <linux/skbuff.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | #include <linux/ip.h> | 18 | #include <linux/ip.h> |
| 18 | #include <linux/tcp.h> | 19 | #include <linux/tcp.h> |
| 19 | #include <linux/udp.h> | 20 | #include <linux/udp.h> |
diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c index 5113b8f1a379..a0e8bcf04159 100644 --- a/net/ipv4/netfilter/ipt_REJECT.c +++ b/net/ipv4/netfilter/ipt_REJECT.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
| 14 | #include <linux/skbuff.h> | 14 | #include <linux/skbuff.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | #include <linux/ip.h> | 16 | #include <linux/ip.h> |
| 16 | #include <linux/udp.h> | 17 | #include <linux/udp.h> |
| 17 | #include <linux/icmp.h> | 18 | #include <linux/icmp.h> |
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c index 09a5d3f7cc41..0dbe697f164f 100644 --- a/net/ipv4/netfilter/ipt_ULOG.c +++ b/net/ipv4/netfilter/ipt_ULOG.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <linux/module.h> | 33 | #include <linux/module.h> |
| 34 | #include <linux/spinlock.h> | 34 | #include <linux/spinlock.h> |
| 35 | #include <linux/socket.h> | 35 | #include <linux/socket.h> |
| 36 | #include <linux/slab.h> | ||
| 36 | #include <linux/skbuff.h> | 37 | #include <linux/skbuff.h> |
| 37 | #include <linux/kernel.h> | 38 | #include <linux/kernel.h> |
| 38 | #include <linux/timer.h> | 39 | #include <linux/timer.h> |
diff --git a/net/ipv4/netfilter/iptable_filter.c b/net/ipv4/netfilter/iptable_filter.c index c8dc9800d620..55392466daa4 100644 --- a/net/ipv4/netfilter/iptable_filter.c +++ b/net/ipv4/netfilter/iptable_filter.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
| 14 | #include <linux/moduleparam.h> | 14 | #include <linux/moduleparam.h> |
| 15 | #include <linux/netfilter_ipv4/ip_tables.h> | 15 | #include <linux/netfilter_ipv4/ip_tables.h> |
| 16 | #include <linux/slab.h> | ||
| 16 | #include <net/ip.h> | 17 | #include <net/ip.h> |
| 17 | 18 | ||
| 18 | MODULE_LICENSE("GPL"); | 19 | MODULE_LICENSE("GPL"); |
diff --git a/net/ipv4/netfilter/iptable_mangle.c b/net/ipv4/netfilter/iptable_mangle.c index b9b83464cbf4..294a2a32f293 100644 --- a/net/ipv4/netfilter/iptable_mangle.c +++ b/net/ipv4/netfilter/iptable_mangle.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/netfilter_ipv4/ip_tables.h> | 12 | #include <linux/netfilter_ipv4/ip_tables.h> |
| 13 | #include <linux/netdevice.h> | 13 | #include <linux/netdevice.h> |
| 14 | #include <linux/skbuff.h> | 14 | #include <linux/skbuff.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | #include <net/sock.h> | 16 | #include <net/sock.h> |
| 16 | #include <net/route.h> | 17 | #include <net/route.h> |
| 17 | #include <linux/ip.h> | 18 | #include <linux/ip.h> |
diff --git a/net/ipv4/netfilter/iptable_raw.c b/net/ipv4/netfilter/iptable_raw.c index 06fb9d11953c..07fb710cd722 100644 --- a/net/ipv4/netfilter/iptable_raw.c +++ b/net/ipv4/netfilter/iptable_raw.c | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | */ | 5 | */ |
| 6 | #include <linux/module.h> | 6 | #include <linux/module.h> |
| 7 | #include <linux/netfilter_ipv4/ip_tables.h> | 7 | #include <linux/netfilter_ipv4/ip_tables.h> |
| 8 | #include <linux/slab.h> | ||
| 8 | #include <net/ip.h> | 9 | #include <net/ip.h> |
| 9 | 10 | ||
| 10 | #define RAW_VALID_HOOKS ((1 << NF_INET_PRE_ROUTING) | (1 << NF_INET_LOCAL_OUT)) | 11 | #define RAW_VALID_HOOKS ((1 << NF_INET_PRE_ROUTING) | (1 << NF_INET_LOCAL_OUT)) |
diff --git a/net/ipv4/netfilter/iptable_security.c b/net/ipv4/netfilter/iptable_security.c index cce2f64e6f21..be45bdc4c602 100644 --- a/net/ipv4/netfilter/iptable_security.c +++ b/net/ipv4/netfilter/iptable_security.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | */ | 17 | */ |
| 18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
| 19 | #include <linux/netfilter_ipv4/ip_tables.h> | 19 | #include <linux/netfilter_ipv4/ip_tables.h> |
| 20 | #include <linux/slab.h> | ||
| 20 | #include <net/ip.h> | 21 | #include <net/ip.h> |
| 21 | 22 | ||
| 22 | MODULE_LICENSE("GPL"); | 23 | MODULE_LICENSE("GPL"); |
diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c index 4595281c2863..4f8bddb760c9 100644 --- a/net/ipv4/netfilter/nf_nat_core.c +++ b/net/ipv4/netfilter/nf_nat_core.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
| 13 | #include <linux/timer.h> | 13 | #include <linux/timer.h> |
| 14 | #include <linux/skbuff.h> | 14 | #include <linux/skbuff.h> |
| 15 | #include <linux/gfp.h> | ||
| 15 | #include <net/checksum.h> | 16 | #include <net/checksum.h> |
| 16 | #include <net/icmp.h> | 17 | #include <net/icmp.h> |
| 17 | #include <net/ip.h> | 18 | #include <net/ip.h> |
diff --git a/net/ipv4/netfilter/nf_nat_helper.c b/net/ipv4/netfilter/nf_nat_helper.c index 4b6af4bb1f50..4a0c6b548eee 100644 --- a/net/ipv4/netfilter/nf_nat_helper.c +++ b/net/ipv4/netfilter/nf_nat_helper.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
| 9 | */ | 9 | */ |
| 10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
| 11 | #include <linux/gfp.h> | ||
| 11 | #include <linux/kmod.h> | 12 | #include <linux/kmod.h> |
| 12 | #include <linux/types.h> | 13 | #include <linux/types.h> |
| 13 | #include <linux/timer.h> | 14 | #include <linux/timer.h> |
diff --git a/net/ipv4/netfilter/nf_nat_rule.c b/net/ipv4/netfilter/nf_nat_rule.c index ab74cc0535e2..26de2c1f7fab 100644 --- a/net/ipv4/netfilter/nf_nat_rule.c +++ b/net/ipv4/netfilter/nf_nat_rule.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/kmod.h> | 15 | #include <linux/kmod.h> |
| 16 | #include <linux/skbuff.h> | 16 | #include <linux/skbuff.h> |
| 17 | #include <linux/proc_fs.h> | 17 | #include <linux/proc_fs.h> |
| 18 | #include <linux/slab.h> | ||
| 18 | #include <net/checksum.h> | 19 | #include <net/checksum.h> |
| 19 | #include <net/route.h> | 20 | #include <net/route.h> |
| 20 | #include <linux/bitops.h> | 21 | #include <linux/bitops.h> |
diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c index 0b9c7ce3d6c5..4d85b6e55f29 100644 --- a/net/ipv4/netfilter/nf_nat_snmp_basic.c +++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c | |||
| @@ -43,6 +43,7 @@ | |||
| 43 | #include <linux/moduleparam.h> | 43 | #include <linux/moduleparam.h> |
| 44 | #include <linux/types.h> | 44 | #include <linux/types.h> |
| 45 | #include <linux/kernel.h> | 45 | #include <linux/kernel.h> |
| 46 | #include <linux/slab.h> | ||
| 46 | #include <linux/in.h> | 47 | #include <linux/in.h> |
| 47 | #include <linux/ip.h> | 48 | #include <linux/ip.h> |
| 48 | #include <linux/udp.h> | 49 | #include <linux/udp.h> |
diff --git a/net/ipv4/netfilter/nf_nat_standalone.c b/net/ipv4/netfilter/nf_nat_standalone.c index 5678e9562c15..c39c9cf6bee6 100644 --- a/net/ipv4/netfilter/nf_nat_standalone.c +++ b/net/ipv4/netfilter/nf_nat_standalone.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | */ | 7 | */ |
| 8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
| 9 | #include <linux/icmp.h> | 9 | #include <linux/icmp.h> |
| 10 | #include <linux/gfp.h> | ||
| 10 | #include <linux/ip.h> | 11 | #include <linux/ip.h> |
| 11 | #include <linux/netfilter.h> | 12 | #include <linux/netfilter.h> |
| 12 | #include <linux/netfilter_ipv4.h> | 13 | #include <linux/netfilter_ipv4.h> |
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c index 242ed2307370..4f1f337f4337 100644 --- a/net/ipv4/proc.c +++ b/net/ipv4/proc.c | |||
| @@ -249,6 +249,8 @@ static const struct snmp_mib snmp4_net_list[] = { | |||
| 249 | SNMP_MIB_ITEM("TCPSackShifted", LINUX_MIB_SACKSHIFTED), | 249 | SNMP_MIB_ITEM("TCPSackShifted", LINUX_MIB_SACKSHIFTED), |
| 250 | SNMP_MIB_ITEM("TCPSackMerged", LINUX_MIB_SACKMERGED), | 250 | SNMP_MIB_ITEM("TCPSackMerged", LINUX_MIB_SACKMERGED), |
| 251 | SNMP_MIB_ITEM("TCPSackShiftFallback", LINUX_MIB_SACKSHIFTFALLBACK), | 251 | SNMP_MIB_ITEM("TCPSackShiftFallback", LINUX_MIB_SACKSHIFTFALLBACK), |
| 252 | SNMP_MIB_ITEM("TCPBacklogDrop", LINUX_MIB_TCPBACKLOGDROP), | ||
| 253 | SNMP_MIB_ITEM("TCPMinTTLDrop", LINUX_MIB_TCPMINTTLDROP), | ||
| 252 | SNMP_MIB_SENTINEL | 254 | SNMP_MIB_SENTINEL |
| 253 | }; | 255 | }; |
| 254 | 256 | ||
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index ce154b47f1da..cc6f097fbd5f 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
| @@ -60,7 +60,6 @@ | |||
| 60 | #include <net/net_namespace.h> | 60 | #include <net/net_namespace.h> |
| 61 | #include <net/dst.h> | 61 | #include <net/dst.h> |
| 62 | #include <net/sock.h> | 62 | #include <net/sock.h> |
| 63 | #include <linux/gfp.h> | ||
| 64 | #include <linux/ip.h> | 63 | #include <linux/ip.h> |
| 65 | #include <linux/net.h> | 64 | #include <linux/net.h> |
| 66 | #include <net/ip.h> | 65 | #include <net/ip.h> |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index b2ba5581d2ae..cb562fdd9b9a 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
| @@ -90,6 +90,7 @@ | |||
| 90 | #include <linux/jhash.h> | 90 | #include <linux/jhash.h> |
| 91 | #include <linux/rcupdate.h> | 91 | #include <linux/rcupdate.h> |
| 92 | #include <linux/times.h> | 92 | #include <linux/times.h> |
| 93 | #include <linux/slab.h> | ||
| 93 | #include <net/dst.h> | 94 | #include <net/dst.h> |
| 94 | #include <net/net_namespace.h> | 95 | #include <net/net_namespace.h> |
| 95 | #include <net/protocol.h> | 96 | #include <net/protocol.h> |
| @@ -146,7 +147,6 @@ static struct dst_entry *ipv4_negative_advice(struct dst_entry *dst); | |||
| 146 | static void ipv4_link_failure(struct sk_buff *skb); | 147 | static void ipv4_link_failure(struct sk_buff *skb); |
| 147 | static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu); | 148 | static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu); |
| 148 | static int rt_garbage_collect(struct dst_ops *ops); | 149 | static int rt_garbage_collect(struct dst_ops *ops); |
| 149 | static void rt_emergency_hash_rebuild(struct net *net); | ||
| 150 | 150 | ||
| 151 | 151 | ||
| 152 | static struct dst_ops ipv4_dst_ops = { | 152 | static struct dst_ops ipv4_dst_ops = { |
| @@ -780,11 +780,30 @@ static void rt_do_flush(int process_context) | |||
| 780 | #define FRACT_BITS 3 | 780 | #define FRACT_BITS 3 |
| 781 | #define ONE (1UL << FRACT_BITS) | 781 | #define ONE (1UL << FRACT_BITS) |
| 782 | 782 | ||
| 783 | /* | ||
| 784 | * Given a hash chain and an item in this hash chain, | ||
| 785 | * find if a previous entry has the same hash_inputs | ||
| 786 | * (but differs on tos, mark or oif) | ||
| 787 | * Returns 0 if an alias is found. | ||
| 788 | * Returns ONE if rth has no alias before itself. | ||
| 789 | */ | ||
| 790 | static int has_noalias(const struct rtable *head, const struct rtable *rth) | ||
| 791 | { | ||
| 792 | const struct rtable *aux = head; | ||
| 793 | |||
| 794 | while (aux != rth) { | ||
| 795 | if (compare_hash_inputs(&aux->fl, &rth->fl)) | ||
| 796 | return 0; | ||
| 797 | aux = aux->u.dst.rt_next; | ||
| 798 | } | ||
| 799 | return ONE; | ||
| 800 | } | ||
| 801 | |||
| 783 | static void rt_check_expire(void) | 802 | static void rt_check_expire(void) |
| 784 | { | 803 | { |
| 785 | static unsigned int rover; | 804 | static unsigned int rover; |
| 786 | unsigned int i = rover, goal; | 805 | unsigned int i = rover, goal; |
| 787 | struct rtable *rth, *aux, **rthp; | 806 | struct rtable *rth, **rthp; |
| 788 | unsigned long samples = 0; | 807 | unsigned long samples = 0; |
| 789 | unsigned long sum = 0, sum2 = 0; | 808 | unsigned long sum = 0, sum2 = 0; |
| 790 | unsigned long delta; | 809 | unsigned long delta; |
| @@ -835,15 +854,7 @@ nofree: | |||
| 835 | * attributes don't unfairly skew | 854 | * attributes don't unfairly skew |
| 836 | * the length computation | 855 | * the length computation |
| 837 | */ | 856 | */ |
| 838 | for (aux = rt_hash_table[i].chain;;) { | 857 | length += has_noalias(rt_hash_table[i].chain, rth); |
| 839 | if (aux == rth) { | ||
| 840 | length += ONE; | ||
| 841 | break; | ||
| 842 | } | ||
| 843 | if (compare_hash_inputs(&aux->fl, &rth->fl)) | ||
| 844 | break; | ||
| 845 | aux = aux->u.dst.rt_next; | ||
| 846 | } | ||
| 847 | continue; | 858 | continue; |
| 848 | } | 859 | } |
| 849 | } else if (!rt_may_expire(rth, tmo, ip_rt_gc_timeout)) | 860 | } else if (!rt_may_expire(rth, tmo, ip_rt_gc_timeout)) |
| @@ -922,10 +933,8 @@ static void rt_secret_rebuild_oneshot(struct net *net) | |||
| 922 | { | 933 | { |
| 923 | del_timer_sync(&net->ipv4.rt_secret_timer); | 934 | del_timer_sync(&net->ipv4.rt_secret_timer); |
| 924 | rt_cache_invalidate(net); | 935 | rt_cache_invalidate(net); |
| 925 | if (ip_rt_secret_interval) { | 936 | if (ip_rt_secret_interval) |
| 926 | net->ipv4.rt_secret_timer.expires += ip_rt_secret_interval; | 937 | mod_timer(&net->ipv4.rt_secret_timer, jiffies + ip_rt_secret_interval); |
| 927 | add_timer(&net->ipv4.rt_secret_timer); | ||
| 928 | } | ||
| 929 | } | 938 | } |
| 930 | 939 | ||
| 931 | static void rt_emergency_hash_rebuild(struct net *net) | 940 | static void rt_emergency_hash_rebuild(struct net *net) |
| @@ -1073,8 +1082,23 @@ work_done: | |||
| 1073 | out: return 0; | 1082 | out: return 0; |
| 1074 | } | 1083 | } |
| 1075 | 1084 | ||
| 1085 | /* | ||
| 1086 | * Returns number of entries in a hash chain that have different hash_inputs | ||
| 1087 | */ | ||
| 1088 | static int slow_chain_length(const struct rtable *head) | ||
| 1089 | { | ||
| 1090 | int length = 0; | ||
| 1091 | const struct rtable *rth = head; | ||
| 1092 | |||
| 1093 | while (rth) { | ||
| 1094 | length += has_noalias(head, rth); | ||
| 1095 | rth = rth->u.dst.rt_next; | ||
| 1096 | } | ||
| 1097 | return length >> FRACT_BITS; | ||
| 1098 | } | ||
| 1099 | |||
| 1076 | static int rt_intern_hash(unsigned hash, struct rtable *rt, | 1100 | static int rt_intern_hash(unsigned hash, struct rtable *rt, |
| 1077 | struct rtable **rp, struct sk_buff *skb) | 1101 | struct rtable **rp, struct sk_buff *skb, int ifindex) |
| 1078 | { | 1102 | { |
| 1079 | struct rtable *rth, **rthp; | 1103 | struct rtable *rth, **rthp; |
| 1080 | unsigned long now; | 1104 | unsigned long now; |
| @@ -1185,14 +1209,20 @@ restart: | |||
| 1185 | rt_free(cand); | 1209 | rt_free(cand); |
| 1186 | } | 1210 | } |
| 1187 | } else { | 1211 | } else { |
| 1188 | if (chain_length > rt_chain_length_max) { | 1212 | if (chain_length > rt_chain_length_max && |
| 1213 | slow_chain_length(rt_hash_table[hash].chain) > rt_chain_length_max) { | ||
| 1189 | struct net *net = dev_net(rt->u.dst.dev); | 1214 | struct net *net = dev_net(rt->u.dst.dev); |
| 1190 | int num = ++net->ipv4.current_rt_cache_rebuild_count; | 1215 | int num = ++net->ipv4.current_rt_cache_rebuild_count; |
| 1191 | if (!rt_caching(dev_net(rt->u.dst.dev))) { | 1216 | if (!rt_caching(net)) { |
| 1192 | printk(KERN_WARNING "%s: %d rebuilds is over limit, route caching disabled\n", | 1217 | printk(KERN_WARNING "%s: %d rebuilds is over limit, route caching disabled\n", |
| 1193 | rt->u.dst.dev->name, num); | 1218 | rt->u.dst.dev->name, num); |
| 1194 | } | 1219 | } |
| 1195 | rt_emergency_hash_rebuild(dev_net(rt->u.dst.dev)); | 1220 | rt_emergency_hash_rebuild(net); |
| 1221 | spin_unlock_bh(rt_hash_lock_addr(hash)); | ||
| 1222 | |||
| 1223 | hash = rt_hash(rt->fl.fl4_dst, rt->fl.fl4_src, | ||
| 1224 | ifindex, rt_genid(net)); | ||
| 1225 | goto restart; | ||
| 1196 | } | 1226 | } |
| 1197 | } | 1227 | } |
| 1198 | 1228 | ||
| @@ -1417,7 +1447,7 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw, | |||
| 1417 | dev_hold(rt->u.dst.dev); | 1447 | dev_hold(rt->u.dst.dev); |
| 1418 | if (rt->idev) | 1448 | if (rt->idev) |
| 1419 | in_dev_hold(rt->idev); | 1449 | in_dev_hold(rt->idev); |
| 1420 | rt->u.dst.obsolete = 0; | 1450 | rt->u.dst.obsolete = -1; |
| 1421 | rt->u.dst.lastuse = jiffies; | 1451 | rt->u.dst.lastuse = jiffies; |
| 1422 | rt->u.dst.path = &rt->u.dst; | 1452 | rt->u.dst.path = &rt->u.dst; |
| 1423 | rt->u.dst.neighbour = NULL; | 1453 | rt->u.dst.neighbour = NULL; |
| @@ -1453,7 +1483,7 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw, | |||
| 1453 | &netevent); | 1483 | &netevent); |
| 1454 | 1484 | ||
| 1455 | rt_del(hash, rth); | 1485 | rt_del(hash, rth); |
| 1456 | if (!rt_intern_hash(hash, rt, &rt, NULL)) | 1486 | if (!rt_intern_hash(hash, rt, &rt, NULL, rt->fl.oif)) |
| 1457 | ip_rt_put(rt); | 1487 | ip_rt_put(rt); |
| 1458 | goto do_next; | 1488 | goto do_next; |
| 1459 | } | 1489 | } |
| @@ -1482,11 +1512,12 @@ static struct dst_entry *ipv4_negative_advice(struct dst_entry *dst) | |||
| 1482 | struct dst_entry *ret = dst; | 1512 | struct dst_entry *ret = dst; |
| 1483 | 1513 | ||
| 1484 | if (rt) { | 1514 | if (rt) { |
| 1485 | if (dst->obsolete) { | 1515 | if (dst->obsolete > 0) { |
| 1486 | ip_rt_put(rt); | 1516 | ip_rt_put(rt); |
| 1487 | ret = NULL; | 1517 | ret = NULL; |
| 1488 | } else if ((rt->rt_flags & RTCF_REDIRECTED) || | 1518 | } else if ((rt->rt_flags & RTCF_REDIRECTED) || |
| 1489 | rt->u.dst.expires) { | 1519 | (rt->u.dst.expires && |
| 1520 | time_after_eq(jiffies, rt->u.dst.expires))) { | ||
| 1490 | unsigned hash = rt_hash(rt->fl.fl4_dst, rt->fl.fl4_src, | 1521 | unsigned hash = rt_hash(rt->fl.fl4_dst, rt->fl.fl4_src, |
| 1491 | rt->fl.oif, | 1522 | rt->fl.oif, |
| 1492 | rt_genid(dev_net(dst->dev))); | 1523 | rt_genid(dev_net(dst->dev))); |
| @@ -1702,7 +1733,9 @@ static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu) | |||
| 1702 | 1733 | ||
| 1703 | static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie) | 1734 | static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie) |
| 1704 | { | 1735 | { |
| 1705 | return NULL; | 1736 | if (rt_is_expired((struct rtable *)dst)) |
| 1737 | return NULL; | ||
| 1738 | return dst; | ||
| 1706 | } | 1739 | } |
| 1707 | 1740 | ||
| 1708 | static void ipv4_dst_destroy(struct dst_entry *dst) | 1741 | static void ipv4_dst_destroy(struct dst_entry *dst) |
| @@ -1864,7 +1897,8 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr, | |||
| 1864 | if (!rth) | 1897 | if (!rth) |
| 1865 | goto e_nobufs; | 1898 | goto e_nobufs; |
| 1866 | 1899 | ||
| 1867 | rth->u.dst.output= ip_rt_bug; | 1900 | rth->u.dst.output = ip_rt_bug; |
| 1901 | rth->u.dst.obsolete = -1; | ||
| 1868 | 1902 | ||
| 1869 | atomic_set(&rth->u.dst.__refcnt, 1); | 1903 | atomic_set(&rth->u.dst.__refcnt, 1); |
| 1870 | rth->u.dst.flags= DST_HOST; | 1904 | rth->u.dst.flags= DST_HOST; |
| @@ -1903,7 +1937,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr, | |||
| 1903 | 1937 | ||
| 1904 | in_dev_put(in_dev); | 1938 | in_dev_put(in_dev); |
| 1905 | hash = rt_hash(daddr, saddr, dev->ifindex, rt_genid(dev_net(dev))); | 1939 | hash = rt_hash(daddr, saddr, dev->ifindex, rt_genid(dev_net(dev))); |
| 1906 | return rt_intern_hash(hash, rth, NULL, skb); | 1940 | return rt_intern_hash(hash, rth, NULL, skb, dev->ifindex); |
| 1907 | 1941 | ||
| 1908 | e_nobufs: | 1942 | e_nobufs: |
| 1909 | in_dev_put(in_dev); | 1943 | in_dev_put(in_dev); |
| @@ -2030,6 +2064,7 @@ static int __mkroute_input(struct sk_buff *skb, | |||
| 2030 | rth->fl.oif = 0; | 2064 | rth->fl.oif = 0; |
| 2031 | rth->rt_spec_dst= spec_dst; | 2065 | rth->rt_spec_dst= spec_dst; |
| 2032 | 2066 | ||
| 2067 | rth->u.dst.obsolete = -1; | ||
| 2033 | rth->u.dst.input = ip_forward; | 2068 | rth->u.dst.input = ip_forward; |
| 2034 | rth->u.dst.output = ip_output; | 2069 | rth->u.dst.output = ip_output; |
| 2035 | rth->rt_genid = rt_genid(dev_net(rth->u.dst.dev)); | 2070 | rth->rt_genid = rt_genid(dev_net(rth->u.dst.dev)); |
| @@ -2069,7 +2104,7 @@ static int ip_mkroute_input(struct sk_buff *skb, | |||
| 2069 | /* put it into the cache */ | 2104 | /* put it into the cache */ |
| 2070 | hash = rt_hash(daddr, saddr, fl->iif, | 2105 | hash = rt_hash(daddr, saddr, fl->iif, |
| 2071 | rt_genid(dev_net(rth->u.dst.dev))); | 2106 | rt_genid(dev_net(rth->u.dst.dev))); |
| 2072 | return rt_intern_hash(hash, rth, NULL, skb); | 2107 | return rt_intern_hash(hash, rth, NULL, skb, fl->iif); |
| 2073 | } | 2108 | } |
| 2074 | 2109 | ||
| 2075 | /* | 2110 | /* |
| @@ -2194,6 +2229,7 @@ local_input: | |||
| 2194 | goto e_nobufs; | 2229 | goto e_nobufs; |
| 2195 | 2230 | ||
| 2196 | rth->u.dst.output= ip_rt_bug; | 2231 | rth->u.dst.output= ip_rt_bug; |
| 2232 | rth->u.dst.obsolete = -1; | ||
| 2197 | rth->rt_genid = rt_genid(net); | 2233 | rth->rt_genid = rt_genid(net); |
| 2198 | 2234 | ||
| 2199 | atomic_set(&rth->u.dst.__refcnt, 1); | 2235 | atomic_set(&rth->u.dst.__refcnt, 1); |
| @@ -2225,7 +2261,7 @@ local_input: | |||
| 2225 | } | 2261 | } |
| 2226 | rth->rt_type = res.type; | 2262 | rth->rt_type = res.type; |
| 2227 | hash = rt_hash(daddr, saddr, fl.iif, rt_genid(net)); | 2263 | hash = rt_hash(daddr, saddr, fl.iif, rt_genid(net)); |
| 2228 | err = rt_intern_hash(hash, rth, NULL, skb); | 2264 | err = rt_intern_hash(hash, rth, NULL, skb, fl.iif); |
| 2229 | goto done; | 2265 | goto done; |
| 2230 | 2266 | ||
| 2231 | no_route: | 2267 | no_route: |
| @@ -2420,6 +2456,7 @@ static int __mkroute_output(struct rtable **result, | |||
| 2420 | rth->rt_spec_dst= fl->fl4_src; | 2456 | rth->rt_spec_dst= fl->fl4_src; |
| 2421 | 2457 | ||
| 2422 | rth->u.dst.output=ip_output; | 2458 | rth->u.dst.output=ip_output; |
| 2459 | rth->u.dst.obsolete = -1; | ||
| 2423 | rth->rt_genid = rt_genid(dev_net(dev_out)); | 2460 | rth->rt_genid = rt_genid(dev_net(dev_out)); |
| 2424 | 2461 | ||
| 2425 | RT_CACHE_STAT_INC(out_slow_tot); | 2462 | RT_CACHE_STAT_INC(out_slow_tot); |
| @@ -2471,7 +2508,7 @@ static int ip_mkroute_output(struct rtable **rp, | |||
| 2471 | if (err == 0) { | 2508 | if (err == 0) { |
| 2472 | hash = rt_hash(oldflp->fl4_dst, oldflp->fl4_src, oldflp->oif, | 2509 | hash = rt_hash(oldflp->fl4_dst, oldflp->fl4_src, oldflp->oif, |
| 2473 | rt_genid(dev_net(dev_out))); | 2510 | rt_genid(dev_net(dev_out))); |
| 2474 | err = rt_intern_hash(hash, rth, rp, NULL); | 2511 | err = rt_intern_hash(hash, rth, rp, NULL, oldflp->oif); |
| 2475 | } | 2512 | } |
| 2476 | 2513 | ||
| 2477 | return err; | 2514 | return err; |
| @@ -3077,22 +3114,20 @@ static void rt_secret_reschedule(int old) | |||
| 3077 | rtnl_lock(); | 3114 | rtnl_lock(); |
| 3078 | for_each_net(net) { | 3115 | for_each_net(net) { |
| 3079 | int deleted = del_timer_sync(&net->ipv4.rt_secret_timer); | 3116 | int deleted = del_timer_sync(&net->ipv4.rt_secret_timer); |
| 3117 | long time; | ||
| 3080 | 3118 | ||
| 3081 | if (!new) | 3119 | if (!new) |
| 3082 | continue; | 3120 | continue; |
| 3083 | 3121 | ||
| 3084 | if (deleted) { | 3122 | if (deleted) { |
| 3085 | long time = net->ipv4.rt_secret_timer.expires - jiffies; | 3123 | time = net->ipv4.rt_secret_timer.expires - jiffies; |
| 3086 | 3124 | ||
| 3087 | if (time <= 0 || (time += diff) <= 0) | 3125 | if (time <= 0 || (time += diff) <= 0) |
| 3088 | time = 0; | 3126 | time = 0; |
| 3089 | |||
| 3090 | net->ipv4.rt_secret_timer.expires = time; | ||
| 3091 | } else | 3127 | } else |
| 3092 | net->ipv4.rt_secret_timer.expires = new; | 3128 | time = new; |
| 3093 | 3129 | ||
| 3094 | net->ipv4.rt_secret_timer.expires += jiffies; | 3130 | mod_timer(&net->ipv4.rt_secret_timer, jiffies + time); |
| 3095 | add_timer(&net->ipv4.rt_secret_timer); | ||
| 3096 | } | 3131 | } |
| 3097 | rtnl_unlock(); | 3132 | rtnl_unlock(); |
| 3098 | } | 3133 | } |
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index c1bc074f61b7..1cd5c15174b8 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/inetdevice.h> | 12 | #include <linux/inetdevice.h> |
| 13 | #include <linux/seqlock.h> | 13 | #include <linux/seqlock.h> |
| 14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | #include <net/snmp.h> | 16 | #include <net/snmp.h> |
| 16 | #include <net/icmp.h> | 17 | #include <net/icmp.h> |
| 17 | #include <net/ip.h> | 18 | #include <net/ip.h> |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 5901010fad55..296150b2a62f 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
| @@ -265,6 +265,7 @@ | |||
| 265 | #include <linux/err.h> | 265 | #include <linux/err.h> |
| 266 | #include <linux/crypto.h> | 266 | #include <linux/crypto.h> |
| 267 | #include <linux/time.h> | 267 | #include <linux/time.h> |
| 268 | #include <linux/slab.h> | ||
| 268 | 269 | ||
| 269 | #include <net/icmp.h> | 270 | #include <net/icmp.h> |
| 270 | #include <net/tcp.h> | 271 | #include <net/tcp.h> |
| @@ -429,7 +430,7 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait) | |||
| 429 | if (tp->urg_seq == tp->copied_seq && | 430 | if (tp->urg_seq == tp->copied_seq && |
| 430 | !sock_flag(sk, SOCK_URGINLINE) && | 431 | !sock_flag(sk, SOCK_URGINLINE) && |
| 431 | tp->urg_data) | 432 | tp->urg_data) |
| 432 | target--; | 433 | target++; |
| 433 | 434 | ||
| 434 | /* Potential race condition. If read of tp below will | 435 | /* Potential race condition. If read of tp below will |
| 435 | * escape above sk->sk_state, we can be illegally awaken | 436 | * escape above sk->sk_state, we can be illegally awaken |
| @@ -1254,6 +1255,39 @@ static void tcp_prequeue_process(struct sock *sk) | |||
| 1254 | tp->ucopy.memory = 0; | 1255 | tp->ucopy.memory = 0; |
| 1255 | } | 1256 | } |
| 1256 | 1257 | ||
| 1258 | #ifdef CONFIG_NET_DMA | ||
| 1259 | static void tcp_service_net_dma(struct sock *sk, bool wait) | ||
| 1260 | { | ||
| 1261 | dma_cookie_t done, used; | ||
| 1262 | dma_cookie_t last_issued; | ||
| 1263 | struct tcp_sock *tp = tcp_sk(sk); | ||
| 1264 | |||
| 1265 | if (!tp->ucopy.dma_chan) | ||
| 1266 | return; | ||
| 1267 | |||
| 1268 | last_issued = tp->ucopy.dma_cookie; | ||
| 1269 | dma_async_memcpy_issue_pending(tp->ucopy.dma_chan); | ||
| 1270 | |||
| 1271 | do { | ||
| 1272 | if (dma_async_memcpy_complete(tp->ucopy.dma_chan, | ||
| 1273 | last_issued, &done, | ||
| 1274 | &used) == DMA_SUCCESS) { | ||
| 1275 | /* Safe to free early-copied skbs now */ | ||
| 1276 | __skb_queue_purge(&sk->sk_async_wait_queue); | ||
| 1277 | break; | ||
| 1278 | } else { | ||
| 1279 | struct sk_buff *skb; | ||
| 1280 | while ((skb = skb_peek(&sk->sk_async_wait_queue)) && | ||
| 1281 | (dma_async_is_complete(skb->dma_cookie, done, | ||
| 1282 | used) == DMA_SUCCESS)) { | ||
| 1283 | __skb_dequeue(&sk->sk_async_wait_queue); | ||
| 1284 | kfree_skb(skb); | ||
| 1285 | } | ||
| 1286 | } | ||
| 1287 | } while (wait); | ||
| 1288 | } | ||
| 1289 | #endif | ||
| 1290 | |||
| 1257 | static inline struct sk_buff *tcp_recv_skb(struct sock *sk, u32 seq, u32 *off) | 1291 | static inline struct sk_buff *tcp_recv_skb(struct sock *sk, u32 seq, u32 *off) |
| 1258 | { | 1292 | { |
| 1259 | struct sk_buff *skb; | 1293 | struct sk_buff *skb; |
| @@ -1335,6 +1369,7 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, | |||
| 1335 | sk_eat_skb(sk, skb, 0); | 1369 | sk_eat_skb(sk, skb, 0); |
| 1336 | if (!desc->count) | 1370 | if (!desc->count) |
| 1337 | break; | 1371 | break; |
| 1372 | tp->copied_seq = seq; | ||
| 1338 | } | 1373 | } |
| 1339 | tp->copied_seq = seq; | 1374 | tp->copied_seq = seq; |
| 1340 | 1375 | ||
| @@ -1546,6 +1581,10 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
| 1546 | /* __ Set realtime policy in scheduler __ */ | 1581 | /* __ Set realtime policy in scheduler __ */ |
| 1547 | } | 1582 | } |
| 1548 | 1583 | ||
| 1584 | #ifdef CONFIG_NET_DMA | ||
| 1585 | if (tp->ucopy.dma_chan) | ||
| 1586 | dma_async_memcpy_issue_pending(tp->ucopy.dma_chan); | ||
| 1587 | #endif | ||
| 1549 | if (copied >= target) { | 1588 | if (copied >= target) { |
| 1550 | /* Do not sleep, just process backlog. */ | 1589 | /* Do not sleep, just process backlog. */ |
| 1551 | release_sock(sk); | 1590 | release_sock(sk); |
| @@ -1554,6 +1593,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
| 1554 | sk_wait_data(sk, &timeo); | 1593 | sk_wait_data(sk, &timeo); |
| 1555 | 1594 | ||
| 1556 | #ifdef CONFIG_NET_DMA | 1595 | #ifdef CONFIG_NET_DMA |
| 1596 | tcp_service_net_dma(sk, false); /* Don't block */ | ||
| 1557 | tp->ucopy.wakeup = 0; | 1597 | tp->ucopy.wakeup = 0; |
| 1558 | #endif | 1598 | #endif |
| 1559 | 1599 | ||
| @@ -1633,6 +1673,9 @@ do_prequeue: | |||
| 1633 | copied = -EFAULT; | 1673 | copied = -EFAULT; |
| 1634 | break; | 1674 | break; |
| 1635 | } | 1675 | } |
| 1676 | |||
| 1677 | dma_async_memcpy_issue_pending(tp->ucopy.dma_chan); | ||
| 1678 | |||
| 1636 | if ((offset + used) == skb->len) | 1679 | if ((offset + used) == skb->len) |
| 1637 | copied_early = 1; | 1680 | copied_early = 1; |
| 1638 | 1681 | ||
| @@ -1702,27 +1745,9 @@ skip_copy: | |||
| 1702 | } | 1745 | } |
| 1703 | 1746 | ||
| 1704 | #ifdef CONFIG_NET_DMA | 1747 | #ifdef CONFIG_NET_DMA |
| 1705 | if (tp->ucopy.dma_chan) { | 1748 | tcp_service_net_dma(sk, true); /* Wait for queue to drain */ |
| 1706 | dma_cookie_t done, used; | 1749 | tp->ucopy.dma_chan = NULL; |
| 1707 | |||
| 1708 | dma_async_memcpy_issue_pending(tp->ucopy.dma_chan); | ||
| 1709 | |||
| 1710 | while (dma_async_memcpy_complete(tp->ucopy.dma_chan, | ||
| 1711 | tp->ucopy.dma_cookie, &done, | ||
| 1712 | &used) == DMA_IN_PROGRESS) { | ||
| 1713 | /* do partial cleanup of sk_async_wait_queue */ | ||
| 1714 | while ((skb = skb_peek(&sk->sk_async_wait_queue)) && | ||
| 1715 | (dma_async_is_complete(skb->dma_cookie, done, | ||
| 1716 | used) == DMA_SUCCESS)) { | ||
| 1717 | __skb_dequeue(&sk->sk_async_wait_queue); | ||
| 1718 | kfree_skb(skb); | ||
| 1719 | } | ||
| 1720 | } | ||
| 1721 | 1750 | ||
| 1722 | /* Safe to free early-copied skbs now */ | ||
| 1723 | __skb_queue_purge(&sk->sk_async_wait_queue); | ||
| 1724 | tp->ucopy.dma_chan = NULL; | ||
| 1725 | } | ||
| 1726 | if (tp->ucopy.pinned_list) { | 1751 | if (tp->ucopy.pinned_list) { |
| 1727 | dma_unpin_iovec_pages(tp->ucopy.pinned_list); | 1752 | dma_unpin_iovec_pages(tp->ucopy.pinned_list); |
| 1728 | tp->ucopy.pinned_list = NULL; | 1753 | tp->ucopy.pinned_list = NULL; |
| @@ -2814,7 +2839,6 @@ static void __tcp_free_md5sig_pool(struct tcp_md5sig_pool * __percpu *pool) | |||
| 2814 | if (p->md5_desc.tfm) | 2839 | if (p->md5_desc.tfm) |
| 2815 | crypto_free_hash(p->md5_desc.tfm); | 2840 | crypto_free_hash(p->md5_desc.tfm); |
| 2816 | kfree(p); | 2841 | kfree(p); |
| 2817 | p = NULL; | ||
| 2818 | } | 2842 | } |
| 2819 | } | 2843 | } |
| 2820 | free_percpu(pool); | 2844 | free_percpu(pool); |
| @@ -2912,25 +2936,40 @@ retry: | |||
| 2912 | 2936 | ||
| 2913 | EXPORT_SYMBOL(tcp_alloc_md5sig_pool); | 2937 | EXPORT_SYMBOL(tcp_alloc_md5sig_pool); |
| 2914 | 2938 | ||
| 2915 | struct tcp_md5sig_pool *__tcp_get_md5sig_pool(int cpu) | 2939 | |
| 2940 | /** | ||
| 2941 | * tcp_get_md5sig_pool - get md5sig_pool for this user | ||
| 2942 | * | ||
| 2943 | * We use percpu structure, so if we succeed, we exit with preemption | ||
| 2944 | * and BH disabled, to make sure another thread or softirq handling | ||
| 2945 | * wont try to get same context. | ||
| 2946 | */ | ||
| 2947 | struct tcp_md5sig_pool *tcp_get_md5sig_pool(void) | ||
| 2916 | { | 2948 | { |
| 2917 | struct tcp_md5sig_pool * __percpu *p; | 2949 | struct tcp_md5sig_pool * __percpu *p; |
| 2918 | spin_lock_bh(&tcp_md5sig_pool_lock); | 2950 | |
| 2951 | local_bh_disable(); | ||
| 2952 | |||
| 2953 | spin_lock(&tcp_md5sig_pool_lock); | ||
| 2919 | p = tcp_md5sig_pool; | 2954 | p = tcp_md5sig_pool; |
| 2920 | if (p) | 2955 | if (p) |
| 2921 | tcp_md5sig_users++; | 2956 | tcp_md5sig_users++; |
| 2922 | spin_unlock_bh(&tcp_md5sig_pool_lock); | 2957 | spin_unlock(&tcp_md5sig_pool_lock); |
| 2923 | return (p ? *per_cpu_ptr(p, cpu) : NULL); | ||
| 2924 | } | ||
| 2925 | 2958 | ||
| 2926 | EXPORT_SYMBOL(__tcp_get_md5sig_pool); | 2959 | if (p) |
| 2960 | return *per_cpu_ptr(p, smp_processor_id()); | ||
| 2927 | 2961 | ||
| 2928 | void __tcp_put_md5sig_pool(void) | 2962 | local_bh_enable(); |
| 2963 | return NULL; | ||
| 2964 | } | ||
| 2965 | EXPORT_SYMBOL(tcp_get_md5sig_pool); | ||
| 2966 | |||
| 2967 | void tcp_put_md5sig_pool(void) | ||
| 2929 | { | 2968 | { |
| 2969 | local_bh_enable(); | ||
| 2930 | tcp_free_md5sig_pool(); | 2970 | tcp_free_md5sig_pool(); |
| 2931 | } | 2971 | } |
| 2932 | 2972 | EXPORT_SYMBOL(tcp_put_md5sig_pool); | |
| 2933 | EXPORT_SYMBOL(__tcp_put_md5sig_pool); | ||
| 2934 | 2973 | ||
| 2935 | int tcp_md5_hash_header(struct tcp_md5sig_pool *hp, | 2974 | int tcp_md5_hash_header(struct tcp_md5sig_pool *hp, |
| 2936 | struct tcphdr *th) | 2975 | struct tcphdr *th) |
diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c index 6428b342b164..0ec9bd0ae94f 100644 --- a/net/ipv4/tcp_cong.c +++ b/net/ipv4/tcp_cong.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/mm.h> | 10 | #include <linux/mm.h> |
| 11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 12 | #include <linux/list.h> | 12 | #include <linux/list.h> |
| 13 | #include <linux/gfp.h> | ||
| 13 | #include <net/tcp.h> | 14 | #include <net/tcp.h> |
| 14 | 15 | ||
| 15 | int sysctl_tcp_max_ssthresh = 0; | 16 | int sysctl_tcp_max_ssthresh = 0; |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 788851ca8c5d..f240f57b2199 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
| @@ -62,6 +62,7 @@ | |||
| 62 | */ | 62 | */ |
| 63 | 63 | ||
| 64 | #include <linux/mm.h> | 64 | #include <linux/mm.h> |
| 65 | #include <linux/slab.h> | ||
| 65 | #include <linux/module.h> | 66 | #include <linux/module.h> |
| 66 | #include <linux/sysctl.h> | 67 | #include <linux/sysctl.h> |
| 67 | #include <linux/kernel.h> | 68 | #include <linux/kernel.h> |
| @@ -2511,6 +2512,9 @@ static void tcp_mark_head_lost(struct sock *sk, int packets) | |||
| 2511 | int err; | 2512 | int err; |
| 2512 | unsigned int mss; | 2513 | unsigned int mss; |
| 2513 | 2514 | ||
| 2515 | if (packets == 0) | ||
| 2516 | return; | ||
| 2517 | |||
| 2514 | WARN_ON(packets > tp->packets_out); | 2518 | WARN_ON(packets > tp->packets_out); |
| 2515 | if (tp->lost_skb_hint) { | 2519 | if (tp->lost_skb_hint) { |
| 2516 | skb = tp->lost_skb_hint; | 2520 | skb = tp->lost_skb_hint; |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index c3588b4fd979..3c23e70885f4 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
| @@ -60,6 +60,7 @@ | |||
| 60 | #include <linux/jhash.h> | 60 | #include <linux/jhash.h> |
| 61 | #include <linux/init.h> | 61 | #include <linux/init.h> |
| 62 | #include <linux/times.h> | 62 | #include <linux/times.h> |
| 63 | #include <linux/slab.h> | ||
| 63 | 64 | ||
| 64 | #include <net/net_namespace.h> | 65 | #include <net/net_namespace.h> |
| 65 | #include <net/icmp.h> | 66 | #include <net/icmp.h> |
| @@ -370,6 +371,11 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) | |||
| 370 | if (sk->sk_state == TCP_CLOSE) | 371 | if (sk->sk_state == TCP_CLOSE) |
| 371 | goto out; | 372 | goto out; |
| 372 | 373 | ||
| 374 | if (unlikely(iph->ttl < inet_sk(sk)->min_ttl)) { | ||
| 375 | NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP); | ||
| 376 | goto out; | ||
| 377 | } | ||
| 378 | |||
| 373 | icsk = inet_csk(sk); | 379 | icsk = inet_csk(sk); |
| 374 | tp = tcp_sk(sk); | 380 | tp = tcp_sk(sk); |
| 375 | seq = ntohl(th->seq); | 381 | seq = ntohl(th->seq); |
| @@ -1651,13 +1657,15 @@ int tcp_v4_rcv(struct sk_buff *skb) | |||
| 1651 | if (!sk) | 1657 | if (!sk) |
| 1652 | goto no_tcp_socket; | 1658 | goto no_tcp_socket; |
| 1653 | 1659 | ||
| 1654 | if (iph->ttl < inet_sk(sk)->min_ttl) | ||
| 1655 | goto discard_and_relse; | ||
| 1656 | |||
| 1657 | process: | 1660 | process: |
| 1658 | if (sk->sk_state == TCP_TIME_WAIT) | 1661 | if (sk->sk_state == TCP_TIME_WAIT) |
| 1659 | goto do_time_wait; | 1662 | goto do_time_wait; |
| 1660 | 1663 | ||
| 1664 | if (unlikely(iph->ttl < inet_sk(sk)->min_ttl)) { | ||
| 1665 | NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP); | ||
| 1666 | goto discard_and_relse; | ||
| 1667 | } | ||
| 1668 | |||
| 1661 | if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) | 1669 | if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) |
| 1662 | goto discard_and_relse; | 1670 | goto discard_and_relse; |
| 1663 | nf_reset(skb); | 1671 | nf_reset(skb); |
| @@ -1682,8 +1690,11 @@ process: | |||
| 1682 | if (!tcp_prequeue(sk, skb)) | 1690 | if (!tcp_prequeue(sk, skb)) |
| 1683 | ret = tcp_v4_do_rcv(sk, skb); | 1691 | ret = tcp_v4_do_rcv(sk, skb); |
| 1684 | } | 1692 | } |
| 1685 | } else | 1693 | } else if (unlikely(sk_add_backlog(sk, skb))) { |
| 1686 | sk_add_backlog(sk, skb); | 1694 | bh_unlock_sock(sk); |
| 1695 | NET_INC_STATS_BH(net, LINUX_MIB_TCPBACKLOGDROP); | ||
| 1696 | goto discard_and_relse; | ||
| 1697 | } | ||
| 1687 | bh_unlock_sock(sk); | 1698 | bh_unlock_sock(sk); |
| 1688 | 1699 | ||
| 1689 | sock_put(sk); | 1700 | sock_put(sk); |
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index f206ee5dda80..5fabff9ac6d6 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
| 22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
| 23 | #include <linux/slab.h> | ||
| 23 | #include <linux/sysctl.h> | 24 | #include <linux/sysctl.h> |
| 24 | #include <linux/workqueue.h> | 25 | #include <linux/workqueue.h> |
| 25 | #include <net/tcp.h> | 26 | #include <net/tcp.h> |
| @@ -728,7 +729,7 @@ int tcp_child_process(struct sock *parent, struct sock *child, | |||
| 728 | * in main socket hash table and lock on listening | 729 | * in main socket hash table and lock on listening |
| 729 | * socket does not protect us more. | 730 | * socket does not protect us more. |
| 730 | */ | 731 | */ |
| 731 | sk_add_backlog(child, skb); | 732 | __sk_add_backlog(child, skb); |
| 732 | } | 733 | } |
| 733 | 734 | ||
| 734 | bh_unlock_sock(child); | 735 | bh_unlock_sock(child); |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 4a1605d3f909..0dda86e72ad8 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | #include <net/tcp.h> | 37 | #include <net/tcp.h> |
| 38 | 38 | ||
| 39 | #include <linux/compiler.h> | 39 | #include <linux/compiler.h> |
| 40 | #include <linux/gfp.h> | ||
| 40 | #include <linux/module.h> | 41 | #include <linux/module.h> |
| 41 | 42 | ||
| 42 | /* People can turn this off for buggy TCP's found in printers etc. */ | 43 | /* People can turn this off for buggy TCP's found in printers etc. */ |
| @@ -2395,13 +2396,17 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, | |||
| 2395 | struct tcp_extend_values *xvp = tcp_xv(rvp); | 2396 | struct tcp_extend_values *xvp = tcp_xv(rvp); |
| 2396 | struct inet_request_sock *ireq = inet_rsk(req); | 2397 | struct inet_request_sock *ireq = inet_rsk(req); |
| 2397 | struct tcp_sock *tp = tcp_sk(sk); | 2398 | struct tcp_sock *tp = tcp_sk(sk); |
| 2399 | const struct tcp_cookie_values *cvp = tp->cookie_values; | ||
| 2398 | struct tcphdr *th; | 2400 | struct tcphdr *th; |
| 2399 | struct sk_buff *skb; | 2401 | struct sk_buff *skb; |
| 2400 | struct tcp_md5sig_key *md5; | 2402 | struct tcp_md5sig_key *md5; |
| 2401 | int tcp_header_size; | 2403 | int tcp_header_size; |
| 2402 | int mss; | 2404 | int mss; |
| 2405 | int s_data_desired = 0; | ||
| 2403 | 2406 | ||
| 2404 | skb = sock_wmalloc(sk, MAX_TCP_HEADER + 15, 1, GFP_ATOMIC); | 2407 | if (cvp != NULL && cvp->s_data_constant && cvp->s_data_desired) |
| 2408 | s_data_desired = cvp->s_data_desired; | ||
| 2409 | skb = sock_wmalloc(sk, MAX_TCP_HEADER + 15 + s_data_desired, 1, GFP_ATOMIC); | ||
| 2405 | if (skb == NULL) | 2410 | if (skb == NULL) |
| 2406 | return NULL; | 2411 | return NULL; |
| 2407 | 2412 | ||
| @@ -2457,16 +2462,12 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, | |||
| 2457 | TCPCB_FLAG_SYN | TCPCB_FLAG_ACK); | 2462 | TCPCB_FLAG_SYN | TCPCB_FLAG_ACK); |
| 2458 | 2463 | ||
| 2459 | if (OPTION_COOKIE_EXTENSION & opts.options) { | 2464 | if (OPTION_COOKIE_EXTENSION & opts.options) { |
| 2460 | const struct tcp_cookie_values *cvp = tp->cookie_values; | 2465 | if (s_data_desired) { |
| 2461 | 2466 | u8 *buf = skb_put(skb, s_data_desired); | |
| 2462 | if (cvp != NULL && | ||
| 2463 | cvp->s_data_constant && | ||
| 2464 | cvp->s_data_desired > 0) { | ||
| 2465 | u8 *buf = skb_put(skb, cvp->s_data_desired); | ||
| 2466 | 2467 | ||
| 2467 | /* copy data directly from the listening socket. */ | 2468 | /* copy data directly from the listening socket. */ |
| 2468 | memcpy(buf, cvp->s_data_payload, cvp->s_data_desired); | 2469 | memcpy(buf, cvp->s_data_payload, s_data_desired); |
| 2469 | TCP_SKB_CB(skb)->end_seq += cvp->s_data_desired; | 2470 | TCP_SKB_CB(skb)->end_seq += s_data_desired; |
| 2470 | } | 2471 | } |
| 2471 | 2472 | ||
| 2472 | if (opts.hash_size > 0) { | 2473 | if (opts.hash_size > 0) { |
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c index 9bc805df95d2..f8efada580e8 100644 --- a/net/ipv4/tcp_probe.c +++ b/net/ipv4/tcp_probe.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/kprobes.h> | 22 | #include <linux/kprobes.h> |
| 23 | #include <linux/socket.h> | 23 | #include <linux/socket.h> |
| 24 | #include <linux/tcp.h> | 24 | #include <linux/tcp.h> |
| 25 | #include <linux/slab.h> | ||
| 25 | #include <linux/proc_fs.h> | 26 | #include <linux/proc_fs.h> |
| 26 | #include <linux/module.h> | 27 | #include <linux/module.h> |
| 27 | #include <linux/ktime.h> | 28 | #include <linux/ktime.h> |
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index a17629b8912e..8a0ab2977f1f 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | */ | 19 | */ |
| 20 | 20 | ||
| 21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
| 22 | #include <linux/gfp.h> | ||
| 22 | #include <net/tcp.h> | 23 | #include <net/tcp.h> |
| 23 | 24 | ||
| 24 | int sysctl_tcp_syn_retries __read_mostly = TCP_SYN_RETRIES; | 25 | int sysctl_tcp_syn_retries __read_mostly = TCP_SYN_RETRIES; |
| @@ -134,7 +135,7 @@ static void tcp_mtu_probing(struct inet_connection_sock *icsk, struct sock *sk) | |||
| 134 | } | 135 | } |
| 135 | 136 | ||
| 136 | /* This function calculates a "timeout" which is equivalent to the timeout of a | 137 | /* This function calculates a "timeout" which is equivalent to the timeout of a |
| 137 | * TCP connection after "boundary" unsucessful, exponentially backed-off | 138 | * TCP connection after "boundary" unsuccessful, exponentially backed-off |
| 138 | * retransmissions with an initial RTO of TCP_RTO_MIN. | 139 | * retransmissions with an initial RTO of TCP_RTO_MIN. |
| 139 | */ | 140 | */ |
| 140 | static bool retransmits_timed_out(struct sock *sk, | 141 | static bool retransmits_timed_out(struct sock *sk, |
diff --git a/net/ipv4/tunnel4.c b/net/ipv4/tunnel4.c index 3959e0ca456a..3b3813cc80b9 100644 --- a/net/ipv4/tunnel4.c +++ b/net/ipv4/tunnel4.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <linux/mutex.h> | 8 | #include <linux/mutex.h> |
| 9 | #include <linux/netdevice.h> | 9 | #include <linux/netdevice.h> |
| 10 | #include <linux/skbuff.h> | 10 | #include <linux/skbuff.h> |
| 11 | #include <linux/slab.h> | ||
| 11 | #include <net/icmp.h> | 12 | #include <net/icmp.h> |
| 12 | #include <net/ip.h> | 13 | #include <net/ip.h> |
| 13 | #include <net/protocol.h> | 14 | #include <net/protocol.h> |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 608a5446d05b..c36522a0f113 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
| @@ -95,6 +95,7 @@ | |||
| 95 | #include <linux/mm.h> | 95 | #include <linux/mm.h> |
| 96 | #include <linux/inet.h> | 96 | #include <linux/inet.h> |
| 97 | #include <linux/netdevice.h> | 97 | #include <linux/netdevice.h> |
| 98 | #include <linux/slab.h> | ||
| 98 | #include <net/tcp_states.h> | 99 | #include <net/tcp_states.h> |
| 99 | #include <linux/skbuff.h> | 100 | #include <linux/skbuff.h> |
| 100 | #include <linux/proc_fs.h> | 101 | #include <linux/proc_fs.h> |
| @@ -471,8 +472,8 @@ static struct sock *__udp4_lib_lookup(struct net *net, __be32 saddr, | |||
| 471 | if (hslot->count < hslot2->count) | 472 | if (hslot->count < hslot2->count) |
| 472 | goto begin; | 473 | goto begin; |
| 473 | 474 | ||
| 474 | result = udp4_lib_lookup2(net, INADDR_ANY, sport, | 475 | result = udp4_lib_lookup2(net, saddr, sport, |
| 475 | daddr, hnum, dif, | 476 | INADDR_ANY, hnum, dif, |
| 476 | hslot2, slot2); | 477 | hslot2, slot2); |
| 477 | } | 478 | } |
| 478 | rcu_read_unlock(); | 479 | rcu_read_unlock(); |
| @@ -1371,8 +1372,10 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | |||
| 1371 | bh_lock_sock(sk); | 1372 | bh_lock_sock(sk); |
| 1372 | if (!sock_owned_by_user(sk)) | 1373 | if (!sock_owned_by_user(sk)) |
| 1373 | rc = __udp_queue_rcv_skb(sk, skb); | 1374 | rc = __udp_queue_rcv_skb(sk, skb); |
| 1374 | else | 1375 | else if (sk_add_backlog(sk, skb)) { |
| 1375 | sk_add_backlog(sk, skb); | 1376 | bh_unlock_sock(sk); |
| 1377 | goto drop; | ||
| 1378 | } | ||
| 1376 | bh_unlock_sock(sk); | 1379 | bh_unlock_sock(sk); |
| 1377 | 1380 | ||
| 1378 | return rc; | 1381 | return rc; |
| @@ -1524,6 +1527,9 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, | |||
| 1524 | 1527 | ||
| 1525 | uh = udp_hdr(skb); | 1528 | uh = udp_hdr(skb); |
| 1526 | ulen = ntohs(uh->len); | 1529 | ulen = ntohs(uh->len); |
| 1530 | saddr = ip_hdr(skb)->saddr; | ||
| 1531 | daddr = ip_hdr(skb)->daddr; | ||
| 1532 | |||
| 1527 | if (ulen > skb->len) | 1533 | if (ulen > skb->len) |
| 1528 | goto short_packet; | 1534 | goto short_packet; |
| 1529 | 1535 | ||
| @@ -1537,9 +1543,6 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, | |||
| 1537 | if (udp4_csum_init(skb, uh, proto)) | 1543 | if (udp4_csum_init(skb, uh, proto)) |
| 1538 | goto csum_error; | 1544 | goto csum_error; |
| 1539 | 1545 | ||
| 1540 | saddr = ip_hdr(skb)->saddr; | ||
| 1541 | daddr = ip_hdr(skb)->daddr; | ||
| 1542 | |||
| 1543 | if (rt->rt_flags & (RTCF_BROADCAST|RTCF_MULTICAST)) | 1546 | if (rt->rt_flags & (RTCF_BROADCAST|RTCF_MULTICAST)) |
| 1544 | return __udp4_lib_mcast_deliver(net, skb, uh, | 1547 | return __udp4_lib_mcast_deliver(net, skb, uh, |
| 1545 | saddr, daddr, udptable); | 1548 | saddr, daddr, udptable); |
diff --git a/net/ipv4/xfrm4_input.c b/net/ipv4/xfrm4_input.c index f9f922a0ba88..c791bb63203f 100644 --- a/net/ipv4/xfrm4_input.c +++ b/net/ipv4/xfrm4_input.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | * | 9 | * |
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/slab.h> | ||
| 12 | #include <linux/module.h> | 13 | #include <linux/module.h> |
| 13 | #include <linux/string.h> | 14 | #include <linux/string.h> |
| 14 | #include <linux/netfilter.h> | 15 | #include <linux/netfilter.h> |
diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c index 3444f3b34eca..6f368413eb0e 100644 --- a/net/ipv4/xfrm4_mode_tunnel.c +++ b/net/ipv4/xfrm4_mode_tunnel.c | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | * Copyright (c) 2004-2006 Herbert Xu <herbert@gondor.apana.org.au> | 4 | * Copyright (c) 2004-2006 Herbert Xu <herbert@gondor.apana.org.au> |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #include <linux/gfp.h> | ||
| 7 | #include <linux/init.h> | 8 | #include <linux/init.h> |
| 8 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
| 9 | #include <linux/module.h> | 10 | #include <linux/module.h> |
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index 67107d63c1cd..e4a1483fba77 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/net/ipv4/xfrm4_policy.c | |||
| @@ -91,11 +91,12 @@ static int xfrm4_init_path(struct xfrm_dst *path, struct dst_entry *dst, | |||
| 91 | return 0; | 91 | return 0; |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | static int xfrm4_fill_dst(struct xfrm_dst *xdst, struct net_device *dev) | 94 | static int xfrm4_fill_dst(struct xfrm_dst *xdst, struct net_device *dev, |
| 95 | struct flowi *fl) | ||
| 95 | { | 96 | { |
| 96 | struct rtable *rt = (struct rtable *)xdst->route; | 97 | struct rtable *rt = (struct rtable *)xdst->route; |
| 97 | 98 | ||
| 98 | xdst->u.rt.fl = rt->fl; | 99 | xdst->u.rt.fl = *fl; |
| 99 | 100 | ||
| 100 | xdst->u.dst.dev = dev; | 101 | xdst->u.dst.dev = dev; |
| 101 | dev_hold(dev); | 102 | dev_hold(dev); |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 88fd8c5877ee..413054f02aab 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
| @@ -53,6 +53,7 @@ | |||
| 53 | #include <linux/route.h> | 53 | #include <linux/route.h> |
| 54 | #include <linux/inetdevice.h> | 54 | #include <linux/inetdevice.h> |
| 55 | #include <linux/init.h> | 55 | #include <linux/init.h> |
| 56 | #include <linux/slab.h> | ||
| 56 | #ifdef CONFIG_SYSCTL | 57 | #ifdef CONFIG_SYSCTL |
| 57 | #include <linux/sysctl.h> | 58 | #include <linux/sysctl.h> |
| 58 | #endif | 59 | #endif |
| @@ -1380,6 +1381,8 @@ static void addrconf_dad_stop(struct inet6_ifaddr *ifp, int dad_failed) | |||
| 1380 | if (dad_failed) | 1381 | if (dad_failed) |
| 1381 | ifp->flags |= IFA_F_DADFAILED; | 1382 | ifp->flags |= IFA_F_DADFAILED; |
| 1382 | spin_unlock_bh(&ifp->lock); | 1383 | spin_unlock_bh(&ifp->lock); |
| 1384 | if (dad_failed) | ||
| 1385 | ipv6_ifa_notify(0, ifp); | ||
| 1383 | in6_ifa_put(ifp); | 1386 | in6_ifa_put(ifp); |
| 1384 | #ifdef CONFIG_IPV6_PRIVACY | 1387 | #ifdef CONFIG_IPV6_PRIVACY |
| 1385 | } else if (ifp->flags&IFA_F_TEMPORARY) { | 1388 | } else if (ifp->flags&IFA_F_TEMPORARY) { |
| @@ -2615,7 +2618,7 @@ static void addrconf_bonding_change(struct net_device *dev, unsigned long event) | |||
| 2615 | static int addrconf_ifdown(struct net_device *dev, int how) | 2618 | static int addrconf_ifdown(struct net_device *dev, int how) |
| 2616 | { | 2619 | { |
| 2617 | struct inet6_dev *idev; | 2620 | struct inet6_dev *idev; |
| 2618 | struct inet6_ifaddr *ifa, **bifa; | 2621 | struct inet6_ifaddr *ifa, *keep_list, **bifa; |
| 2619 | struct net *net = dev_net(dev); | 2622 | struct net *net = dev_net(dev); |
| 2620 | int i; | 2623 | int i; |
| 2621 | 2624 | ||
| @@ -2649,11 +2652,11 @@ static int addrconf_ifdown(struct net_device *dev, int how) | |||
| 2649 | write_lock_bh(&addrconf_hash_lock); | 2652 | write_lock_bh(&addrconf_hash_lock); |
| 2650 | while ((ifa = *bifa) != NULL) { | 2653 | while ((ifa = *bifa) != NULL) { |
| 2651 | if (ifa->idev == idev && | 2654 | if (ifa->idev == idev && |
| 2652 | (how || !(ifa->flags&IFA_F_PERMANENT))) { | 2655 | (how || !(ifa->flags&IFA_F_PERMANENT) || |
| 2656 | ipv6_addr_type(&ifa->addr) & IPV6_ADDR_LINKLOCAL)) { | ||
| 2653 | *bifa = ifa->lst_next; | 2657 | *bifa = ifa->lst_next; |
| 2654 | ifa->lst_next = NULL; | 2658 | ifa->lst_next = NULL; |
| 2655 | addrconf_del_timer(ifa); | 2659 | __in6_ifa_put(ifa); |
| 2656 | in6_ifa_put(ifa); | ||
| 2657 | continue; | 2660 | continue; |
| 2658 | } | 2661 | } |
| 2659 | bifa = &ifa->lst_next; | 2662 | bifa = &ifa->lst_next; |
| @@ -2689,31 +2692,51 @@ static int addrconf_ifdown(struct net_device *dev, int how) | |||
| 2689 | write_lock_bh(&idev->lock); | 2692 | write_lock_bh(&idev->lock); |
| 2690 | } | 2693 | } |
| 2691 | #endif | 2694 | #endif |
| 2692 | bifa = &idev->addr_list; | 2695 | keep_list = NULL; |
| 2693 | while ((ifa = *bifa) != NULL) { | 2696 | bifa = &keep_list; |
| 2694 | if (how == 0 && (ifa->flags&IFA_F_PERMANENT)) { | 2697 | while ((ifa = idev->addr_list) != NULL) { |
| 2695 | /* Retain permanent address on admin down */ | 2698 | idev->addr_list = ifa->if_next; |
| 2699 | ifa->if_next = NULL; | ||
| 2700 | |||
| 2701 | addrconf_del_timer(ifa); | ||
| 2702 | |||
| 2703 | /* If just doing link down, and address is permanent | ||
| 2704 | and not link-local, then retain it. */ | ||
| 2705 | if (how == 0 && | ||
| 2706 | (ifa->flags&IFA_F_PERMANENT) && | ||
| 2707 | !(ipv6_addr_type(&ifa->addr) & IPV6_ADDR_LINKLOCAL)) { | ||
| 2708 | |||
| 2709 | /* Move to holding list */ | ||
| 2710 | *bifa = ifa; | ||
| 2696 | bifa = &ifa->if_next; | 2711 | bifa = &ifa->if_next; |
| 2697 | 2712 | ||
| 2698 | /* Restart DAD if needed when link comes back up */ | 2713 | /* If not doing DAD on this address, just keep it. */ |
| 2699 | if ( !((dev->flags&(IFF_NOARP|IFF_LOOPBACK)) || | 2714 | if ((dev->flags&(IFF_NOARP|IFF_LOOPBACK)) || |
| 2700 | idev->cnf.accept_dad <= 0 || | 2715 | idev->cnf.accept_dad <= 0 || |
| 2701 | (ifa->flags & IFA_F_NODAD))) | 2716 | (ifa->flags & IFA_F_NODAD)) |
| 2702 | ifa->flags |= IFA_F_TENTATIVE; | 2717 | continue; |
| 2703 | } else { | ||
| 2704 | *bifa = ifa->if_next; | ||
| 2705 | ifa->if_next = NULL; | ||
| 2706 | 2718 | ||
| 2719 | /* If it was tentative already, no need to notify */ | ||
| 2720 | if (ifa->flags & IFA_F_TENTATIVE) | ||
| 2721 | continue; | ||
| 2722 | |||
| 2723 | /* Flag it for later restoration when link comes up */ | ||
| 2724 | ifa->flags |= IFA_F_TENTATIVE; | ||
| 2725 | in6_ifa_hold(ifa); | ||
| 2726 | } else { | ||
| 2707 | ifa->dead = 1; | 2727 | ifa->dead = 1; |
| 2708 | write_unlock_bh(&idev->lock); | 2728 | } |
| 2729 | write_unlock_bh(&idev->lock); | ||
| 2709 | 2730 | ||
| 2710 | __ipv6_ifa_notify(RTM_DELADDR, ifa); | 2731 | __ipv6_ifa_notify(RTM_DELADDR, ifa); |
| 2711 | atomic_notifier_call_chain(&inet6addr_chain, NETDEV_DOWN, ifa); | 2732 | atomic_notifier_call_chain(&inet6addr_chain, NETDEV_DOWN, ifa); |
| 2712 | in6_ifa_put(ifa); | 2733 | in6_ifa_put(ifa); |
| 2713 | 2734 | ||
| 2714 | write_lock_bh(&idev->lock); | 2735 | write_lock_bh(&idev->lock); |
| 2715 | } | ||
| 2716 | } | 2736 | } |
| 2737 | |||
| 2738 | idev->addr_list = keep_list; | ||
| 2739 | |||
| 2717 | write_unlock_bh(&idev->lock); | 2740 | write_unlock_bh(&idev->lock); |
| 2718 | 2741 | ||
| 2719 | /* Step 5: Discard multicast list */ | 2742 | /* Step 5: Discard multicast list */ |
| @@ -2739,28 +2762,29 @@ static int addrconf_ifdown(struct net_device *dev, int how) | |||
| 2739 | static void addrconf_rs_timer(unsigned long data) | 2762 | static void addrconf_rs_timer(unsigned long data) |
| 2740 | { | 2763 | { |
| 2741 | struct inet6_ifaddr *ifp = (struct inet6_ifaddr *) data; | 2764 | struct inet6_ifaddr *ifp = (struct inet6_ifaddr *) data; |
| 2765 | struct inet6_dev *idev = ifp->idev; | ||
| 2742 | 2766 | ||
| 2743 | if (ifp->idev->cnf.forwarding) | 2767 | read_lock(&idev->lock); |
| 2768 | if (idev->dead || !(idev->if_flags & IF_READY)) | ||
| 2744 | goto out; | 2769 | goto out; |
| 2745 | 2770 | ||
| 2746 | if (ifp->idev->if_flags & IF_RA_RCVD) { | 2771 | if (idev->cnf.forwarding) |
| 2747 | /* | 2772 | goto out; |
| 2748 | * Announcement received after solicitation | 2773 | |
| 2749 | * was sent | 2774 | /* Announcement received after solicitation was sent */ |
| 2750 | */ | 2775 | if (idev->if_flags & IF_RA_RCVD) |
| 2751 | goto out; | 2776 | goto out; |
| 2752 | } | ||
| 2753 | 2777 | ||
| 2754 | spin_lock(&ifp->lock); | 2778 | spin_lock(&ifp->lock); |
| 2755 | if (ifp->probes++ < ifp->idev->cnf.rtr_solicits) { | 2779 | if (ifp->probes++ < idev->cnf.rtr_solicits) { |
| 2756 | /* The wait after the last probe can be shorter */ | 2780 | /* The wait after the last probe can be shorter */ |
| 2757 | addrconf_mod_timer(ifp, AC_RS, | 2781 | addrconf_mod_timer(ifp, AC_RS, |
| 2758 | (ifp->probes == ifp->idev->cnf.rtr_solicits) ? | 2782 | (ifp->probes == idev->cnf.rtr_solicits) ? |
| 2759 | ifp->idev->cnf.rtr_solicit_delay : | 2783 | idev->cnf.rtr_solicit_delay : |
| 2760 | ifp->idev->cnf.rtr_solicit_interval); | 2784 | idev->cnf.rtr_solicit_interval); |
| 2761 | spin_unlock(&ifp->lock); | 2785 | spin_unlock(&ifp->lock); |
| 2762 | 2786 | ||
| 2763 | ndisc_send_rs(ifp->idev->dev, &ifp->addr, &in6addr_linklocal_allrouters); | 2787 | ndisc_send_rs(idev->dev, &ifp->addr, &in6addr_linklocal_allrouters); |
| 2764 | } else { | 2788 | } else { |
| 2765 | spin_unlock(&ifp->lock); | 2789 | spin_unlock(&ifp->lock); |
| 2766 | /* | 2790 | /* |
| @@ -2768,10 +2792,11 @@ static void addrconf_rs_timer(unsigned long data) | |||
| 2768 | * assumption any longer. | 2792 | * assumption any longer. |
| 2769 | */ | 2793 | */ |
| 2770 | printk(KERN_DEBUG "%s: no IPv6 routers present\n", | 2794 | printk(KERN_DEBUG "%s: no IPv6 routers present\n", |
| 2771 | ifp->idev->dev->name); | 2795 | idev->dev->name); |
| 2772 | } | 2796 | } |
| 2773 | 2797 | ||
| 2774 | out: | 2798 | out: |
| 2799 | read_unlock(&idev->lock); | ||
| 2775 | in6_ifa_put(ifp); | 2800 | in6_ifa_put(ifp); |
| 2776 | } | 2801 | } |
| 2777 | 2802 | ||
| @@ -2850,9 +2875,9 @@ static void addrconf_dad_timer(unsigned long data) | |||
| 2850 | struct inet6_dev *idev = ifp->idev; | 2875 | struct inet6_dev *idev = ifp->idev; |
| 2851 | struct in6_addr mcaddr; | 2876 | struct in6_addr mcaddr; |
| 2852 | 2877 | ||
| 2853 | read_lock_bh(&idev->lock); | 2878 | read_lock(&idev->lock); |
| 2854 | if (idev->dead) { | 2879 | if (idev->dead || !(idev->if_flags & IF_READY)) { |
| 2855 | read_unlock_bh(&idev->lock); | 2880 | read_unlock(&idev->lock); |
| 2856 | goto out; | 2881 | goto out; |
| 2857 | } | 2882 | } |
| 2858 | 2883 | ||
| @@ -2864,7 +2889,7 @@ static void addrconf_dad_timer(unsigned long data) | |||
| 2864 | 2889 | ||
| 2865 | ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC|IFA_F_DADFAILED); | 2890 | ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC|IFA_F_DADFAILED); |
| 2866 | spin_unlock(&ifp->lock); | 2891 | spin_unlock(&ifp->lock); |
| 2867 | read_unlock_bh(&idev->lock); | 2892 | read_unlock(&idev->lock); |
| 2868 | 2893 | ||
| 2869 | addrconf_dad_completed(ifp); | 2894 | addrconf_dad_completed(ifp); |
| 2870 | 2895 | ||
| @@ -2874,7 +2899,7 @@ static void addrconf_dad_timer(unsigned long data) | |||
| 2874 | ifp->probes--; | 2899 | ifp->probes--; |
| 2875 | addrconf_mod_timer(ifp, AC_DAD, ifp->idev->nd_parms->retrans_time); | 2900 | addrconf_mod_timer(ifp, AC_DAD, ifp->idev->nd_parms->retrans_time); |
| 2876 | spin_unlock(&ifp->lock); | 2901 | spin_unlock(&ifp->lock); |
| 2877 | read_unlock_bh(&idev->lock); | 2902 | read_unlock(&idev->lock); |
| 2878 | 2903 | ||
| 2879 | /* send a neighbour solicitation for our addr */ | 2904 | /* send a neighbour solicitation for our addr */ |
| 2880 | addrconf_addr_solict_mult(&ifp->addr, &mcaddr); | 2905 | addrconf_addr_solict_mult(&ifp->addr, &mcaddr); |
| @@ -3586,7 +3611,7 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb, | |||
| 3586 | hlist_for_each_entry_rcu(dev, node, head, index_hlist) { | 3611 | hlist_for_each_entry_rcu(dev, node, head, index_hlist) { |
| 3587 | if (idx < s_idx) | 3612 | if (idx < s_idx) |
| 3588 | goto cont; | 3613 | goto cont; |
| 3589 | if (idx > s_idx) | 3614 | if (h > s_h || idx > s_idx) |
| 3590 | s_ip_idx = 0; | 3615 | s_ip_idx = 0; |
| 3591 | ip_idx = 0; | 3616 | ip_idx = 0; |
| 3592 | if ((idev = __in6_dev_get(dev)) == NULL) | 3617 | if ((idev = __in6_dev_get(dev)) == NULL) |
diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c index 6ff73c4c126a..ae404c9a746c 100644 --- a/net/ipv6/addrlabel.c +++ b/net/ipv6/addrlabel.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/list.h> | 13 | #include <linux/list.h> |
| 14 | #include <linux/rcupdate.h> | 14 | #include <linux/rcupdate.h> |
| 15 | #include <linux/in6.h> | 15 | #include <linux/in6.h> |
| 16 | #include <linux/slab.h> | ||
| 16 | #include <net/addrconf.h> | 17 | #include <net/addrconf.h> |
| 17 | #include <linux/if_addrlabel.h> | 18 | #include <linux/if_addrlabel.h> |
| 18 | #include <linux/netlink.h> | 19 | #include <linux/netlink.h> |
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 37d14e735c27..3f9e86b15e0d 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/proc_fs.h> | 36 | #include <linux/proc_fs.h> |
| 37 | #include <linux/stat.h> | 37 | #include <linux/stat.h> |
| 38 | #include <linux/init.h> | 38 | #include <linux/init.h> |
| 39 | #include <linux/slab.h> | ||
| 39 | 40 | ||
| 40 | #include <linux/inet.h> | 41 | #include <linux/inet.h> |
| 41 | #include <linux/netdevice.h> | 42 | #include <linux/netdevice.h> |
| @@ -199,7 +200,7 @@ lookup_protocol: | |||
| 199 | 200 | ||
| 200 | inet_sk(sk)->pinet6 = np = inet6_sk_generic(sk); | 201 | inet_sk(sk)->pinet6 = np = inet6_sk_generic(sk); |
| 201 | np->hop_limit = -1; | 202 | np->hop_limit = -1; |
| 202 | np->mcast_hops = -1; | 203 | np->mcast_hops = IPV6_DEFAULT_MCASTHOPS; |
| 203 | np->mc_loop = 1; | 204 | np->mc_loop = 1; |
| 204 | np->pmtudisc = IPV6_PMTUDISC_WANT; | 205 | np->pmtudisc = IPV6_PMTUDISC_WANT; |
| 205 | np->ipv6only = net->ipv6.sysctl.bindv6only; | 206 | np->ipv6only = net->ipv6.sysctl.bindv6only; |
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c index 5ac89025f9de..ee82d4ef26ce 100644 --- a/net/ipv6/ah6.c +++ b/net/ipv6/ah6.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | 26 | ||
| 27 | #include <crypto/hash.h> | 27 | #include <crypto/hash.h> |
| 28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
| 29 | #include <linux/slab.h> | ||
| 29 | #include <net/ip.h> | 30 | #include <net/ip.h> |
| 30 | #include <net/ah.h> | 31 | #include <net/ah.h> |
| 31 | #include <linux/crypto.h> | 32 | #include <linux/crypto.h> |
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c index c4f6ca32fa74..b5b07054508a 100644 --- a/net/ipv6/anycast.c +++ b/net/ipv6/anycast.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/init.h> | 29 | #include <linux/init.h> |
| 30 | #include <linux/proc_fs.h> | 30 | #include <linux/proc_fs.h> |
| 31 | #include <linux/seq_file.h> | 31 | #include <linux/seq_file.h> |
| 32 | #include <linux/slab.h> | ||
| 32 | 33 | ||
| 33 | #include <net/net_namespace.h> | 34 | #include <net/net_namespace.h> |
| 34 | #include <net/sock.h> | 35 | #include <net/sock.h> |
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index e6f9cdf780fe..61573885e451 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/in6.h> | 21 | #include <linux/in6.h> |
| 22 | #include <linux/ipv6.h> | 22 | #include <linux/ipv6.h> |
| 23 | #include <linux/route.h> | 23 | #include <linux/route.h> |
| 24 | #include <linux/slab.h> | ||
| 24 | 25 | ||
| 25 | #include <net/ipv6.h> | 26 | #include <net/ipv6.h> |
| 26 | #include <net/ndisc.h> | 27 | #include <net/ndisc.h> |
| @@ -221,6 +222,8 @@ void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, | |||
| 221 | if (!skb) | 222 | if (!skb) |
| 222 | return; | 223 | return; |
| 223 | 224 | ||
| 225 | skb->protocol = htons(ETH_P_IPV6); | ||
| 226 | |||
| 224 | serr = SKB_EXT_ERR(skb); | 227 | serr = SKB_EXT_ERR(skb); |
| 225 | serr->ee.ee_errno = err; | 228 | serr->ee.ee_errno = err; |
| 226 | serr->ee.ee_origin = SO_EE_ORIGIN_ICMP6; | 229 | serr->ee.ee_origin = SO_EE_ORIGIN_ICMP6; |
| @@ -254,6 +257,8 @@ void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info) | |||
| 254 | if (!skb) | 257 | if (!skb) |
| 255 | return; | 258 | return; |
| 256 | 259 | ||
| 260 | skb->protocol = htons(ETH_P_IPV6); | ||
| 261 | |||
| 257 | skb_put(skb, sizeof(struct ipv6hdr)); | 262 | skb_put(skb, sizeof(struct ipv6hdr)); |
| 258 | skb_reset_network_header(skb); | 263 | skb_reset_network_header(skb); |
| 259 | iph = ipv6_hdr(skb); | 264 | iph = ipv6_hdr(skb); |
| @@ -318,7 +323,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len) | |||
| 318 | sin->sin6_flowinfo = 0; | 323 | sin->sin6_flowinfo = 0; |
| 319 | sin->sin6_port = serr->port; | 324 | sin->sin6_port = serr->port; |
| 320 | sin->sin6_scope_id = 0; | 325 | sin->sin6_scope_id = 0; |
| 321 | if (serr->ee.ee_origin == SO_EE_ORIGIN_ICMP6) { | 326 | if (skb->protocol == htons(ETH_P_IPV6)) { |
| 322 | ipv6_addr_copy(&sin->sin6_addr, | 327 | ipv6_addr_copy(&sin->sin6_addr, |
| 323 | (struct in6_addr *)(nh + serr->addr_offset)); | 328 | (struct in6_addr *)(nh + serr->addr_offset)); |
| 324 | if (np->sndflow) | 329 | if (np->sndflow) |
| @@ -340,7 +345,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len) | |||
| 340 | sin->sin6_family = AF_INET6; | 345 | sin->sin6_family = AF_INET6; |
| 341 | sin->sin6_flowinfo = 0; | 346 | sin->sin6_flowinfo = 0; |
| 342 | sin->sin6_scope_id = 0; | 347 | sin->sin6_scope_id = 0; |
| 343 | if (serr->ee.ee_origin == SO_EE_ORIGIN_ICMP6) { | 348 | if (skb->protocol == htons(ETH_P_IPV6)) { |
| 344 | ipv6_addr_copy(&sin->sin6_addr, &ipv6_hdr(skb)->saddr); | 349 | ipv6_addr_copy(&sin->sin6_addr, &ipv6_hdr(skb)->saddr); |
| 345 | if (np->rxopt.all) | 350 | if (np->rxopt.all) |
| 346 | datagram_recv_ctl(sk, msg, skb); | 351 | datagram_recv_ctl(sk, msg, skb); |
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index 074f2c084f9f..8a659f92d17a 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/netdevice.h> | 29 | #include <linux/netdevice.h> |
| 30 | #include <linux/in6.h> | 30 | #include <linux/in6.h> |
| 31 | #include <linux/icmpv6.h> | 31 | #include <linux/icmpv6.h> |
| 32 | #include <linux/slab.h> | ||
| 32 | 33 | ||
| 33 | #include <net/dst.h> | 34 | #include <net/dst.h> |
| 34 | #include <net/sock.h> | 35 | #include <net/sock.h> |
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c index 551882b9dfd6..5e463c43fcc2 100644 --- a/net/ipv6/fib6_rules.c +++ b/net/ipv6/fib6_rules.c | |||
| @@ -84,18 +84,11 @@ static int fib6_rule_action(struct fib_rule *rule, struct flowi *flp, | |||
| 84 | if ((rule->flags & FIB_RULE_FIND_SADDR) && | 84 | if ((rule->flags & FIB_RULE_FIND_SADDR) && |
| 85 | r->src.plen && !(flags & RT6_LOOKUP_F_HAS_SADDR)) { | 85 | r->src.plen && !(flags & RT6_LOOKUP_F_HAS_SADDR)) { |
| 86 | struct in6_addr saddr; | 86 | struct in6_addr saddr; |
| 87 | unsigned int srcprefs = 0; | ||
| 88 | |||
| 89 | if (flags & RT6_LOOKUP_F_SRCPREF_TMP) | ||
| 90 | srcprefs |= IPV6_PREFER_SRC_TMP; | ||
| 91 | if (flags & RT6_LOOKUP_F_SRCPREF_PUBLIC) | ||
| 92 | srcprefs |= IPV6_PREFER_SRC_PUBLIC; | ||
| 93 | if (flags & RT6_LOOKUP_F_SRCPREF_COA) | ||
| 94 | srcprefs |= IPV6_PREFER_SRC_COA; | ||
| 95 | 87 | ||
| 96 | if (ipv6_dev_get_saddr(net, | 88 | if (ipv6_dev_get_saddr(net, |
| 97 | ip6_dst_idev(&rt->u.dst)->dev, | 89 | ip6_dst_idev(&rt->u.dst)->dev, |
| 98 | &flp->fl6_dst, srcprefs, | 90 | &flp->fl6_dst, |
| 91 | rt6_flags2srcprefs(flags), | ||
| 99 | &saddr)) | 92 | &saddr)) |
| 100 | goto again; | 93 | goto again; |
| 101 | if (!ipv6_prefix_equal(&saddr, &r->src.addr, | 94 | if (!ipv6_prefix_equal(&saddr, &r->src.addr, |
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index eb9abe24bdf0..3330a4bd6157 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c | |||
| @@ -40,6 +40,7 @@ | |||
| 40 | #include <linux/skbuff.h> | 40 | #include <linux/skbuff.h> |
| 41 | #include <linux/init.h> | 41 | #include <linux/init.h> |
| 42 | #include <linux/netfilter.h> | 42 | #include <linux/netfilter.h> |
| 43 | #include <linux/slab.h> | ||
| 43 | 44 | ||
| 44 | #ifdef CONFIG_SYSCTL | 45 | #ifdef CONFIG_SYSCTL |
| 45 | #include <linux/sysctl.h> | 46 | #include <linux/sysctl.h> |
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c index 3516e6fe2e56..628db24bcf22 100644 --- a/net/ipv6/inet6_connection_sock.c +++ b/net/ipv6/inet6_connection_sock.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/in6.h> | 17 | #include <linux/in6.h> |
| 18 | #include <linux/ipv6.h> | 18 | #include <linux/ipv6.h> |
| 19 | #include <linux/jhash.h> | 19 | #include <linux/jhash.h> |
| 20 | #include <linux/slab.h> | ||
| 20 | 21 | ||
| 21 | #include <net/addrconf.h> | 22 | #include <net/addrconf.h> |
| 22 | #include <net/inet_connection_sock.h> | 23 | #include <net/inet_connection_sock.h> |
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 2f9847924fa5..6b82e02158c6 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/in6.h> | 26 | #include <linux/in6.h> |
| 27 | #include <linux/init.h> | 27 | #include <linux/init.h> |
| 28 | #include <linux/list.h> | 28 | #include <linux/list.h> |
| 29 | #include <linux/slab.h> | ||
| 29 | 30 | ||
| 30 | #ifdef CONFIG_PROC_FS | 31 | #ifdef CONFIG_PROC_FS |
| 31 | #include <linux/proc_fs.h> | 32 | #include <linux/proc_fs.h> |
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c index e41eba8aacf1..14e23216eb28 100644 --- a/net/ipv6/ip6_flowlabel.c +++ b/net/ipv6/ip6_flowlabel.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/route.h> | 20 | #include <linux/route.h> |
| 21 | #include <linux/proc_fs.h> | 21 | #include <linux/proc_fs.h> |
| 22 | #include <linux/seq_file.h> | 22 | #include <linux/seq_file.h> |
| 23 | #include <linux/slab.h> | ||
| 23 | 24 | ||
| 24 | #include <net/net_namespace.h> | 25 | #include <net/net_namespace.h> |
| 25 | #include <net/sock.h> | 26 | #include <net/sock.h> |
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c index e28f9203deca..6aa7ee1295c2 100644 --- a/net/ipv6/ip6_input.c +++ b/net/ipv6/ip6_input.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/in6.h> | 28 | #include <linux/in6.h> |
| 29 | #include <linux/icmpv6.h> | 29 | #include <linux/icmpv6.h> |
| 30 | #include <linux/mroute6.h> | 30 | #include <linux/mroute6.h> |
| 31 | #include <linux/slab.h> | ||
| 31 | 32 | ||
| 32 | #include <linux/netfilter.h> | 33 | #include <linux/netfilter.h> |
| 33 | #include <linux/netfilter_ipv6.h> | 34 | #include <linux/netfilter_ipv6.h> |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index dabf108ad811..75d5ef830097 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | #include <linux/tcp.h> | 37 | #include <linux/tcp.h> |
| 38 | #include <linux/route.h> | 38 | #include <linux/route.h> |
| 39 | #include <linux/module.h> | 39 | #include <linux/module.h> |
| 40 | #include <linux/slab.h> | ||
| 40 | 41 | ||
| 41 | #include <linux/netfilter.h> | 42 | #include <linux/netfilter.h> |
| 42 | #include <linux/netfilter_ipv6.h> | 43 | #include <linux/netfilter_ipv6.h> |
| @@ -107,7 +108,7 @@ static int ip6_dev_loopback_xmit(struct sk_buff *newskb) | |||
| 107 | newskb->ip_summed = CHECKSUM_UNNECESSARY; | 108 | newskb->ip_summed = CHECKSUM_UNNECESSARY; |
| 108 | WARN_ON(!skb_dst(newskb)); | 109 | WARN_ON(!skb_dst(newskb)); |
| 109 | 110 | ||
| 110 | netif_rx(newskb); | 111 | netif_rx_ni(newskb); |
| 111 | return 0; | 112 | return 0; |
| 112 | } | 113 | } |
| 113 | 114 | ||
| @@ -628,7 +629,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) | |||
| 628 | /* We must not fragment if the socket is set to force MTU discovery | 629 | /* We must not fragment if the socket is set to force MTU discovery |
| 629 | * or if the skb it not generated by a local socket. | 630 | * or if the skb it not generated by a local socket. |
| 630 | */ | 631 | */ |
| 631 | if (!skb->local_df) { | 632 | if (!skb->local_df && skb->len > mtu) { |
| 632 | skb->dev = skb_dst(skb)->dev; | 633 | skb->dev = skb_dst(skb)->dev; |
| 633 | icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); | 634 | icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); |
| 634 | IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), | 635 | IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), |
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 138980eec214..2599870747ec 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | #include <linux/route.h> | 37 | #include <linux/route.h> |
| 38 | #include <linux/rtnetlink.h> | 38 | #include <linux/rtnetlink.h> |
| 39 | #include <linux/netfilter_ipv6.h> | 39 | #include <linux/netfilter_ipv6.h> |
| 40 | #include <linux/slab.h> | ||
| 40 | 41 | ||
| 41 | #include <asm/uaccess.h> | 42 | #include <asm/uaccess.h> |
| 42 | #include <asm/atomic.h> | 43 | #include <asm/atomic.h> |
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 52e0f74fdfe0..3e333268db89 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <linux/proc_fs.h> | 33 | #include <linux/proc_fs.h> |
| 34 | #include <linux/seq_file.h> | 34 | #include <linux/seq_file.h> |
| 35 | #include <linux/init.h> | 35 | #include <linux/init.h> |
| 36 | #include <linux/slab.h> | ||
| 36 | #include <net/protocol.h> | 37 | #include <net/protocol.h> |
| 37 | #include <linux/skbuff.h> | 38 | #include <linux/skbuff.h> |
| 38 | #include <net/sock.h> | 39 | #include <net/sock.h> |
| @@ -1113,6 +1114,9 @@ static int ip6mr_mfc_add(struct net *net, struct mf6cctl *mfc, int mrtsock) | |||
| 1113 | unsigned char ttls[MAXMIFS]; | 1114 | unsigned char ttls[MAXMIFS]; |
| 1114 | int i; | 1115 | int i; |
| 1115 | 1116 | ||
| 1117 | if (mfc->mf6cc_parent >= MAXMIFS) | ||
| 1118 | return -ENFILE; | ||
| 1119 | |||
| 1116 | memset(ttls, 255, MAXMIFS); | 1120 | memset(ttls, 255, MAXMIFS); |
| 1117 | for (i = 0; i < MAXMIFS; i++) { | 1121 | for (i = 0; i < MAXMIFS; i++) { |
| 1118 | if (IF_ISSET(i, &mfc->mf6cc_ifset)) | 1122 | if (IF_ISSET(i, &mfc->mf6cc_ifset)) |
| @@ -1692,17 +1696,20 @@ ip6mr_fill_mroute(struct sk_buff *skb, struct mfc6_cache *c, struct rtmsg *rtm) | |||
| 1692 | int ct; | 1696 | int ct; |
| 1693 | struct rtnexthop *nhp; | 1697 | struct rtnexthop *nhp; |
| 1694 | struct net *net = mfc6_net(c); | 1698 | struct net *net = mfc6_net(c); |
| 1695 | struct net_device *dev = net->ipv6.vif6_table[c->mf6c_parent].dev; | ||
| 1696 | u8 *b = skb_tail_pointer(skb); | 1699 | u8 *b = skb_tail_pointer(skb); |
| 1697 | struct rtattr *mp_head; | 1700 | struct rtattr *mp_head; |
| 1698 | 1701 | ||
| 1699 | if (dev) | 1702 | /* If cache is unresolved, don't try to parse IIF and OIF */ |
| 1700 | RTA_PUT(skb, RTA_IIF, 4, &dev->ifindex); | 1703 | if (c->mf6c_parent > MAXMIFS) |
| 1704 | return -ENOENT; | ||
| 1705 | |||
| 1706 | if (MIF_EXISTS(net, c->mf6c_parent)) | ||
| 1707 | RTA_PUT(skb, RTA_IIF, 4, &net->ipv6.vif6_table[c->mf6c_parent].dev->ifindex); | ||
| 1701 | 1708 | ||
| 1702 | mp_head = (struct rtattr *)skb_put(skb, RTA_LENGTH(0)); | 1709 | mp_head = (struct rtattr *)skb_put(skb, RTA_LENGTH(0)); |
| 1703 | 1710 | ||
| 1704 | for (ct = c->mfc_un.res.minvif; ct < c->mfc_un.res.maxvif; ct++) { | 1711 | for (ct = c->mfc_un.res.minvif; ct < c->mfc_un.res.maxvif; ct++) { |
| 1705 | if (c->mfc_un.res.ttls[ct] < 255) { | 1712 | if (MIF_EXISTS(net, ct) && c->mfc_un.res.ttls[ct] < 255) { |
| 1706 | if (skb_tailroom(skb) < RTA_ALIGN(RTA_ALIGN(sizeof(*nhp)) + 4)) | 1713 | if (skb_tailroom(skb) < RTA_ALIGN(RTA_ALIGN(sizeof(*nhp)) + 4)) |
| 1707 | goto rtattr_failure; | 1714 | goto rtattr_failure; |
| 1708 | nhp = (struct rtnexthop *)skb_put(skb, RTA_ALIGN(sizeof(*nhp))); | 1715 | nhp = (struct rtnexthop *)skb_put(skb, RTA_ALIGN(sizeof(*nhp))); |
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 430454ee5ead..33f60fca7aa7 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/init.h> | 36 | #include <linux/init.h> |
| 37 | #include <linux/sysctl.h> | 37 | #include <linux/sysctl.h> |
| 38 | #include <linux/netfilter.h> | 38 | #include <linux/netfilter.h> |
| 39 | #include <linux/slab.h> | ||
| 39 | 40 | ||
| 40 | #include <net/sock.h> | 41 | #include <net/sock.h> |
| 41 | #include <net/snmp.h> | 42 | #include <net/snmp.h> |
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index bcd971915969..c483ab9fd67b 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
| @@ -43,6 +43,7 @@ | |||
| 43 | #include <linux/init.h> | 43 | #include <linux/init.h> |
| 44 | #include <linux/proc_fs.h> | 44 | #include <linux/proc_fs.h> |
| 45 | #include <linux/seq_file.h> | 45 | #include <linux/seq_file.h> |
| 46 | #include <linux/slab.h> | ||
| 46 | 47 | ||
| 47 | #include <linux/netfilter.h> | 48 | #include <linux/netfilter.h> |
| 48 | #include <linux/netfilter_ipv6.h> | 49 | #include <linux/netfilter_ipv6.h> |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 8bcc4b7db3bf..da0a4d2adc69 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
| @@ -59,6 +59,7 @@ | |||
| 59 | #include <linux/route.h> | 59 | #include <linux/route.h> |
| 60 | #include <linux/init.h> | 60 | #include <linux/init.h> |
| 61 | #include <linux/rcupdate.h> | 61 | #include <linux/rcupdate.h> |
| 62 | #include <linux/slab.h> | ||
| 62 | #ifdef CONFIG_SYSCTL | 63 | #ifdef CONFIG_SYSCTL |
| 63 | #include <linux/sysctl.h> | 64 | #include <linux/sysctl.h> |
| 64 | #endif | 65 | #endif |
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c index 7854052be60b..6a68a74d14a3 100644 --- a/net/ipv6/netfilter/ip6_queue.c +++ b/net/ipv6/netfilter/ip6_queue.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/proc_fs.h> | 25 | #include <linux/proc_fs.h> |
| 26 | #include <linux/seq_file.h> | 26 | #include <linux/seq_file.h> |
| 27 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
| 28 | #include <linux/slab.h> | ||
| 28 | #include <net/net_namespace.h> | 29 | #include <net/net_namespace.h> |
| 29 | #include <net/sock.h> | 30 | #include <net/sock.h> |
| 30 | #include <net/ipv6.h> | 31 | #include <net/ipv6.h> |
diff --git a/net/ipv6/netfilter/ip6t_REJECT.c b/net/ipv6/netfilter/ip6t_REJECT.c index dd8afbaf00a8..39b50c3768e8 100644 --- a/net/ipv6/netfilter/ip6t_REJECT.c +++ b/net/ipv6/netfilter/ip6t_REJECT.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | * 2 of the License, or (at your option) any later version. | 15 | * 2 of the License, or (at your option) any later version. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include <linux/gfp.h> | ||
| 18 | #include <linux/module.h> | 19 | #include <linux/module.h> |
| 19 | #include <linux/skbuff.h> | 20 | #include <linux/skbuff.h> |
| 20 | #include <linux/icmpv6.h> | 21 | #include <linux/icmpv6.h> |
diff --git a/net/ipv6/netfilter/ip6table_filter.c b/net/ipv6/netfilter/ip6table_filter.c index 36b72cafc227..d6fc9aff3163 100644 --- a/net/ipv6/netfilter/ip6table_filter.c +++ b/net/ipv6/netfilter/ip6table_filter.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| 13 | #include <linux/moduleparam.h> | 13 | #include <linux/moduleparam.h> |
| 14 | #include <linux/netfilter_ipv6/ip6_tables.h> | 14 | #include <linux/netfilter_ipv6/ip6_tables.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | 16 | ||
| 16 | MODULE_LICENSE("GPL"); | 17 | MODULE_LICENSE("GPL"); |
| 17 | MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>"); | 18 | MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>"); |
diff --git a/net/ipv6/netfilter/ip6table_mangle.c b/net/ipv6/netfilter/ip6table_mangle.c index 7844e557c0ec..6a102b57f356 100644 --- a/net/ipv6/netfilter/ip6table_mangle.c +++ b/net/ipv6/netfilter/ip6table_mangle.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
| 12 | #include <linux/netfilter_ipv6/ip6_tables.h> | 12 | #include <linux/netfilter_ipv6/ip6_tables.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | 14 | ||
| 14 | MODULE_LICENSE("GPL"); | 15 | MODULE_LICENSE("GPL"); |
| 15 | MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>"); | 16 | MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>"); |
diff --git a/net/ipv6/netfilter/ip6table_raw.c b/net/ipv6/netfilter/ip6table_raw.c index aef31a29de9e..5b9926a011bd 100644 --- a/net/ipv6/netfilter/ip6table_raw.c +++ b/net/ipv6/netfilter/ip6table_raw.c | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | */ | 5 | */ |
| 6 | #include <linux/module.h> | 6 | #include <linux/module.h> |
| 7 | #include <linux/netfilter_ipv6/ip6_tables.h> | 7 | #include <linux/netfilter_ipv6/ip6_tables.h> |
| 8 | #include <linux/slab.h> | ||
| 8 | 9 | ||
| 9 | #define RAW_VALID_HOOKS ((1 << NF_INET_PRE_ROUTING) | (1 << NF_INET_LOCAL_OUT)) | 10 | #define RAW_VALID_HOOKS ((1 << NF_INET_PRE_ROUTING) | (1 << NF_INET_LOCAL_OUT)) |
| 10 | 11 | ||
| @@ -13,7 +14,7 @@ static const struct xt_table packet_raw = { | |||
| 13 | .valid_hooks = RAW_VALID_HOOKS, | 14 | .valid_hooks = RAW_VALID_HOOKS, |
| 14 | .me = THIS_MODULE, | 15 | .me = THIS_MODULE, |
| 15 | .af = NFPROTO_IPV6, | 16 | .af = NFPROTO_IPV6, |
| 16 | .priority = NF_IP6_PRI_FIRST, | 17 | .priority = NF_IP6_PRI_RAW, |
| 17 | }; | 18 | }; |
| 18 | 19 | ||
| 19 | /* The work comes in here from netfilter.c. */ | 20 | /* The work comes in here from netfilter.c. */ |
diff --git a/net/ipv6/netfilter/ip6table_security.c b/net/ipv6/netfilter/ip6table_security.c index 0824d865aa9b..91aa2b4d83c9 100644 --- a/net/ipv6/netfilter/ip6table_security.c +++ b/net/ipv6/netfilter/ip6table_security.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | */ | 17 | */ |
| 18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
| 19 | #include <linux/netfilter_ipv6/ip6_tables.h> | 19 | #include <linux/netfilter_ipv6/ip6_tables.h> |
| 20 | #include <linux/slab.h> | ||
| 20 | 21 | ||
| 21 | MODULE_LICENSE("GPL"); | 22 | MODULE_LICENSE("GPL"); |
| 22 | MODULE_AUTHOR("James Morris <jmorris <at> redhat.com>"); | 23 | MODULE_AUTHOR("James Morris <jmorris <at> redhat.com>"); |
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index f1171b744650..dd5b9bd61c62 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <linux/ipv6.h> | 27 | #include <linux/ipv6.h> |
| 28 | #include <linux/icmpv6.h> | 28 | #include <linux/icmpv6.h> |
| 29 | #include <linux/random.h> | 29 | #include <linux/random.h> |
| 30 | #include <linux/slab.h> | ||
| 30 | 31 | ||
| 31 | #include <net/sock.h> | 32 | #include <net/sock.h> |
| 32 | #include <net/snmp.h> | 33 | #include <net/snmp.h> |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index ed31c37c6e39..8763b1a0814a 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
| 22 | #include <linux/types.h> | 22 | #include <linux/types.h> |
| 23 | #include <linux/socket.h> | 23 | #include <linux/socket.h> |
| 24 | #include <linux/slab.h> | ||
| 24 | #include <linux/sockios.h> | 25 | #include <linux/sockios.h> |
| 25 | #include <linux/net.h> | 26 | #include <linux/net.h> |
| 26 | #include <linux/in6.h> | 27 | #include <linux/in6.h> |
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index a555156e9779..6d4292ff5854 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
| @@ -41,6 +41,7 @@ | |||
| 41 | #include <linux/random.h> | 41 | #include <linux/random.h> |
| 42 | #include <linux/jhash.h> | 42 | #include <linux/jhash.h> |
| 43 | #include <linux/skbuff.h> | 43 | #include <linux/skbuff.h> |
| 44 | #include <linux/slab.h> | ||
| 44 | 45 | ||
| 45 | #include <net/sock.h> | 46 | #include <net/sock.h> |
| 46 | #include <net/snmp.h> | 47 | #include <net/snmp.h> |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index b08879e97f22..05ebd7833043 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
| @@ -40,6 +40,7 @@ | |||
| 40 | #include <linux/proc_fs.h> | 40 | #include <linux/proc_fs.h> |
| 41 | #include <linux/seq_file.h> | 41 | #include <linux/seq_file.h> |
| 42 | #include <linux/nsproxy.h> | 42 | #include <linux/nsproxy.h> |
| 43 | #include <linux/slab.h> | ||
| 43 | #include <net/net_namespace.h> | 44 | #include <net/net_namespace.h> |
| 44 | #include <net/snmp.h> | 45 | #include <net/snmp.h> |
| 45 | #include <net/ipv6.h> | 46 | #include <net/ipv6.h> |
| @@ -814,20 +815,13 @@ struct dst_entry * ip6_route_output(struct net *net, struct sock *sk, | |||
| 814 | { | 815 | { |
| 815 | int flags = 0; | 816 | int flags = 0; |
| 816 | 817 | ||
| 817 | if (rt6_need_strict(&fl->fl6_dst)) | 818 | if (fl->oif || rt6_need_strict(&fl->fl6_dst)) |
| 818 | flags |= RT6_LOOKUP_F_IFACE; | 819 | flags |= RT6_LOOKUP_F_IFACE; |
| 819 | 820 | ||
| 820 | if (!ipv6_addr_any(&fl->fl6_src)) | 821 | if (!ipv6_addr_any(&fl->fl6_src)) |
| 821 | flags |= RT6_LOOKUP_F_HAS_SADDR; | 822 | flags |= RT6_LOOKUP_F_HAS_SADDR; |
| 822 | else if (sk) { | 823 | else if (sk) |
| 823 | unsigned int prefs = inet6_sk(sk)->srcprefs; | 824 | flags |= rt6_srcprefs2flags(inet6_sk(sk)->srcprefs); |
| 824 | if (prefs & IPV6_PREFER_SRC_TMP) | ||
| 825 | flags |= RT6_LOOKUP_F_SRCPREF_TMP; | ||
| 826 | if (prefs & IPV6_PREFER_SRC_PUBLIC) | ||
| 827 | flags |= RT6_LOOKUP_F_SRCPREF_PUBLIC; | ||
| 828 | if (prefs & IPV6_PREFER_SRC_COA) | ||
| 829 | flags |= RT6_LOOKUP_F_SRCPREF_COA; | ||
| 830 | } | ||
| 831 | 825 | ||
| 832 | return fib6_rule_lookup(net, fl, flags, ip6_pol_route_output); | 826 | return fib6_rule_lookup(net, fl, flags, ip6_pol_route_output); |
| 833 | } | 827 | } |
| @@ -886,7 +880,7 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie) | |||
| 886 | 880 | ||
| 887 | rt = (struct rt6_info *) dst; | 881 | rt = (struct rt6_info *) dst; |
| 888 | 882 | ||
| 889 | if (rt && rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie)) | 883 | if (rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie)) |
| 890 | return dst; | 884 | return dst; |
| 891 | 885 | ||
| 892 | return NULL; | 886 | return NULL; |
| @@ -897,12 +891,17 @@ static struct dst_entry *ip6_negative_advice(struct dst_entry *dst) | |||
| 897 | struct rt6_info *rt = (struct rt6_info *) dst; | 891 | struct rt6_info *rt = (struct rt6_info *) dst; |
| 898 | 892 | ||
| 899 | if (rt) { | 893 | if (rt) { |
| 900 | if (rt->rt6i_flags & RTF_CACHE) | 894 | if (rt->rt6i_flags & RTF_CACHE) { |
| 901 | ip6_del_rt(rt); | 895 | if (rt6_check_expired(rt)) { |
| 902 | else | 896 | ip6_del_rt(rt); |
| 897 | dst = NULL; | ||
| 898 | } | ||
| 899 | } else { | ||
| 903 | dst_release(dst); | 900 | dst_release(dst); |
| 901 | dst = NULL; | ||
| 902 | } | ||
| 904 | } | 903 | } |
| 905 | return NULL; | 904 | return dst; |
| 906 | } | 905 | } |
| 907 | 906 | ||
| 908 | static void ip6_link_failure(struct sk_buff *skb) | 907 | static void ip6_link_failure(struct sk_buff *skb) |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index b1eea811be48..5abae10cd884 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/netdevice.h> | 28 | #include <linux/netdevice.h> |
| 29 | #include <linux/if_arp.h> | 29 | #include <linux/if_arp.h> |
| 30 | #include <linux/icmp.h> | 30 | #include <linux/icmp.h> |
| 31 | #include <linux/slab.h> | ||
| 31 | #include <asm/uaccess.h> | 32 | #include <asm/uaccess.h> |
| 32 | #include <linux/init.h> | 33 | #include <linux/init.h> |
| 33 | #include <linux/netfilter_ipv4.h> | 34 | #include <linux/netfilter_ipv4.h> |
diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c index f841d93bf987..fa1d8f4e0051 100644 --- a/net/ipv6/sysctl_net_ipv6.c +++ b/net/ipv6/sysctl_net_ipv6.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include <linux/sysctl.h> | 9 | #include <linux/sysctl.h> |
| 10 | #include <linux/in6.h> | 10 | #include <linux/in6.h> |
| 11 | #include <linux/ipv6.h> | 11 | #include <linux/ipv6.h> |
| 12 | #include <linux/slab.h> | ||
| 12 | #include <net/ndisc.h> | 13 | #include <net/ndisc.h> |
| 13 | #include <net/ipv6.h> | 14 | #include <net/ipv6.h> |
| 14 | #include <net/addrconf.h> | 15 | #include <net/addrconf.h> |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 6963a6b6763e..075f540ec197 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
| @@ -38,6 +38,7 @@ | |||
| 38 | #include <linux/jhash.h> | 38 | #include <linux/jhash.h> |
| 39 | #include <linux/ipsec.h> | 39 | #include <linux/ipsec.h> |
| 40 | #include <linux/times.h> | 40 | #include <linux/times.h> |
| 41 | #include <linux/slab.h> | ||
| 41 | 42 | ||
| 42 | #include <linux/ipv6.h> | 43 | #include <linux/ipv6.h> |
| 43 | #include <linux/icmpv6.h> | 44 | #include <linux/icmpv6.h> |
| @@ -1014,7 +1015,7 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win, | |||
| 1014 | skb_reserve(buff, MAX_HEADER + sizeof(struct ipv6hdr) + tot_len); | 1015 | skb_reserve(buff, MAX_HEADER + sizeof(struct ipv6hdr) + tot_len); |
| 1015 | 1016 | ||
| 1016 | t1 = (struct tcphdr *) skb_push(buff, tot_len); | 1017 | t1 = (struct tcphdr *) skb_push(buff, tot_len); |
| 1017 | skb_reset_transport_header(skb); | 1018 | skb_reset_transport_header(buff); |
| 1018 | 1019 | ||
| 1019 | /* Swap the send and the receive. */ | 1020 | /* Swap the send and the receive. */ |
| 1020 | memset(t1, 0, sizeof(*t1)); | 1021 | memset(t1, 0, sizeof(*t1)); |
| @@ -1740,8 +1741,11 @@ process: | |||
| 1740 | if (!tcp_prequeue(sk, skb)) | 1741 | if (!tcp_prequeue(sk, skb)) |
| 1741 | ret = tcp_v6_do_rcv(sk, skb); | 1742 | ret = tcp_v6_do_rcv(sk, skb); |
| 1742 | } | 1743 | } |
| 1743 | } else | 1744 | } else if (unlikely(sk_add_backlog(sk, skb))) { |
| 1744 | sk_add_backlog(sk, skb); | 1745 | bh_unlock_sock(sk); |
| 1746 | NET_INC_STATS_BH(net, LINUX_MIB_TCPBACKLOGDROP); | ||
| 1747 | goto discard_and_relse; | ||
| 1748 | } | ||
| 1745 | bh_unlock_sock(sk); | 1749 | bh_unlock_sock(sk); |
| 1746 | 1750 | ||
| 1747 | sock_put(sk); | 1751 | sock_put(sk); |
diff --git a/net/ipv6/tunnel6.c b/net/ipv6/tunnel6.c index e17bc1dfc1a4..fc3c86a47452 100644 --- a/net/ipv6/tunnel6.c +++ b/net/ipv6/tunnel6.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/mutex.h> | 25 | #include <linux/mutex.h> |
| 26 | #include <linux/netdevice.h> | 26 | #include <linux/netdevice.h> |
| 27 | #include <linux/skbuff.h> | 27 | #include <linux/skbuff.h> |
| 28 | #include <linux/slab.h> | ||
| 28 | #include <net/ipv6.h> | 29 | #include <net/ipv6.h> |
| 29 | #include <net/protocol.h> | 30 | #include <net/protocol.h> |
| 30 | #include <net/xfrm.h> | 31 | #include <net/xfrm.h> |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 52b8347ae3b2..90824852f598 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <linux/init.h> | 34 | #include <linux/init.h> |
| 35 | #include <linux/module.h> | 35 | #include <linux/module.h> |
| 36 | #include <linux/skbuff.h> | 36 | #include <linux/skbuff.h> |
| 37 | #include <linux/slab.h> | ||
| 37 | #include <asm/uaccess.h> | 38 | #include <asm/uaccess.h> |
| 38 | 39 | ||
| 39 | #include <net/ndisc.h> | 40 | #include <net/ndisc.h> |
| @@ -258,8 +259,8 @@ static struct sock *__udp6_lib_lookup(struct net *net, | |||
| 258 | if (hslot->count < hslot2->count) | 259 | if (hslot->count < hslot2->count) |
| 259 | goto begin; | 260 | goto begin; |
| 260 | 261 | ||
| 261 | result = udp6_lib_lookup2(net, &in6addr_any, sport, | 262 | result = udp6_lib_lookup2(net, saddr, sport, |
| 262 | daddr, hnum, dif, | 263 | &in6addr_any, hnum, dif, |
| 263 | hslot2, slot2); | 264 | hslot2, slot2); |
| 264 | } | 265 | } |
| 265 | rcu_read_unlock(); | 266 | rcu_read_unlock(); |
| @@ -583,16 +584,20 @@ static void flush_stack(struct sock **stack, unsigned int count, | |||
| 583 | bh_lock_sock(sk); | 584 | bh_lock_sock(sk); |
| 584 | if (!sock_owned_by_user(sk)) | 585 | if (!sock_owned_by_user(sk)) |
| 585 | udpv6_queue_rcv_skb(sk, skb1); | 586 | udpv6_queue_rcv_skb(sk, skb1); |
| 586 | else | 587 | else if (sk_add_backlog(sk, skb1)) { |
| 587 | sk_add_backlog(sk, skb1); | 588 | kfree_skb(skb1); |
| 589 | bh_unlock_sock(sk); | ||
| 590 | goto drop; | ||
| 591 | } | ||
| 588 | bh_unlock_sock(sk); | 592 | bh_unlock_sock(sk); |
| 589 | } else { | 593 | continue; |
| 590 | atomic_inc(&sk->sk_drops); | ||
| 591 | UDP6_INC_STATS_BH(sock_net(sk), | ||
| 592 | UDP_MIB_RCVBUFERRORS, IS_UDPLITE(sk)); | ||
| 593 | UDP6_INC_STATS_BH(sock_net(sk), | ||
| 594 | UDP_MIB_INERRORS, IS_UDPLITE(sk)); | ||
| 595 | } | 594 | } |
| 595 | drop: | ||
| 596 | atomic_inc(&sk->sk_drops); | ||
| 597 | UDP6_INC_STATS_BH(sock_net(sk), | ||
| 598 | UDP_MIB_RCVBUFERRORS, IS_UDPLITE(sk)); | ||
| 599 | UDP6_INC_STATS_BH(sock_net(sk), | ||
| 600 | UDP_MIB_INERRORS, IS_UDPLITE(sk)); | ||
| 596 | } | 601 | } |
| 597 | } | 602 | } |
| 598 | /* | 603 | /* |
| @@ -754,8 +759,12 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, | |||
| 754 | bh_lock_sock(sk); | 759 | bh_lock_sock(sk); |
| 755 | if (!sock_owned_by_user(sk)) | 760 | if (!sock_owned_by_user(sk)) |
| 756 | udpv6_queue_rcv_skb(sk, skb); | 761 | udpv6_queue_rcv_skb(sk, skb); |
| 757 | else | 762 | else if (sk_add_backlog(sk, skb)) { |
| 758 | sk_add_backlog(sk, skb); | 763 | atomic_inc(&sk->sk_drops); |
| 764 | bh_unlock_sock(sk); | ||
| 765 | sock_put(sk); | ||
| 766 | goto discard; | ||
| 767 | } | ||
| 759 | bh_unlock_sock(sk); | 768 | bh_unlock_sock(sk); |
| 760 | sock_put(sk); | 769 | sock_put(sk); |
| 761 | return 0; | 770 | return 0; |
diff --git a/net/ipv6/xfrm6_mode_tunnel.c b/net/ipv6/xfrm6_mode_tunnel.c index 3927832227b9..b809812c8d30 100644 --- a/net/ipv6/xfrm6_mode_tunnel.c +++ b/net/ipv6/xfrm6_mode_tunnel.c | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | * Copyright (c) 2004-2006 Herbert Xu <herbert@gondor.apana.org.au> | 5 | * Copyright (c) 2004-2006 Herbert Xu <herbert@gondor.apana.org.au> |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #include <linux/gfp.h> | ||
| 8 | #include <linux/init.h> | 9 | #include <linux/init.h> |
| 9 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
| 10 | #include <linux/module.h> | 11 | #include <linux/module.h> |
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index dbdc696f5fc5..00bf7c962b7e 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c | |||
| @@ -116,14 +116,15 @@ static int xfrm6_init_path(struct xfrm_dst *path, struct dst_entry *dst, | |||
| 116 | return 0; | 116 | return 0; |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev) | 119 | static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev, |
| 120 | struct flowi *fl) | ||
| 120 | { | 121 | { |
| 121 | struct rt6_info *rt = (struct rt6_info*)xdst->route; | 122 | struct rt6_info *rt = (struct rt6_info*)xdst->route; |
| 122 | 123 | ||
| 123 | xdst->u.dst.dev = dev; | 124 | xdst->u.dst.dev = dev; |
| 124 | dev_hold(dev); | 125 | dev_hold(dev); |
| 125 | 126 | ||
| 126 | xdst->u.rt6.rt6i_idev = in6_dev_get(rt->u.dst.dev); | 127 | xdst->u.rt6.rt6i_idev = in6_dev_get(dev); |
| 127 | if (!xdst->u.rt6.rt6i_idev) | 128 | if (!xdst->u.rt6.rt6i_idev) |
| 128 | return -ENODEV; | 129 | return -ENODEV; |
| 129 | 130 | ||
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c index fa85a7d22dc4..2ce3a8278f26 100644 --- a/net/ipv6/xfrm6_tunnel.c +++ b/net/ipv6/xfrm6_tunnel.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | */ | 23 | */ |
| 24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
| 25 | #include <linux/xfrm.h> | 25 | #include <linux/xfrm.h> |
| 26 | #include <linux/slab.h> | ||
| 26 | #include <linux/rculist.h> | 27 | #include <linux/rculist.h> |
| 27 | #include <net/ip.h> | 28 | #include <net/ip.h> |
| 28 | #include <net/xfrm.h> | 29 | #include <net/xfrm.h> |
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c index f9759b54a6de..da3d21c41d90 100644 --- a/net/ipx/af_ipx.c +++ b/net/ipx/af_ipx.c | |||
| @@ -40,6 +40,7 @@ | |||
| 40 | #include <linux/net.h> | 40 | #include <linux/net.h> |
| 41 | #include <linux/netdevice.h> | 41 | #include <linux/netdevice.h> |
| 42 | #include <linux/uio.h> | 42 | #include <linux/uio.h> |
| 43 | #include <linux/slab.h> | ||
| 43 | #include <linux/skbuff.h> | 44 | #include <linux/skbuff.h> |
| 44 | #include <linux/smp_lock.h> | 45 | #include <linux/smp_lock.h> |
| 45 | #include <linux/socket.h> | 46 | #include <linux/socket.h> |
diff --git a/net/ipx/ipx_route.c b/net/ipx/ipx_route.c index e16c11423527..30f4519b092f 100644 --- a/net/ipx/ipx_route.c +++ b/net/ipx/ipx_route.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | #include <linux/list.h> | 10 | #include <linux/list.h> |
| 11 | #include <linux/route.h> | 11 | #include <linux/route.h> |
| 12 | #include <linux/slab.h> | ||
| 12 | #include <linux/spinlock.h> | 13 | #include <linux/spinlock.h> |
| 13 | 14 | ||
| 14 | #include <net/ipx.h> | 15 | #include <net/ipx.h> |
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 10093aab6173..2a4efcea3423 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c | |||
| @@ -48,6 +48,7 @@ | |||
| 48 | #include <linux/smp_lock.h> | 48 | #include <linux/smp_lock.h> |
| 49 | #include <linux/socket.h> | 49 | #include <linux/socket.h> |
| 50 | #include <linux/sockios.h> | 50 | #include <linux/sockios.h> |
| 51 | #include <linux/slab.h> | ||
| 51 | #include <linux/init.h> | 52 | #include <linux/init.h> |
| 52 | #include <linux/net.h> | 53 | #include <linux/net.h> |
| 53 | #include <linux/irda.h> | 54 | #include <linux/irda.h> |
diff --git a/net/irda/discovery.c b/net/irda/discovery.c index a6f99b5a1499..c1c8ae939126 100644 --- a/net/irda/discovery.c +++ b/net/irda/discovery.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <linux/socket.h> | 34 | #include <linux/socket.h> |
| 35 | #include <linux/fs.h> | 35 | #include <linux/fs.h> |
| 36 | #include <linux/seq_file.h> | 36 | #include <linux/seq_file.h> |
| 37 | #include <linux/slab.h> | ||
| 37 | 38 | ||
| 38 | #include <net/irda/irda.h> | 39 | #include <net/irda/irda.h> |
| 39 | #include <net/irda/irlmp.h> | 40 | #include <net/irda/irlmp.h> |
diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c index 018c92941aba..e97082017f4f 100644 --- a/net/irda/ircomm/ircomm_core.c +++ b/net/irda/ircomm/ircomm_core.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <linux/proc_fs.h> | 33 | #include <linux/proc_fs.h> |
| 34 | #include <linux/seq_file.h> | 34 | #include <linux/seq_file.h> |
| 35 | #include <linux/init.h> | 35 | #include <linux/init.h> |
| 36 | #include <linux/slab.h> | ||
| 36 | 37 | ||
| 37 | #include <net/irda/irda.h> | 38 | #include <net/irda/irda.h> |
| 38 | #include <net/irda/irmod.h> | 39 | #include <net/irda/irmod.h> |
diff --git a/net/irda/ircomm/ircomm_lmp.c b/net/irda/ircomm/ircomm_lmp.c index 7ba96618660e..08fb54dc8c41 100644 --- a/net/irda/ircomm/ircomm_lmp.c +++ b/net/irda/ircomm/ircomm_lmp.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | ********************************************************************/ | 31 | ********************************************************************/ |
| 32 | 32 | ||
| 33 | #include <linux/init.h> | 33 | #include <linux/init.h> |
| 34 | #include <linux/gfp.h> | ||
| 34 | 35 | ||
| 35 | #include <net/irda/irda.h> | 36 | #include <net/irda/irda.h> |
| 36 | #include <net/irda/irlmp.h> | 37 | #include <net/irda/irlmp.h> |
diff --git a/net/irda/ircomm/ircomm_param.c b/net/irda/ircomm/ircomm_param.c index d57aefd9fe77..e2e893b474e9 100644 --- a/net/irda/ircomm/ircomm_param.c +++ b/net/irda/ircomm/ircomm_param.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | * | 28 | * |
| 29 | ********************************************************************/ | 29 | ********************************************************************/ |
| 30 | 30 | ||
| 31 | #include <linux/gfp.h> | ||
| 31 | #include <linux/workqueue.h> | 32 | #include <linux/workqueue.h> |
| 32 | #include <linux/interrupt.h> | 33 | #include <linux/interrupt.h> |
| 33 | 34 | ||
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c index 8b85d774e47f..faa82ca2dfdc 100644 --- a/net/irda/ircomm/ircomm_tty.c +++ b/net/irda/ircomm/ircomm_tty.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <linux/init.h> | 33 | #include <linux/init.h> |
| 34 | #include <linux/module.h> | 34 | #include <linux/module.h> |
| 35 | #include <linux/fs.h> | 35 | #include <linux/fs.h> |
| 36 | #include <linux/slab.h> | ||
| 36 | #include <linux/sched.h> | 37 | #include <linux/sched.h> |
| 37 | #include <linux/seq_file.h> | 38 | #include <linux/seq_file.h> |
| 38 | #include <linux/termios.h> | 39 | #include <linux/termios.h> |
diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c index bf92e1473447..25cc2e695158 100644 --- a/net/irda/irda_device.c +++ b/net/irda/irda_device.c | |||
| @@ -41,6 +41,7 @@ | |||
| 41 | #include <linux/tty.h> | 41 | #include <linux/tty.h> |
| 42 | #include <linux/kmod.h> | 42 | #include <linux/kmod.h> |
| 43 | #include <linux/spinlock.h> | 43 | #include <linux/spinlock.h> |
| 44 | #include <linux/slab.h> | ||
| 44 | 45 | ||
| 45 | #include <asm/ioctls.h> | 46 | #include <asm/ioctls.h> |
| 46 | #include <asm/uaccess.h> | 47 | #include <asm/uaccess.h> |
diff --git a/net/irda/iriap.c b/net/irda/iriap.c index 294e34d3517c..79a1e5a23e10 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #include <linux/string.h> | 31 | #include <linux/string.h> |
| 32 | #include <linux/init.h> | 32 | #include <linux/init.h> |
| 33 | #include <linux/seq_file.h> | 33 | #include <linux/seq_file.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | 35 | ||
| 35 | #include <asm/byteorder.h> | 36 | #include <asm/byteorder.h> |
| 36 | #include <asm/unaligned.h> | 37 | #include <asm/unaligned.h> |
diff --git a/net/irda/iriap_event.c b/net/irda/iriap_event.c index a301cbd93785..703774e29e32 100644 --- a/net/irda/iriap_event.c +++ b/net/irda/iriap_event.c | |||
| @@ -24,6 +24,8 @@ | |||
| 24 | * | 24 | * |
| 25 | ********************************************************************/ | 25 | ********************************************************************/ |
| 26 | 26 | ||
| 27 | #include <linux/slab.h> | ||
| 28 | |||
| 27 | #include <net/irda/irda.h> | 29 | #include <net/irda/irda.h> |
| 28 | #include <net/irda/irlmp.h> | 30 | #include <net/irda/irlmp.h> |
| 29 | #include <net/irda/iriap.h> | 31 | #include <net/irda/iriap.h> |
diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c index 99ebb96f1386..f07ed9fd5792 100644 --- a/net/irda/irias_object.c +++ b/net/irda/irias_object.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | * | 22 | * |
| 23 | ********************************************************************/ | 23 | ********************************************************************/ |
| 24 | 24 | ||
| 25 | #include <linux/slab.h> | ||
| 25 | #include <linux/string.h> | 26 | #include <linux/string.h> |
| 26 | #include <linux/socket.h> | 27 | #include <linux/socket.h> |
| 27 | #include <linux/module.h> | 28 | #include <linux/module.h> |
diff --git a/net/irda/irlan/irlan_client.c b/net/irda/irlan/irlan_client.c index 42f7d960d055..7ed3af957935 100644 --- a/net/irda/irlan/irlan_client.c +++ b/net/irda/irlan/irlan_client.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | 28 | ||
| 29 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
| 30 | #include <linux/string.h> | 30 | #include <linux/string.h> |
| 31 | #include <linux/slab.h> | ||
| 31 | #include <linux/errno.h> | 32 | #include <linux/errno.h> |
| 32 | #include <linux/init.h> | 33 | #include <linux/init.h> |
| 33 | #include <linux/netdevice.h> | 34 | #include <linux/netdevice.h> |
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c index e486dc89ea59..a788f9e9427d 100644 --- a/net/irda/irlan/irlan_common.c +++ b/net/irda/irlan/irlan_common.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
| 29 | #include <linux/string.h> | 29 | #include <linux/string.h> |
| 30 | #include <linux/gfp.h> | ||
| 30 | #include <linux/init.h> | 31 | #include <linux/init.h> |
| 31 | #include <linux/errno.h> | 32 | #include <linux/errno.h> |
| 32 | #include <linux/proc_fs.h> | 33 | #include <linux/proc_fs.h> |
diff --git a/net/irda/irlan/irlan_provider.c b/net/irda/irlan/irlan_provider.c index 3f81f81b2dfa..5cf5e6c872bb 100644 --- a/net/irda/irlan/irlan_provider.c +++ b/net/irda/irlan/irlan_provider.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <linux/init.h> | 34 | #include <linux/init.h> |
| 35 | #include <linux/random.h> | 35 | #include <linux/random.h> |
| 36 | #include <linux/bitops.h> | 36 | #include <linux/bitops.h> |
| 37 | #include <linux/slab.h> | ||
| 37 | 38 | ||
| 38 | #include <asm/system.h> | 39 | #include <asm/system.h> |
| 39 | #include <asm/byteorder.h> | 40 | #include <asm/byteorder.h> |
diff --git a/net/irda/irlap_event.c b/net/irda/irlap_event.c index 94a9884d7146..d434c8880745 100644 --- a/net/irda/irlap_event.c +++ b/net/irda/irlap_event.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
| 30 | #include <linux/delay.h> | 30 | #include <linux/delay.h> |
| 31 | #include <linux/skbuff.h> | 31 | #include <linux/skbuff.h> |
| 32 | #include <linux/slab.h> | ||
| 32 | 33 | ||
| 33 | #include <net/irda/irda.h> | 34 | #include <net/irda/irda.h> |
| 34 | #include <net/irda/irlap_event.h> | 35 | #include <net/irda/irlap_event.h> |
diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c index 7af2e74deda8..688222cbf55b 100644 --- a/net/irda/irlap_frame.c +++ b/net/irda/irlap_frame.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/if_ether.h> | 29 | #include <linux/if_ether.h> |
| 30 | #include <linux/netdevice.h> | 30 | #include <linux/netdevice.h> |
| 31 | #include <linux/irda.h> | 31 | #include <linux/irda.h> |
| 32 | #include <linux/slab.h> | ||
| 32 | 33 | ||
| 33 | #include <net/pkt_sched.h> | 34 | #include <net/pkt_sched.h> |
| 34 | #include <net/sock.h> | 35 | #include <net/sock.h> |
diff --git a/net/irda/irnet/irnet_irda.c b/net/irda/irnet/irnet_irda.c index b26dee784aba..df18ab4b6c5e 100644 --- a/net/irda/irnet/irnet_irda.c +++ b/net/irda/irnet/irnet_irda.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include "irnet_irda.h" /* Private header */ | 11 | #include "irnet_irda.h" /* Private header */ |
| 12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
| 13 | #include <linux/seq_file.h> | 13 | #include <linux/seq_file.h> |
| 14 | #include <linux/slab.h> | ||
| 14 | #include <asm/unaligned.h> | 15 | #include <asm/unaligned.h> |
| 15 | 16 | ||
| 16 | /* | 17 | /* |
diff --git a/net/irda/irnet/irnet_ppp.c b/net/irda/irnet/irnet_ppp.c index 6b3602de359a..6a1a202710c5 100644 --- a/net/irda/irnet/irnet_ppp.c +++ b/net/irda/irnet/irnet_ppp.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | #include <linux/smp_lock.h> | 18 | #include <linux/smp_lock.h> |
| 18 | #include "irnet_ppp.h" /* Private header */ | 19 | #include "irnet_ppp.h" /* Private header */ |
| 19 | /* Please put other headers in irnet.h - Thanks */ | 20 | /* Please put other headers in irnet.h - Thanks */ |
diff --git a/net/irda/irnetlink.c b/net/irda/irnetlink.c index 69b5b75f5431..6c7c4b92e4f8 100644 --- a/net/irda/irnetlink.c +++ b/net/irda/irnetlink.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | #include <linux/socket.h> | 16 | #include <linux/socket.h> |
| 17 | #include <linux/irda.h> | 17 | #include <linux/irda.h> |
| 18 | #include <linux/gfp.h> | ||
| 18 | #include <net/net_namespace.h> | 19 | #include <net/net_namespace.h> |
| 19 | #include <net/sock.h> | 20 | #include <net/sock.h> |
| 20 | #include <net/irda/irda.h> | 21 | #include <net/irda/irda.h> |
diff --git a/net/irda/irqueue.c b/net/irda/irqueue.c index ba01938becb5..849aaf0dabb5 100644 --- a/net/irda/irqueue.c +++ b/net/irda/irqueue.c | |||
| @@ -192,6 +192,7 @@ | |||
| 192 | * Jean II | 192 | * Jean II |
| 193 | */ | 193 | */ |
| 194 | #include <linux/module.h> | 194 | #include <linux/module.h> |
| 195 | #include <linux/slab.h> | ||
| 195 | 196 | ||
| 196 | #include <net/irda/irda.h> | 197 | #include <net/irda/irda.h> |
| 197 | #include <net/irda/irqueue.h> | 198 | #include <net/irda/irqueue.h> |
diff --git a/net/irda/irttp.c b/net/irda/irttp.c index 9cb79f95bf63..47db1d8a0d92 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
| 29 | #include <linux/fs.h> | 29 | #include <linux/fs.h> |
| 30 | #include <linux/seq_file.h> | 30 | #include <linux/seq_file.h> |
| 31 | #include <linux/slab.h> | ||
| 31 | 32 | ||
| 32 | #include <asm/byteorder.h> | 33 | #include <asm/byteorder.h> |
| 33 | #include <asm/unaligned.h> | 34 | #include <asm/unaligned.h> |
diff --git a/net/key/af_key.c b/net/key/af_key.c index 368707882647..ba9a3fcc2fed 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/in6.h> | 26 | #include <linux/in6.h> |
| 27 | #include <linux/proc_fs.h> | 27 | #include <linux/proc_fs.h> |
| 28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
| 29 | #include <linux/slab.h> | ||
| 29 | #include <net/net_namespace.h> | 30 | #include <net/net_namespace.h> |
| 30 | #include <net/netns/generic.h> | 31 | #include <net/netns/generic.h> |
| 31 | #include <net/xfrm.h> | 32 | #include <net/xfrm.h> |
| @@ -2129,10 +2130,9 @@ static int key_notify_policy(struct xfrm_policy *xp, int dir, struct km_event *c | |||
| 2129 | int err; | 2130 | int err; |
| 2130 | 2131 | ||
| 2131 | out_skb = pfkey_xfrm_policy2msg_prep(xp); | 2132 | out_skb = pfkey_xfrm_policy2msg_prep(xp); |
| 2132 | if (IS_ERR(out_skb)) { | 2133 | if (IS_ERR(out_skb)) |
| 2133 | err = PTR_ERR(out_skb); | 2134 | return PTR_ERR(out_skb); |
| 2134 | goto out; | 2135 | |
| 2135 | } | ||
| 2136 | err = pfkey_xfrm_policy2msg(out_skb, xp, dir); | 2136 | err = pfkey_xfrm_policy2msg(out_skb, xp, dir); |
| 2137 | if (err < 0) | 2137 | if (err < 0) |
| 2138 | return err; | 2138 | return err; |
| @@ -2148,7 +2148,6 @@ static int key_notify_policy(struct xfrm_policy *xp, int dir, struct km_event *c | |||
| 2148 | out_hdr->sadb_msg_seq = c->seq; | 2148 | out_hdr->sadb_msg_seq = c->seq; |
| 2149 | out_hdr->sadb_msg_pid = c->pid; | 2149 | out_hdr->sadb_msg_pid = c->pid; |
| 2150 | pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_ALL, NULL, xp_net(xp)); | 2150 | pfkey_broadcast(out_skb, GFP_ATOMIC, BROADCAST_ALL, NULL, xp_net(xp)); |
| 2151 | out: | ||
| 2152 | return 0; | 2151 | return 0; |
| 2153 | 2152 | ||
| 2154 | } | 2153 | } |
diff --git a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c index bda96d18fd98..d5d8d555c410 100644 --- a/net/lapb/lapb_iface.c +++ b/net/lapb/lapb_iface.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/inet.h> | 29 | #include <linux/inet.h> |
| 30 | #include <linux/if_arp.h> | 30 | #include <linux/if_arp.h> |
| 31 | #include <linux/skbuff.h> | 31 | #include <linux/skbuff.h> |
| 32 | #include <linux/slab.h> | ||
| 32 | #include <net/sock.h> | 33 | #include <net/sock.h> |
| 33 | #include <asm/uaccess.h> | 34 | #include <asm/uaccess.h> |
| 34 | #include <asm/system.h> | 35 | #include <asm/system.h> |
diff --git a/net/lapb/lapb_in.c b/net/lapb/lapb_in.c index 6762e7c751eb..21904a002449 100644 --- a/net/lapb/lapb_in.c +++ b/net/lapb/lapb_in.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <linux/inet.h> | 27 | #include <linux/inet.h> |
| 28 | #include <linux/netdevice.h> | 28 | #include <linux/netdevice.h> |
| 29 | #include <linux/skbuff.h> | 29 | #include <linux/skbuff.h> |
| 30 | #include <linux/slab.h> | ||
| 30 | #include <net/sock.h> | 31 | #include <net/sock.h> |
| 31 | #include <asm/uaccess.h> | 32 | #include <asm/uaccess.h> |
| 32 | #include <asm/system.h> | 33 | #include <asm/system.h> |
diff --git a/net/lapb/lapb_out.c b/net/lapb/lapb_out.c index 339cc5f2684f..c75a79540f9f 100644 --- a/net/lapb/lapb_out.c +++ b/net/lapb/lapb_out.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/net.h> | 25 | #include <linux/net.h> |
| 26 | #include <linux/inet.h> | 26 | #include <linux/inet.h> |
| 27 | #include <linux/skbuff.h> | 27 | #include <linux/skbuff.h> |
| 28 | #include <linux/slab.h> | ||
| 28 | #include <net/sock.h> | 29 | #include <net/sock.h> |
| 29 | #include <asm/uaccess.h> | 30 | #include <asm/uaccess.h> |
| 30 | #include <asm/system.h> | 31 | #include <asm/system.h> |
diff --git a/net/lapb/lapb_subr.c b/net/lapb/lapb_subr.c index b827f47ac133..43a2a7fb327b 100644 --- a/net/lapb/lapb_subr.c +++ b/net/lapb/lapb_subr.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/net.h> | 24 | #include <linux/net.h> |
| 25 | #include <linux/inet.h> | 25 | #include <linux/inet.h> |
| 26 | #include <linux/skbuff.h> | 26 | #include <linux/skbuff.h> |
| 27 | #include <linux/slab.h> | ||
| 27 | #include <net/sock.h> | 28 | #include <net/sock.h> |
| 28 | #include <asm/uaccess.h> | 29 | #include <asm/uaccess.h> |
| 29 | #include <asm/system.h> | 30 | #include <asm/system.h> |
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index e35d907fba2c..2db6a9f75913 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
| 26 | #include <linux/rtnetlink.h> | 26 | #include <linux/rtnetlink.h> |
| 27 | #include <linux/init.h> | 27 | #include <linux/init.h> |
| 28 | #include <linux/slab.h> | ||
| 28 | #include <net/llc.h> | 29 | #include <net/llc.h> |
| 29 | #include <net/llc_sap.h> | 30 | #include <net/llc_sap.h> |
| 30 | #include <net/llc_pdu.h> | 31 | #include <net/llc_pdu.h> |
diff --git a/net/llc/llc_c_ac.c b/net/llc/llc_c_ac.c index 019c780512e8..ea225bd2672c 100644 --- a/net/llc/llc_c_ac.c +++ b/net/llc/llc_c_ac.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | * See the GNU General Public License for more details. | 18 | * See the GNU General Public License for more details. |
| 19 | */ | 19 | */ |
| 20 | #include <linux/netdevice.h> | 20 | #include <linux/netdevice.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | #include <net/llc_conn.h> | 22 | #include <net/llc_conn.h> |
| 22 | #include <net/llc_sap.h> | 23 | #include <net/llc_sap.h> |
| 23 | #include <net/sock.h> | 24 | #include <net/sock.h> |
| @@ -1437,7 +1438,7 @@ static void llc_process_tmr_ev(struct sock *sk, struct sk_buff *skb) | |||
| 1437 | llc_conn_state_process(sk, skb); | 1438 | llc_conn_state_process(sk, skb); |
| 1438 | else { | 1439 | else { |
| 1439 | llc_set_backlog_type(skb, LLC_EVENT); | 1440 | llc_set_backlog_type(skb, LLC_EVENT); |
| 1440 | sk_add_backlog(sk, skb); | 1441 | __sk_add_backlog(sk, skb); |
| 1441 | } | 1442 | } |
| 1442 | } | 1443 | } |
| 1443 | } | 1444 | } |
diff --git a/net/llc/llc_conn.c b/net/llc/llc_conn.c index a8dde9b010da..ba137a6a224d 100644 --- a/net/llc/llc_conn.c +++ b/net/llc/llc_conn.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
| 16 | #include <linux/slab.h> | ||
| 16 | #include <net/llc_sap.h> | 17 | #include <net/llc_sap.h> |
| 17 | #include <net/llc_conn.h> | 18 | #include <net/llc_conn.h> |
| 18 | #include <net/sock.h> | 19 | #include <net/sock.h> |
| @@ -827,7 +828,8 @@ void llc_conn_handler(struct llc_sap *sap, struct sk_buff *skb) | |||
| 827 | else { | 828 | else { |
| 828 | dprintk("%s: adding to backlog...\n", __func__); | 829 | dprintk("%s: adding to backlog...\n", __func__); |
| 829 | llc_set_backlog_type(skb, LLC_PACKET); | 830 | llc_set_backlog_type(skb, LLC_PACKET); |
| 830 | sk_add_backlog(sk, skb); | 831 | if (sk_add_backlog(sk, skb)) |
| 832 | goto drop_unlock; | ||
| 831 | } | 833 | } |
| 832 | out: | 834 | out: |
| 833 | bh_unlock_sock(sk); | 835 | bh_unlock_sock(sk); |
diff --git a/net/llc/llc_if.c b/net/llc/llc_if.c index a89917130a7b..25c31c0a3fdb 100644 --- a/net/llc/llc_if.c +++ b/net/llc/llc_if.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | * | 11 | * |
| 12 | * See the GNU General Public License for more details. | 12 | * See the GNU General Public License for more details. |
| 13 | */ | 13 | */ |
| 14 | #include <linux/gfp.h> | ||
| 14 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 15 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
| 16 | #include <linux/netdevice.h> | 17 | #include <linux/netdevice.h> |
diff --git a/net/llc/llc_input.c b/net/llc/llc_input.c index 57ad974e4d94..f99687439139 100644 --- a/net/llc/llc_input.c +++ b/net/llc/llc_input.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | * See the GNU General Public License for more details. | 12 | * See the GNU General Public License for more details. |
| 13 | */ | 13 | */ |
| 14 | #include <linux/netdevice.h> | 14 | #include <linux/netdevice.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | #include <net/net_namespace.h> | 16 | #include <net/net_namespace.h> |
| 16 | #include <net/llc.h> | 17 | #include <net/llc.h> |
| 17 | #include <net/llc_pdu.h> | 18 | #include <net/llc_pdu.h> |
diff --git a/net/llc/llc_sap.c b/net/llc/llc_sap.c index ad6e6e1cf22f..94e7fca75b85 100644 --- a/net/llc/llc_sap.c +++ b/net/llc/llc_sap.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <net/sock.h> | 23 | #include <net/sock.h> |
| 24 | #include <net/tcp_states.h> | 24 | #include <net/tcp_states.h> |
| 25 | #include <linux/llc.h> | 25 | #include <linux/llc.h> |
| 26 | #include <linux/slab.h> | ||
| 26 | 27 | ||
| 27 | static int llc_mac_header_len(unsigned short devtype) | 28 | static int llc_mac_header_len(unsigned short devtype) |
| 28 | { | 29 | { |
| @@ -30,7 +31,7 @@ static int llc_mac_header_len(unsigned short devtype) | |||
| 30 | case ARPHRD_ETHER: | 31 | case ARPHRD_ETHER: |
| 31 | case ARPHRD_LOOPBACK: | 32 | case ARPHRD_LOOPBACK: |
| 32 | return sizeof(struct ethhdr); | 33 | return sizeof(struct ethhdr); |
| 33 | #ifdef CONFIG_TR | 34 | #if defined(CONFIG_TR) || defined(CONFIG_TR_MODULE) |
| 34 | case ARPHRD_IEEE802_TR: | 35 | case ARPHRD_IEEE802_TR: |
| 35 | return sizeof(struct trh_hdr); | 36 | return sizeof(struct trh_hdr); |
| 36 | #endif | 37 | #endif |
diff --git a/net/llc/llc_station.c b/net/llc/llc_station.c index 83da13339490..e4dae0244d76 100644 --- a/net/llc/llc_station.c +++ b/net/llc/llc_station.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | */ | 13 | */ |
| 14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
| 15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 16 | #include <linux/slab.h> | ||
| 16 | #include <net/llc.h> | 17 | #include <net/llc.h> |
| 17 | #include <net/llc_sap.h> | 18 | #include <net/llc_sap.h> |
| 18 | #include <net/llc_conn.h> | 19 | #include <net/llc_conn.h> |
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c index a978e666ed6f..f9516a27e233 100644 --- a/net/mac80211/agg-rx.c +++ b/net/mac80211/agg-rx.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | #include <linux/ieee80211.h> | 16 | #include <linux/ieee80211.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | #include <net/mac80211.h> | 18 | #include <net/mac80211.h> |
| 18 | #include "ieee80211_i.h" | 19 | #include "ieee80211_i.h" |
| 19 | #include "driver-ops.h" | 20 | #include "driver-ops.h" |
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index 5538e1b4a697..87782a4bb541 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | #include <linux/ieee80211.h> | 16 | #include <linux/ieee80211.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | #include <net/mac80211.h> | 18 | #include <net/mac80211.h> |
| 18 | #include "ieee80211_i.h" | 19 | #include "ieee80211_i.h" |
| 19 | #include "driver-ops.h" | 20 | #include "driver-ops.h" |
| @@ -183,7 +184,6 @@ static void sta_addba_resp_timer_expired(unsigned long data) | |||
| 183 | HT_AGG_STATE_REQ_STOP_BA_MSK)) != | 184 | HT_AGG_STATE_REQ_STOP_BA_MSK)) != |
| 184 | HT_ADDBA_REQUESTED_MSK) { | 185 | HT_ADDBA_REQUESTED_MSK) { |
| 185 | spin_unlock_bh(&sta->lock); | 186 | spin_unlock_bh(&sta->lock); |
| 186 | *state = HT_AGG_STATE_IDLE; | ||
| 187 | #ifdef CONFIG_MAC80211_HT_DEBUG | 187 | #ifdef CONFIG_MAC80211_HT_DEBUG |
| 188 | printk(KERN_DEBUG "timer expired on tid %d but we are not " | 188 | printk(KERN_DEBUG "timer expired on tid %d but we are not " |
| 189 | "(or no longer) expecting addBA response there", | 189 | "(or no longer) expecting addBA response there", |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index b7116ef84a3b..edc872e22c9b 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include <linux/ieee80211.h> | 9 | #include <linux/ieee80211.h> |
| 10 | #include <linux/nl80211.h> | 10 | #include <linux/nl80211.h> |
| 11 | #include <linux/rtnetlink.h> | 11 | #include <linux/rtnetlink.h> |
| 12 | #include <linux/slab.h> | ||
| 12 | #include <net/net_namespace.h> | 13 | #include <net/net_namespace.h> |
| 13 | #include <linux/rcupdate.h> | 14 | #include <linux/rcupdate.h> |
| 14 | #include <net/cfg80211.h> | 15 | #include <net/cfg80211.h> |
diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c index d12e743cb4e1..97c9e46e859e 100644 --- a/net/mac80211/debugfs_key.c +++ b/net/mac80211/debugfs_key.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #include <linux/kobject.h> | 11 | #include <linux/kobject.h> |
| 12 | #include <linux/slab.h> | ||
| 12 | #include "ieee80211_i.h" | 13 | #include "ieee80211_i.h" |
| 13 | #include "key.h" | 14 | #include "key.h" |
| 14 | #include "debugfs.h" | 15 | #include "debugfs.h" |
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index 9affe2cd185f..83d4289d954b 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
| 14 | #include <linux/netdevice.h> | 14 | #include <linux/netdevice.h> |
| 15 | #include <linux/rtnetlink.h> | 15 | #include <linux/rtnetlink.h> |
| 16 | #include <linux/slab.h> | ||
| 16 | #include <linux/notifier.h> | 17 | #include <linux/notifier.h> |
| 17 | #include <net/mac80211.h> | 18 | #include <net/mac80211.h> |
| 18 | #include <net/cfg80211.h> | 19 | #include <net/cfg80211.h> |
| @@ -48,20 +49,24 @@ static ssize_t ieee80211_if_write( | |||
| 48 | ssize_t (*write)(struct ieee80211_sub_if_data *, const char *, int)) | 49 | ssize_t (*write)(struct ieee80211_sub_if_data *, const char *, int)) |
| 49 | { | 50 | { |
| 50 | u8 *buf; | 51 | u8 *buf; |
| 51 | ssize_t ret = -ENODEV; | 52 | ssize_t ret; |
| 52 | 53 | ||
| 53 | buf = kzalloc(count, GFP_KERNEL); | 54 | buf = kmalloc(count, GFP_KERNEL); |
| 54 | if (!buf) | 55 | if (!buf) |
| 55 | return -ENOMEM; | 56 | return -ENOMEM; |
| 56 | 57 | ||
| 58 | ret = -EFAULT; | ||
| 57 | if (copy_from_user(buf, userbuf, count)) | 59 | if (copy_from_user(buf, userbuf, count)) |
| 58 | return -EFAULT; | 60 | goto freebuf; |
| 59 | 61 | ||
| 62 | ret = -ENODEV; | ||
| 60 | rtnl_lock(); | 63 | rtnl_lock(); |
| 61 | if (sdata->dev->reg_state == NETREG_REGISTERED) | 64 | if (sdata->dev->reg_state == NETREG_REGISTERED) |
| 62 | ret = (*write)(sdata, buf, count); | 65 | ret = (*write)(sdata, buf, count); |
| 63 | rtnl_unlock(); | 66 | rtnl_unlock(); |
| 64 | 67 | ||
| 68 | freebuf: | ||
| 69 | kfree(buf); | ||
| 65 | return ret; | 70 | return ret; |
| 66 | } | 71 | } |
| 67 | 72 | ||
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index f3e942486749..e2976da4e0d9 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
| 16 | #include <linux/slab.h> | ||
| 16 | #include <linux/if_ether.h> | 17 | #include <linux/if_ether.h> |
| 17 | #include <linux/skbuff.h> | 18 | #include <linux/skbuff.h> |
| 18 | #include <linux/if_arp.h> | 19 | #include <linux/if_arp.h> |
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 0793d7a8d743..e08fa8eda1b3 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | * it under the terms of the GNU General Public License version 2 as | 10 | * it under the terms of the GNU General Public License version 2 as |
| 11 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
| 12 | */ | 12 | */ |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
| 14 | #include <linux/if_arp.h> | 15 | #include <linux/if_arp.h> |
| 15 | #include <linux/netdevice.h> | 16 | #include <linux/netdevice.h> |
diff --git a/net/mac80211/key.c b/net/mac80211/key.c index 8160d9c5372e..e8f6e3b252d8 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/list.h> | 14 | #include <linux/list.h> |
| 15 | #include <linux/rcupdate.h> | 15 | #include <linux/rcupdate.h> |
| 16 | #include <linux/rtnetlink.h> | 16 | #include <linux/rtnetlink.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | #include <net/mac80211.h> | 18 | #include <net/mac80211.h> |
| 18 | #include "ieee80211_i.h" | 19 | #include "ieee80211_i.h" |
| 19 | #include "driver-ops.h" | 20 | #include "driver-ops.h" |
diff --git a/net/mac80211/led.c b/net/mac80211/led.c index 162a643f16b6..063aad944246 100644 --- a/net/mac80211/led.c +++ b/net/mac80211/led.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | /* just for IFNAMSIZ */ | 9 | /* just for IFNAMSIZ */ |
| 10 | #include <linux/if.h> | 10 | #include <linux/if.h> |
| 11 | #include <linux/slab.h> | ||
| 11 | #include "led.h" | 12 | #include "led.h" |
| 12 | 13 | ||
| 13 | void ieee80211_led_rx(struct ieee80211_local *local) | 14 | void ieee80211_led_rx(struct ieee80211_local *local) |
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 06c33b68d8e5..b887e484ae04 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
| @@ -225,11 +225,11 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata, | |||
| 225 | switch (sdata->vif.type) { | 225 | switch (sdata->vif.type) { |
| 226 | case NL80211_IFTYPE_AP: | 226 | case NL80211_IFTYPE_AP: |
| 227 | sdata->vif.bss_conf.enable_beacon = | 227 | sdata->vif.bss_conf.enable_beacon = |
| 228 | !!rcu_dereference(sdata->u.ap.beacon); | 228 | !!sdata->u.ap.beacon; |
| 229 | break; | 229 | break; |
| 230 | case NL80211_IFTYPE_ADHOC: | 230 | case NL80211_IFTYPE_ADHOC: |
| 231 | sdata->vif.bss_conf.enable_beacon = | 231 | sdata->vif.bss_conf.enable_beacon = |
| 232 | !!rcu_dereference(sdata->u.ibss.presp); | 232 | !!sdata->u.ibss.presp; |
| 233 | break; | 233 | break; |
| 234 | case NL80211_IFTYPE_MESH_POINT: | 234 | case NL80211_IFTYPE_MESH_POINT: |
| 235 | sdata->vif.bss_conf.enable_beacon = true; | 235 | sdata->vif.bss_conf.enable_beacon = true; |
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 61080c5fad50..859ee5f3d941 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #include <linux/slab.h> | ||
| 11 | #include <asm/unaligned.h> | 12 | #include <asm/unaligned.h> |
| 12 | #include "ieee80211_i.h" | 13 | #include "ieee80211_i.h" |
| 13 | #include "mesh.h" | 14 | #include "mesh.h" |
| @@ -749,9 +750,6 @@ ieee80211_mesh_rx_mgmt(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) | |||
| 749 | 750 | ||
| 750 | switch (fc & IEEE80211_FCTL_STYPE) { | 751 | switch (fc & IEEE80211_FCTL_STYPE) { |
| 751 | case IEEE80211_STYPE_ACTION: | 752 | case IEEE80211_STYPE_ACTION: |
| 752 | if (skb->len < IEEE80211_MIN_ACTION_SIZE) | ||
| 753 | return RX_DROP_MONITOR; | ||
| 754 | /* fall through */ | ||
| 755 | case IEEE80211_STYPE_PROBE_RESP: | 753 | case IEEE80211_STYPE_PROBE_RESP: |
| 756 | case IEEE80211_STYPE_BEACON: | 754 | case IEEE80211_STYPE_BEACON: |
| 757 | skb_queue_tail(&ifmsh->skb_queue, skb); | 755 | skb_queue_tail(&ifmsh->skb_queue, skb); |
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index ce84237ebad3..fefc45c4b4e8 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | #include <linux/slab.h> | ||
| 10 | #include "mesh.h" | 11 | #include "mesh.h" |
| 11 | 12 | ||
| 12 | #ifdef CONFIG_MAC80211_VERBOSE_MHWMP_DEBUG | 13 | #ifdef CONFIG_MAC80211_VERBOSE_MHWMP_DEBUG |
| @@ -391,7 +392,7 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata, | |||
| 391 | if (SN_GT(mpath->sn, orig_sn) || | 392 | if (SN_GT(mpath->sn, orig_sn) || |
| 392 | (mpath->sn == orig_sn && | 393 | (mpath->sn == orig_sn && |
| 393 | action == MPATH_PREQ && | 394 | action == MPATH_PREQ && |
| 394 | new_metric > mpath->metric)) { | 395 | new_metric >= mpath->metric)) { |
| 395 | process = false; | 396 | process = false; |
| 396 | fresh_info = false; | 397 | fresh_info = false; |
| 397 | } | 398 | } |
| @@ -611,7 +612,7 @@ static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata, | |||
| 611 | 612 | ||
| 612 | mesh_path_sel_frame_tx(MPATH_PREP, flags, orig_addr, | 613 | mesh_path_sel_frame_tx(MPATH_PREP, flags, orig_addr, |
| 613 | cpu_to_le32(orig_sn), 0, target_addr, | 614 | cpu_to_le32(orig_sn), 0, target_addr, |
| 614 | cpu_to_le32(target_sn), mpath->next_hop->sta.addr, hopcount, | 615 | cpu_to_le32(target_sn), next_hop, hopcount, |
| 615 | ttl, cpu_to_le32(lifetime), cpu_to_le32(metric), | 616 | ttl, cpu_to_le32(lifetime), cpu_to_le32(metric), |
| 616 | 0, sdata); | 617 | 0, sdata); |
| 617 | rcu_read_unlock(); | 618 | rcu_read_unlock(); |
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 2312efe04c62..181ffd6efd81 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/etherdevice.h> | 10 | #include <linux/etherdevice.h> |
| 11 | #include <linux/list.h> | 11 | #include <linux/list.h> |
| 12 | #include <linux/random.h> | 12 | #include <linux/random.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <linux/spinlock.h> | 14 | #include <linux/spinlock.h> |
| 14 | #include <linux/string.h> | 15 | #include <linux/string.h> |
| 15 | #include <net/mac80211.h> | 16 | #include <net/mac80211.h> |
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index bc4e20e57ff5..7b7080e2b49f 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | * it under the terms of the GNU General Public License version 2 as | 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
| 8 | */ | 8 | */ |
| 9 | #include <linux/gfp.h> | ||
| 9 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
| 10 | #include <linux/random.h> | 11 | #include <linux/random.h> |
| 11 | #include "ieee80211_i.h" | 12 | #include "ieee80211_i.h" |
| @@ -744,7 +745,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 744 | break; | 745 | break; |
| 745 | default: | 746 | default: |
| 746 | /* should not get here, PLINK_BLOCKED is dealt with at the | 747 | /* should not get here, PLINK_BLOCKED is dealt with at the |
| 747 | * beggining of the function | 748 | * beginning of the function |
| 748 | */ | 749 | */ |
| 749 | spin_unlock_bh(&sta->lock); | 750 | spin_unlock_bh(&sta->lock); |
| 750 | break; | 751 | break; |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 41812a15eea0..875c8dec940a 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/rtnetlink.h> | 19 | #include <linux/rtnetlink.h> |
| 20 | #include <linux/pm_qos_params.h> | 20 | #include <linux/pm_qos_params.h> |
| 21 | #include <linux/crc32.h> | 21 | #include <linux/crc32.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | #include <net/mac80211.h> | 23 | #include <net/mac80211.h> |
| 23 | #include <asm/unaligned.h> | 24 | #include <asm/unaligned.h> |
| 24 | 25 | ||
| @@ -167,6 +168,8 @@ static u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata, | |||
| 167 | ht_changed = conf_is_ht(&local->hw.conf) != enable_ht || | 168 | ht_changed = conf_is_ht(&local->hw.conf) != enable_ht || |
| 168 | channel_type != local->hw.conf.channel_type; | 169 | channel_type != local->hw.conf.channel_type; |
| 169 | 170 | ||
| 171 | if (local->tmp_channel) | ||
| 172 | local->tmp_channel_type = channel_type; | ||
| 170 | local->oper_channel_type = channel_type; | 173 | local->oper_channel_type = channel_type; |
| 171 | 174 | ||
| 172 | if (ht_changed) { | 175 | if (ht_changed) { |
| @@ -177,7 +180,8 @@ static u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata, | |||
| 177 | sta = sta_info_get(sdata, bssid); | 180 | sta = sta_info_get(sdata, bssid); |
| 178 | if (sta) | 181 | if (sta) |
| 179 | rate_control_rate_update(local, sband, sta, | 182 | rate_control_rate_update(local, sband, sta, |
| 180 | IEEE80211_RC_HT_CHANGED); | 183 | IEEE80211_RC_HT_CHANGED, |
| 184 | local->oper_channel_type); | ||
| 181 | rcu_read_unlock(); | 185 | rcu_read_unlock(); |
| 182 | } | 186 | } |
| 183 | 187 | ||
| @@ -435,10 +439,12 @@ static void ieee80211_enable_ps(struct ieee80211_local *local, | |||
| 435 | if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) | 439 | if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) |
| 436 | ieee80211_send_nullfunc(local, sdata, 1); | 440 | ieee80211_send_nullfunc(local, sdata, 1); |
| 437 | 441 | ||
| 438 | if (!(local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)) { | 442 | if ((local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) && |
| 439 | conf->flags |= IEEE80211_CONF_PS; | 443 | (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)) |
| 440 | ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); | 444 | return; |
| 441 | } | 445 | |
| 446 | conf->flags |= IEEE80211_CONF_PS; | ||
| 447 | ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); | ||
| 442 | } | 448 | } |
| 443 | } | 449 | } |
| 444 | 450 | ||
| @@ -557,7 +563,8 @@ void ieee80211_dynamic_ps_enable_work(struct work_struct *work) | |||
| 557 | (!(ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED))) | 563 | (!(ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED))) |
| 558 | ieee80211_send_nullfunc(local, sdata, 1); | 564 | ieee80211_send_nullfunc(local, sdata, 1); |
| 559 | 565 | ||
| 560 | if (!(local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) || | 566 | if (!((local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) && |
| 567 | (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK)) || | ||
| 561 | (ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED)) { | 568 | (ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED)) { |
| 562 | ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED; | 569 | ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED; |
| 563 | local->hw.conf.flags |= IEEE80211_CONF_PS; | 570 | local->hw.conf.flags |= IEEE80211_CONF_PS; |
| @@ -1893,8 +1900,20 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, | |||
| 1893 | 1900 | ||
| 1894 | mutex_lock(&ifmgd->mtx); | 1901 | mutex_lock(&ifmgd->mtx); |
| 1895 | if (ifmgd->associated) { | 1902 | if (ifmgd->associated) { |
| 1896 | mutex_unlock(&ifmgd->mtx); | 1903 | if (!req->prev_bssid || |
| 1897 | return -EALREADY; | 1904 | memcmp(req->prev_bssid, ifmgd->associated->bssid, |
| 1905 | ETH_ALEN)) { | ||
| 1906 | /* | ||
| 1907 | * We are already associated and the request was not a | ||
| 1908 | * reassociation request from the current BSS, so | ||
| 1909 | * reject it. | ||
| 1910 | */ | ||
| 1911 | mutex_unlock(&ifmgd->mtx); | ||
| 1912 | return -EALREADY; | ||
| 1913 | } | ||
| 1914 | |||
| 1915 | /* Trying to reassociate - clear previous association state */ | ||
| 1916 | ieee80211_set_disassoc(sdata); | ||
| 1898 | } | 1917 | } |
| 1899 | mutex_unlock(&ifmgd->mtx); | 1918 | mutex_unlock(&ifmgd->mtx); |
| 1900 | 1919 | ||
| @@ -2011,7 +2030,8 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, | |||
| 2011 | continue; | 2030 | continue; |
| 2012 | 2031 | ||
| 2013 | if (wk->type != IEEE80211_WORK_DIRECT_PROBE && | 2032 | if (wk->type != IEEE80211_WORK_DIRECT_PROBE && |
| 2014 | wk->type != IEEE80211_WORK_AUTH) | 2033 | wk->type != IEEE80211_WORK_AUTH && |
| 2034 | wk->type != IEEE80211_WORK_ASSOC) | ||
| 2015 | continue; | 2035 | continue; |
| 2016 | 2036 | ||
| 2017 | if (memcmp(req->bss->bssid, wk->filter_ta, ETH_ALEN)) | 2037 | if (memcmp(req->bss->bssid, wk->filter_ta, ETH_ALEN)) |
diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index 0b299d236fa1..6d0bd198af19 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
| 12 | #include <linux/rtnetlink.h> | 12 | #include <linux/rtnetlink.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include "rate.h" | 14 | #include "rate.h" |
| 14 | #include "ieee80211_i.h" | 15 | #include "ieee80211_i.h" |
| 15 | #include "debugfs.h" | 16 | #include "debugfs.h" |
diff --git a/net/mac80211/rate.h b/net/mac80211/rate.h index b6108bca96d4..065a96190e32 100644 --- a/net/mac80211/rate.h +++ b/net/mac80211/rate.h | |||
| @@ -66,7 +66,8 @@ static inline void rate_control_rate_init(struct sta_info *sta) | |||
| 66 | 66 | ||
| 67 | static inline void rate_control_rate_update(struct ieee80211_local *local, | 67 | static inline void rate_control_rate_update(struct ieee80211_local *local, |
| 68 | struct ieee80211_supported_band *sband, | 68 | struct ieee80211_supported_band *sband, |
| 69 | struct sta_info *sta, u32 changed) | 69 | struct sta_info *sta, u32 changed, |
| 70 | enum nl80211_channel_type oper_chan_type) | ||
| 70 | { | 71 | { |
| 71 | struct rate_control_ref *ref = local->rate_ctrl; | 72 | struct rate_control_ref *ref = local->rate_ctrl; |
| 72 | struct ieee80211_sta *ista = &sta->sta; | 73 | struct ieee80211_sta *ista = &sta->sta; |
| @@ -74,7 +75,7 @@ static inline void rate_control_rate_update(struct ieee80211_local *local, | |||
| 74 | 75 | ||
| 75 | if (ref && ref->ops->rate_update) | 76 | if (ref && ref->ops->rate_update) |
| 76 | ref->ops->rate_update(ref->priv, sband, ista, | 77 | ref->ops->rate_update(ref->priv, sband, ista, |
| 77 | priv_sta, changed); | 78 | priv_sta, changed, oper_chan_type); |
| 78 | } | 79 | } |
| 79 | 80 | ||
| 80 | static inline void *rate_control_alloc_sta(struct rate_control_ref *ref, | 81 | static inline void *rate_control_alloc_sta(struct rate_control_ref *ref, |
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c index 6e5d68b4e427..818abfae9007 100644 --- a/net/mac80211/rc80211_minstrel.c +++ b/net/mac80211/rc80211_minstrel.c | |||
| @@ -50,6 +50,7 @@ | |||
| 50 | #include <linux/debugfs.h> | 50 | #include <linux/debugfs.h> |
| 51 | #include <linux/random.h> | 51 | #include <linux/random.h> |
| 52 | #include <linux/ieee80211.h> | 52 | #include <linux/ieee80211.h> |
| 53 | #include <linux/slab.h> | ||
| 53 | #include <net/mac80211.h> | 54 | #include <net/mac80211.h> |
| 54 | #include "rate.h" | 55 | #include "rate.h" |
| 55 | #include "rc80211_minstrel.h" | 56 | #include "rc80211_minstrel.h" |
diff --git a/net/mac80211/rc80211_minstrel_debugfs.c b/net/mac80211/rc80211_minstrel_debugfs.c index a715d9454f64..0e1f12b1b6dd 100644 --- a/net/mac80211/rc80211_minstrel_debugfs.c +++ b/net/mac80211/rc80211_minstrel_debugfs.c | |||
| @@ -49,6 +49,7 @@ | |||
| 49 | #include <linux/skbuff.h> | 49 | #include <linux/skbuff.h> |
| 50 | #include <linux/debugfs.h> | 50 | #include <linux/debugfs.h> |
| 51 | #include <linux/ieee80211.h> | 51 | #include <linux/ieee80211.h> |
| 52 | #include <linux/slab.h> | ||
| 52 | #include <net/mac80211.h> | 53 | #include <net/mac80211.h> |
| 53 | #include "rc80211_minstrel.h" | 54 | #include "rc80211_minstrel.h" |
| 54 | 55 | ||
diff --git a/net/mac80211/rc80211_pid_algo.c b/net/mac80211/rc80211_pid_algo.c index 2652a374974e..aeda65466f3e 100644 --- a/net/mac80211/rc80211_pid_algo.c +++ b/net/mac80211/rc80211_pid_algo.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
| 14 | #include <linux/skbuff.h> | 14 | #include <linux/skbuff.h> |
| 15 | #include <linux/debugfs.h> | 15 | #include <linux/debugfs.h> |
| 16 | #include <linux/slab.h> | ||
| 16 | #include <net/mac80211.h> | 17 | #include <net/mac80211.h> |
| 17 | #include "rate.h" | 18 | #include "rate.h" |
| 18 | #include "mesh.h" | 19 | #include "mesh.h" |
diff --git a/net/mac80211/rc80211_pid_debugfs.c b/net/mac80211/rc80211_pid_debugfs.c index 45667054a5f3..47438b4a9af5 100644 --- a/net/mac80211/rc80211_pid_debugfs.c +++ b/net/mac80211/rc80211_pid_debugfs.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/netdevice.h> | 12 | #include <linux/netdevice.h> |
| 13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
| 14 | #include <linux/skbuff.h> | 14 | #include <linux/skbuff.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | 16 | ||
| 16 | #include <net/mac80211.h> | 17 | #include <net/mac80211.h> |
| 17 | #include "rate.h" | 18 | #include "rate.h" |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index b5c48de81d8b..04ea07f0e78a 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/jiffies.h> | 12 | #include <linux/jiffies.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
| 14 | #include <linux/skbuff.h> | 15 | #include <linux/skbuff.h> |
| 15 | #include <linux/netdevice.h> | 16 | #include <linux/netdevice.h> |
| @@ -1973,6 +1974,11 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) | |||
| 1973 | goto handled; | 1974 | goto handled; |
| 1974 | } | 1975 | } |
| 1975 | break; | 1976 | break; |
| 1977 | case MESH_PLINK_CATEGORY: | ||
| 1978 | case MESH_PATH_SEL_CATEGORY: | ||
| 1979 | if (ieee80211_vif_is_mesh(&sdata->vif)) | ||
| 1980 | return ieee80211_mesh_rx_mgmt(sdata, rx->skb); | ||
| 1981 | break; | ||
| 1976 | } | 1982 | } |
| 1977 | 1983 | ||
| 1978 | /* | 1984 | /* |
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index b822dce97867..85507bd9e341 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | #include <linux/if_arp.h> | 15 | #include <linux/if_arp.h> |
| 16 | #include <linux/rtnetlink.h> | 16 | #include <linux/rtnetlink.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | #include <net/mac80211.h> | 18 | #include <net/mac80211.h> |
| 18 | 19 | ||
| 19 | #include "ieee80211_i.h" | 20 | #include "ieee80211_i.h" |
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 211c475f73c6..fb12cec4d333 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
| @@ -93,12 +93,18 @@ struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata, | |||
| 93 | struct ieee80211_local *local = sdata->local; | 93 | struct ieee80211_local *local = sdata->local; |
| 94 | struct sta_info *sta; | 94 | struct sta_info *sta; |
| 95 | 95 | ||
| 96 | sta = rcu_dereference(local->sta_hash[STA_HASH(addr)]); | 96 | sta = rcu_dereference_check(local->sta_hash[STA_HASH(addr)], |
| 97 | rcu_read_lock_held() || | ||
| 98 | lockdep_is_held(&local->sta_lock) || | ||
| 99 | lockdep_is_held(&local->sta_mtx)); | ||
| 97 | while (sta) { | 100 | while (sta) { |
| 98 | if (sta->sdata == sdata && | 101 | if (sta->sdata == sdata && |
| 99 | memcmp(sta->sta.addr, addr, ETH_ALEN) == 0) | 102 | memcmp(sta->sta.addr, addr, ETH_ALEN) == 0) |
| 100 | break; | 103 | break; |
| 101 | sta = rcu_dereference(sta->hnext); | 104 | sta = rcu_dereference_check(sta->hnext, |
| 105 | rcu_read_lock_held() || | ||
| 106 | lockdep_is_held(&local->sta_lock) || | ||
| 107 | lockdep_is_held(&local->sta_mtx)); | ||
| 102 | } | 108 | } |
| 103 | return sta; | 109 | return sta; |
| 104 | } | 110 | } |
| @@ -113,13 +119,19 @@ struct sta_info *sta_info_get_bss(struct ieee80211_sub_if_data *sdata, | |||
| 113 | struct ieee80211_local *local = sdata->local; | 119 | struct ieee80211_local *local = sdata->local; |
| 114 | struct sta_info *sta; | 120 | struct sta_info *sta; |
| 115 | 121 | ||
| 116 | sta = rcu_dereference(local->sta_hash[STA_HASH(addr)]); | 122 | sta = rcu_dereference_check(local->sta_hash[STA_HASH(addr)], |
| 123 | rcu_read_lock_held() || | ||
| 124 | lockdep_is_held(&local->sta_lock) || | ||
| 125 | lockdep_is_held(&local->sta_mtx)); | ||
| 117 | while (sta) { | 126 | while (sta) { |
| 118 | if ((sta->sdata == sdata || | 127 | if ((sta->sdata == sdata || |
| 119 | sta->sdata->bss == sdata->bss) && | 128 | sta->sdata->bss == sdata->bss) && |
| 120 | memcmp(sta->sta.addr, addr, ETH_ALEN) == 0) | 129 | memcmp(sta->sta.addr, addr, ETH_ALEN) == 0) |
| 121 | break; | 130 | break; |
| 122 | sta = rcu_dereference(sta->hnext); | 131 | sta = rcu_dereference_check(sta->hnext, |
| 132 | rcu_read_lock_held() || | ||
| 133 | lockdep_is_held(&local->sta_lock) || | ||
| 134 | lockdep_is_held(&local->sta_mtx)); | ||
| 123 | } | 135 | } |
| 124 | return sta; | 136 | return sta; |
| 125 | } | 137 | } |
| @@ -434,6 +446,7 @@ int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU) | |||
| 434 | /* check if STA exists already */ | 446 | /* check if STA exists already */ |
| 435 | if (sta_info_get_bss(sdata, sta->sta.addr)) { | 447 | if (sta_info_get_bss(sdata, sta->sta.addr)) { |
| 436 | spin_unlock_irqrestore(&local->sta_lock, flags); | 448 | spin_unlock_irqrestore(&local->sta_lock, flags); |
| 449 | mutex_unlock(&local->sta_mtx); | ||
| 437 | rcu_read_lock(); | 450 | rcu_read_lock(); |
| 438 | err = -EEXIST; | 451 | err = -EEXIST; |
| 439 | goto out_free; | 452 | goto out_free; |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index cbe53ed4fb0b..cfc473e1b050 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
| @@ -1991,6 +1991,7 @@ static bool ieee80211_tx_pending_skb(struct ieee80211_local *local, | |||
| 1991 | void ieee80211_tx_pending(unsigned long data) | 1991 | void ieee80211_tx_pending(unsigned long data) |
| 1992 | { | 1992 | { |
| 1993 | struct ieee80211_local *local = (struct ieee80211_local *)data; | 1993 | struct ieee80211_local *local = (struct ieee80211_local *)data; |
| 1994 | struct ieee80211_sub_if_data *sdata; | ||
| 1994 | unsigned long flags; | 1995 | unsigned long flags; |
| 1995 | int i; | 1996 | int i; |
| 1996 | bool txok; | 1997 | bool txok; |
| @@ -2029,6 +2030,11 @@ void ieee80211_tx_pending(unsigned long data) | |||
| 2029 | if (!txok) | 2030 | if (!txok) |
| 2030 | break; | 2031 | break; |
| 2031 | } | 2032 | } |
| 2033 | |||
| 2034 | if (skb_queue_empty(&local->pending[i])) | ||
| 2035 | list_for_each_entry_rcu(sdata, &local->interfaces, list) | ||
| 2036 | netif_tx_wake_queue( | ||
| 2037 | netdev_get_tx_queue(sdata->dev, i)); | ||
| 2032 | } | 2038 | } |
| 2033 | spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); | 2039 | spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); |
| 2034 | 2040 | ||
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index c453226f06b2..53af57047435 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
| @@ -279,13 +279,13 @@ static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue, | |||
| 279 | /* someone still has this queue stopped */ | 279 | /* someone still has this queue stopped */ |
| 280 | return; | 280 | return; |
| 281 | 281 | ||
| 282 | if (!skb_queue_empty(&local->pending[queue])) | 282 | if (skb_queue_empty(&local->pending[queue])) { |
| 283 | rcu_read_lock(); | ||
| 284 | list_for_each_entry_rcu(sdata, &local->interfaces, list) | ||
| 285 | netif_tx_wake_queue(netdev_get_tx_queue(sdata->dev, queue)); | ||
| 286 | rcu_read_unlock(); | ||
| 287 | } else | ||
| 283 | tasklet_schedule(&local->tx_pending_tasklet); | 288 | tasklet_schedule(&local->tx_pending_tasklet); |
| 284 | |||
| 285 | rcu_read_lock(); | ||
| 286 | list_for_each_entry_rcu(sdata, &local->interfaces, list) | ||
| 287 | netif_tx_wake_queue(netdev_get_tx_queue(sdata->dev, queue)); | ||
| 288 | rcu_read_unlock(); | ||
| 289 | } | 289 | } |
| 290 | 290 | ||
| 291 | void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue, | 291 | void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue, |
| @@ -1097,9 +1097,9 @@ int ieee80211_reconfig(struct ieee80211_local *local) | |||
| 1097 | */ | 1097 | */ |
| 1098 | res = drv_start(local); | 1098 | res = drv_start(local); |
| 1099 | if (res) { | 1099 | if (res) { |
| 1100 | WARN(local->suspended, "Harware became unavailable " | 1100 | WARN(local->suspended, "Hardware became unavailable " |
| 1101 | "upon resume. This is could be a software issue" | 1101 | "upon resume. This could be a software issue " |
| 1102 | "prior to suspend or a hardware issue\n"); | 1102 | "prior to suspend or a hardware issue.\n"); |
| 1103 | return res; | 1103 | return res; |
| 1104 | } | 1104 | } |
| 1105 | 1105 | ||
diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c index 5d745f2d7236..5f3a4113bda1 100644 --- a/net/mac80211/wep.c +++ b/net/mac80211/wep.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/err.h> | 17 | #include <linux/err.h> |
| 18 | #include <linux/mm.h> | 18 | #include <linux/mm.h> |
| 19 | #include <linux/scatterlist.h> | 19 | #include <linux/scatterlist.h> |
| 20 | #include <linux/slab.h> | ||
| 20 | #include <asm/unaligned.h> | 21 | #include <asm/unaligned.h> |
| 21 | 22 | ||
| 22 | #include <net/mac80211.h> | 23 | #include <net/mac80211.h> |
diff --git a/net/mac80211/work.c b/net/mac80211/work.c index 1e1ea3007b06..15e1ba931b87 100644 --- a/net/mac80211/work.c +++ b/net/mac80211/work.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/if_arp.h> | 19 | #include <linux/if_arp.h> |
| 20 | #include <linux/etherdevice.h> | 20 | #include <linux/etherdevice.h> |
| 21 | #include <linux/crc32.h> | 21 | #include <linux/crc32.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | #include <net/mac80211.h> | 23 | #include <net/mac80211.h> |
| 23 | #include <asm/unaligned.h> | 24 | #include <asm/unaligned.h> |
| 24 | 25 | ||
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index f4971cd45c64..0adbcc941ac9 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c | |||
| @@ -9,10 +9,10 @@ | |||
| 9 | 9 | ||
| 10 | #include <linux/netdevice.h> | 10 | #include <linux/netdevice.h> |
| 11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 12 | #include <linux/slab.h> | ||
| 13 | #include <linux/skbuff.h> | 12 | #include <linux/skbuff.h> |
| 14 | #include <linux/compiler.h> | 13 | #include <linux/compiler.h> |
| 15 | #include <linux/ieee80211.h> | 14 | #include <linux/ieee80211.h> |
| 15 | #include <linux/gfp.h> | ||
| 16 | #include <asm/unaligned.h> | 16 | #include <asm/unaligned.h> |
| 17 | #include <net/mac80211.h> | 17 | #include <net/mac80211.h> |
| 18 | 18 | ||
diff --git a/net/netfilter/core.c b/net/netfilter/core.c index 60ec4e4badaa..78b505d33bfb 100644 --- a/net/netfilter/core.c +++ b/net/netfilter/core.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/inetdevice.h> | 19 | #include <linux/inetdevice.h> |
| 20 | #include <linux/proc_fs.h> | 20 | #include <linux/proc_fs.h> |
| 21 | #include <linux/mutex.h> | 21 | #include <linux/mutex.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | #include <net/net_namespace.h> | 23 | #include <net/net_namespace.h> |
| 23 | #include <net/sock.h> | 24 | #include <net/sock.h> |
| 24 | 25 | ||
diff --git a/net/netfilter/ipvs/ip_vs_app.c b/net/netfilter/ipvs/ip_vs_app.c index 3c7e42735b60..1cb0e834f8ff 100644 --- a/net/netfilter/ipvs/ip_vs_app.c +++ b/net/netfilter/ipvs/ip_vs_app.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <linux/in.h> | 27 | #include <linux/in.h> |
| 28 | #include <linux/ip.h> | 28 | #include <linux/ip.h> |
| 29 | #include <linux/netfilter.h> | 29 | #include <linux/netfilter.h> |
| 30 | #include <linux/slab.h> | ||
| 30 | #include <net/net_namespace.h> | 31 | #include <net/net_namespace.h> |
| 31 | #include <net/protocol.h> | 32 | #include <net/protocol.h> |
| 32 | #include <net/tcp.h> | 33 | #include <net/tcp.h> |
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c index 60bb41a8d8d4..d8f7e8ef67b4 100644 --- a/net/netfilter/ipvs/ip_vs_conn.c +++ b/net/netfilter/ipvs/ip_vs_conn.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include <linux/module.h> | 32 | #include <linux/module.h> |
| 33 | #include <linux/vmalloc.h> | 33 | #include <linux/vmalloc.h> |
| 34 | #include <linux/proc_fs.h> /* for proc_net_* */ | 34 | #include <linux/proc_fs.h> /* for proc_net_* */ |
| 35 | #include <linux/slab.h> | ||
| 35 | #include <linux/seq_file.h> | 36 | #include <linux/seq_file.h> |
| 36 | #include <linux/jhash.h> | 37 | #include <linux/jhash.h> |
| 37 | #include <linux/random.h> | 38 | #include <linux/random.h> |
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c index 44590887a92c..1cd6e3fd058b 100644 --- a/net/netfilter/ipvs/ip_vs_core.c +++ b/net/netfilter/ipvs/ip_vs_core.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <linux/tcp.h> | 33 | #include <linux/tcp.h> |
| 34 | #include <linux/sctp.h> | 34 | #include <linux/sctp.h> |
| 35 | #include <linux/icmp.h> | 35 | #include <linux/icmp.h> |
| 36 | #include <linux/slab.h> | ||
| 36 | 37 | ||
| 37 | #include <net/ip.h> | 38 | #include <net/ip.h> |
| 38 | #include <net/tcp.h> | 39 | #include <net/tcp.h> |
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 7ee9c3426f44..36dc1d88c2fa 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #include <linux/workqueue.h> | 31 | #include <linux/workqueue.h> |
| 32 | #include <linux/swap.h> | 32 | #include <linux/swap.h> |
| 33 | #include <linux/seq_file.h> | 33 | #include <linux/seq_file.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | 35 | ||
| 35 | #include <linux/netfilter.h> | 36 | #include <linux/netfilter.h> |
| 36 | #include <linux/netfilter_ipv4.h> | 37 | #include <linux/netfilter_ipv4.h> |
diff --git a/net/netfilter/ipvs/ip_vs_dh.c b/net/netfilter/ipvs/ip_vs_dh.c index fe3e18834b91..95fd0d14200b 100644 --- a/net/netfilter/ipvs/ip_vs_dh.c +++ b/net/netfilter/ipvs/ip_vs_dh.c | |||
| @@ -39,6 +39,7 @@ | |||
| 39 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt | 39 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
| 40 | 40 | ||
| 41 | #include <linux/ip.h> | 41 | #include <linux/ip.h> |
| 42 | #include <linux/slab.h> | ||
| 42 | #include <linux/module.h> | 43 | #include <linux/module.h> |
| 43 | #include <linux/kernel.h> | 44 | #include <linux/kernel.h> |
| 44 | #include <linux/skbuff.h> | 45 | #include <linux/skbuff.h> |
diff --git a/net/netfilter/ipvs/ip_vs_est.c b/net/netfilter/ipvs/ip_vs_est.c index 702b53ca937c..ff28801962e0 100644 --- a/net/netfilter/ipvs/ip_vs_est.c +++ b/net/netfilter/ipvs/ip_vs_est.c | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | 17 | ||
| 18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
| 19 | #include <linux/jiffies.h> | 19 | #include <linux/jiffies.h> |
| 20 | #include <linux/slab.h> | ||
| 21 | #include <linux/types.h> | 20 | #include <linux/types.h> |
| 22 | #include <linux/interrupt.h> | 21 | #include <linux/interrupt.h> |
| 23 | #include <linux/sysctl.h> | 22 | #include <linux/sysctl.h> |
diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c index 73f38ea98f25..2c7f185dfae4 100644 --- a/net/netfilter/ipvs/ip_vs_ftp.c +++ b/net/netfilter/ipvs/ip_vs_ftp.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include <linux/in.h> | 32 | #include <linux/in.h> |
| 33 | #include <linux/ip.h> | 33 | #include <linux/ip.h> |
| 34 | #include <linux/netfilter.h> | 34 | #include <linux/netfilter.h> |
| 35 | #include <linux/gfp.h> | ||
| 35 | #include <net/protocol.h> | 36 | #include <net/protocol.h> |
| 36 | #include <net/tcp.h> | 37 | #include <net/tcp.h> |
| 37 | #include <asm/unaligned.h> | 38 | #include <asm/unaligned.h> |
diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c index 1b9370db2305..94a45213faa6 100644 --- a/net/netfilter/ipvs/ip_vs_lblc.c +++ b/net/netfilter/ipvs/ip_vs_lblc.c | |||
| @@ -43,6 +43,7 @@ | |||
| 43 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt | 43 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
| 44 | 44 | ||
| 45 | #include <linux/ip.h> | 45 | #include <linux/ip.h> |
| 46 | #include <linux/slab.h> | ||
| 46 | #include <linux/module.h> | 47 | #include <linux/module.h> |
| 47 | #include <linux/kernel.h> | 48 | #include <linux/kernel.h> |
| 48 | #include <linux/skbuff.h> | 49 | #include <linux/skbuff.h> |
diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c index caa58fa1438a..535dc2b419d8 100644 --- a/net/netfilter/ipvs/ip_vs_lblcr.c +++ b/net/netfilter/ipvs/ip_vs_lblcr.c | |||
| @@ -46,6 +46,7 @@ | |||
| 46 | #include <linux/skbuff.h> | 46 | #include <linux/skbuff.h> |
| 47 | #include <linux/jiffies.h> | 47 | #include <linux/jiffies.h> |
| 48 | #include <linux/list.h> | 48 | #include <linux/list.h> |
| 49 | #include <linux/slab.h> | ||
| 49 | 50 | ||
| 50 | /* for sysctl */ | 51 | /* for sysctl */ |
| 51 | #include <linux/fs.h> | 52 | #include <linux/fs.h> |
diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c index 0e584553819d..7fc49f4cf5ad 100644 --- a/net/netfilter/ipvs/ip_vs_proto.c +++ b/net/netfilter/ipvs/ip_vs_proto.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
| 20 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
| 21 | #include <linux/skbuff.h> | 21 | #include <linux/skbuff.h> |
| 22 | #include <linux/gfp.h> | ||
| 22 | #include <linux/in.h> | 23 | #include <linux/in.h> |
| 23 | #include <linux/ip.h> | 24 | #include <linux/ip.h> |
| 24 | #include <net/protocol.h> | 25 | #include <net/protocol.h> |
diff --git a/net/netfilter/ipvs/ip_vs_sh.c b/net/netfilter/ipvs/ip_vs_sh.c index 8e6cfd36e6f0..e6cc174fbc06 100644 --- a/net/netfilter/ipvs/ip_vs_sh.c +++ b/net/netfilter/ipvs/ip_vs_sh.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt | 36 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
| 37 | 37 | ||
| 38 | #include <linux/ip.h> | 38 | #include <linux/ip.h> |
| 39 | #include <linux/slab.h> | ||
| 39 | #include <linux/module.h> | 40 | #include <linux/module.h> |
| 40 | #include <linux/kernel.h> | 41 | #include <linux/kernel.h> |
| 41 | #include <linux/skbuff.h> | 42 | #include <linux/skbuff.h> |
diff --git a/net/netfilter/ipvs/ip_vs_wrr.c b/net/netfilter/ipvs/ip_vs_wrr.c index 3c115fc19784..30db633f88f1 100644 --- a/net/netfilter/ipvs/ip_vs_wrr.c +++ b/net/netfilter/ipvs/ip_vs_wrr.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
| 25 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
| 26 | #include <linux/slab.h> | ||
| 26 | #include <linux/net.h> | 27 | #include <linux/net.h> |
| 27 | #include <linux/gcd.h> | 28 | #include <linux/gcd.h> |
| 28 | 29 | ||
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c index 223b5018c7dc..e450cd6f4eb5 100644 --- a/net/netfilter/ipvs/ip_vs_xmit.c +++ b/net/netfilter/ipvs/ip_vs_xmit.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt | 17 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
| 18 | 18 | ||
| 19 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
| 20 | #include <linux/slab.h> | ||
| 20 | #include <linux/tcp.h> /* for tcphdr */ | 21 | #include <linux/tcp.h> /* for tcphdr */ |
| 21 | #include <net/ip.h> | 22 | #include <net/ip.h> |
| 22 | #include <net/tcp.h> /* for csum_tcpudp_magic */ | 23 | #include <net/tcp.h> /* for csum_tcpudp_magic */ |
diff --git a/net/netfilter/nf_conntrack_acct.c b/net/netfilter/nf_conntrack_acct.c index 018f90db511c..ab81b380eae6 100644 --- a/net/netfilter/nf_conntrack_acct.c +++ b/net/netfilter/nf_conntrack_acct.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #include <linux/netfilter.h> | 11 | #include <linux/netfilter.h> |
| 12 | #include <linux/slab.h> | ||
| 12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
| 13 | #include <linux/moduleparam.h> | 14 | #include <linux/moduleparam.h> |
| 14 | 15 | ||
diff --git a/net/netfilter/nf_conntrack_amanda.c b/net/netfilter/nf_conntrack_amanda.c index 07d9d8857e5d..372e80f07a81 100644 --- a/net/netfilter/nf_conntrack_amanda.c +++ b/net/netfilter/nf_conntrack_amanda.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/in.h> | 16 | #include <linux/in.h> |
| 17 | #include <linux/udp.h> | 17 | #include <linux/udp.h> |
| 18 | #include <linux/netfilter.h> | 18 | #include <linux/netfilter.h> |
| 19 | #include <linux/gfp.h> | ||
| 19 | 20 | ||
| 20 | #include <net/netfilter/nf_conntrack.h> | 21 | #include <net/netfilter/nf_conntrack.h> |
| 21 | #include <net/netfilter/nf_conntrack_expect.h> | 22 | #include <net/netfilter/nf_conntrack_expect.h> |
diff --git a/net/netfilter/nf_conntrack_ecache.c b/net/netfilter/nf_conntrack_ecache.c index d5a9bcd7d61b..f516961a83b4 100644 --- a/net/netfilter/nf_conntrack_ecache.c +++ b/net/netfilter/nf_conntrack_ecache.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/percpu.h> | 18 | #include <linux/percpu.h> |
| 19 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
| 20 | #include <linux/netdevice.h> | 20 | #include <linux/netdevice.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | 22 | ||
| 22 | #include <net/netfilter/nf_conntrack.h> | 23 | #include <net/netfilter/nf_conntrack.h> |
| 23 | #include <net/netfilter/nf_conntrack_core.h> | 24 | #include <net/netfilter/nf_conntrack_core.h> |
diff --git a/net/netfilter/nf_conntrack_ftp.c b/net/netfilter/nf_conntrack_ftp.c index f0732aa18e4f..2ae3169e7633 100644 --- a/net/netfilter/nf_conntrack_ftp.c +++ b/net/netfilter/nf_conntrack_ftp.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/moduleparam.h> | 13 | #include <linux/moduleparam.h> |
| 14 | #include <linux/netfilter.h> | 14 | #include <linux/netfilter.h> |
| 15 | #include <linux/ip.h> | 15 | #include <linux/ip.h> |
| 16 | #include <linux/slab.h> | ||
| 16 | #include <linux/ipv6.h> | 17 | #include <linux/ipv6.h> |
| 17 | #include <linux/ctype.h> | 18 | #include <linux/ctype.h> |
| 18 | #include <linux/inet.h> | 19 | #include <linux/inet.h> |
diff --git a/net/netfilter/nf_conntrack_h323_main.c b/net/netfilter/nf_conntrack_h323_main.c index a1c8dd917e12..a487c8038044 100644 --- a/net/netfilter/nf_conntrack_h323_main.c +++ b/net/netfilter/nf_conntrack_h323_main.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/inet.h> | 17 | #include <linux/inet.h> |
| 18 | #include <linux/in.h> | 18 | #include <linux/in.h> |
| 19 | #include <linux/ip.h> | 19 | #include <linux/ip.h> |
| 20 | #include <linux/slab.h> | ||
| 20 | #include <linux/udp.h> | 21 | #include <linux/udp.h> |
| 21 | #include <linux/tcp.h> | 22 | #include <linux/tcp.h> |
| 22 | #include <linux/skbuff.h> | 23 | #include <linux/skbuff.h> |
diff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c index 4509fa6726f8..59e1a4cd4e8b 100644 --- a/net/netfilter/nf_conntrack_helper.c +++ b/net/netfilter/nf_conntrack_helper.c | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include <linux/skbuff.h> | 15 | #include <linux/skbuff.h> |
| 16 | #include <linux/vmalloc.h> | 16 | #include <linux/vmalloc.h> |
| 17 | #include <linux/stddef.h> | 17 | #include <linux/stddef.h> |
| 18 | #include <linux/slab.h> | ||
| 19 | #include <linux/random.h> | 18 | #include <linux/random.h> |
| 20 | #include <linux/err.h> | 19 | #include <linux/err.h> |
| 21 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
diff --git a/net/netfilter/nf_conntrack_irc.c b/net/netfilter/nf_conntrack_irc.c index 8bd98c84f77e..7673930ca342 100644 --- a/net/netfilter/nf_conntrack_irc.c +++ b/net/netfilter/nf_conntrack_irc.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/ip.h> | 15 | #include <linux/ip.h> |
| 16 | #include <linux/tcp.h> | 16 | #include <linux/tcp.h> |
| 17 | #include <linux/netfilter.h> | 17 | #include <linux/netfilter.h> |
| 18 | #include <linux/slab.h> | ||
| 18 | 19 | ||
| 19 | #include <net/netfilter/nf_conntrack.h> | 20 | #include <net/netfilter/nf_conntrack.h> |
| 20 | #include <net/netfilter/nf_conntrack_expect.h> | 21 | #include <net/netfilter/nf_conntrack_expect.h> |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 2b2af631d2b8..afc52f2ee4ac 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <linux/netlink.h> | 27 | #include <linux/netlink.h> |
| 28 | #include <linux/spinlock.h> | 28 | #include <linux/spinlock.h> |
| 29 | #include <linux/interrupt.h> | 29 | #include <linux/interrupt.h> |
| 30 | #include <linux/slab.h> | ||
| 30 | 31 | ||
| 31 | #include <linux/netfilter.h> | 32 | #include <linux/netfilter.h> |
| 32 | #include <net/netlink.h> | 33 | #include <net/netlink.h> |
| @@ -582,7 +583,9 @@ nla_put_failure: | |||
| 582 | nlmsg_failure: | 583 | nlmsg_failure: |
| 583 | kfree_skb(skb); | 584 | kfree_skb(skb); |
| 584 | errout: | 585 | errout: |
| 585 | nfnetlink_set_err(net, 0, group, -ENOBUFS); | 586 | if (nfnetlink_set_err(net, 0, group, -ENOBUFS) > 0) |
| 587 | return -ENOBUFS; | ||
| 588 | |||
| 586 | return 0; | 589 | return 0; |
| 587 | } | 590 | } |
| 588 | #endif /* CONFIG_NF_CONNTRACK_EVENTS */ | 591 | #endif /* CONFIG_NF_CONNTRACK_EVENTS */ |
diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c index 1a4568bf7ea5..a44fa75b5178 100644 --- a/net/netfilter/nf_conntrack_proto.c +++ b/net/netfilter/nf_conntrack_proto.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
| 13 | #include <linux/netfilter.h> | 13 | #include <linux/netfilter.h> |
| 14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
| 16 | #include <linux/skbuff.h> | 17 | #include <linux/skbuff.h> |
| 17 | #include <linux/vmalloc.h> | 18 | #include <linux/vmalloc.h> |
diff --git a/net/netfilter/nf_conntrack_proto_dccp.c b/net/netfilter/nf_conntrack_proto_dccp.c index 9a2815549375..5292560d6d4a 100644 --- a/net/netfilter/nf_conntrack_proto_dccp.c +++ b/net/netfilter/nf_conntrack_proto_dccp.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
| 16 | #include <linux/skbuff.h> | 16 | #include <linux/skbuff.h> |
| 17 | #include <linux/dccp.h> | 17 | #include <linux/dccp.h> |
| 18 | #include <linux/slab.h> | ||
| 18 | 19 | ||
| 19 | #include <net/net_namespace.h> | 20 | #include <net/net_namespace.h> |
| 20 | #include <net/netns/generic.h> | 21 | #include <net/netns/generic.h> |
diff --git a/net/netfilter/nf_conntrack_proto_gre.c b/net/netfilter/nf_conntrack_proto_gre.c index d899b1a69940..cf616e55ca41 100644 --- a/net/netfilter/nf_conntrack_proto_gre.c +++ b/net/netfilter/nf_conntrack_proto_gre.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #include <linux/in.h> | 31 | #include <linux/in.h> |
| 32 | #include <linux/netdevice.h> | 32 | #include <linux/netdevice.h> |
| 33 | #include <linux/skbuff.h> | 33 | #include <linux/skbuff.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | #include <net/dst.h> | 35 | #include <net/dst.h> |
| 35 | #include <net/net_namespace.h> | 36 | #include <net/net_namespace.h> |
| 36 | #include <net/netns/generic.h> | 37 | #include <net/netns/generic.h> |
diff --git a/net/netfilter/nf_conntrack_sane.c b/net/netfilter/nf_conntrack_sane.c index dcfecbb81c46..d9e27734b2a2 100644 --- a/net/netfilter/nf_conntrack_sane.c +++ b/net/netfilter/nf_conntrack_sane.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
| 21 | #include <linux/moduleparam.h> | 21 | #include <linux/moduleparam.h> |
| 22 | #include <linux/netfilter.h> | 22 | #include <linux/netfilter.h> |
| 23 | #include <linux/slab.h> | ||
| 23 | #include <linux/in.h> | 24 | #include <linux/in.h> |
| 24 | #include <linux/tcp.h> | 25 | #include <linux/tcp.h> |
| 25 | #include <net/netfilter/nf_conntrack.h> | 26 | #include <net/netfilter/nf_conntrack.h> |
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c index 8dd75d90efc0..c6cd1b84eddd 100644 --- a/net/netfilter/nf_conntrack_sip.c +++ b/net/netfilter/nf_conntrack_sip.c | |||
| @@ -284,7 +284,7 @@ EXPORT_SYMBOL_GPL(ct_sip_parse_request); | |||
| 284 | * tabs, spaces and continuation lines, which are treated as a single whitespace | 284 | * tabs, spaces and continuation lines, which are treated as a single whitespace |
| 285 | * character. | 285 | * character. |
| 286 | * | 286 | * |
| 287 | * Some headers may appear multiple times. A comma seperated list of values is | 287 | * Some headers may appear multiple times. A comma separated list of values is |
| 288 | * equivalent to multiple headers. | 288 | * equivalent to multiple headers. |
| 289 | */ | 289 | */ |
| 290 | static const struct sip_header ct_sip_hdrs[] = { | 290 | static const struct sip_header ct_sip_hdrs[] = { |
| @@ -421,7 +421,7 @@ int ct_sip_get_header(const struct nf_conn *ct, const char *dptr, | |||
| 421 | } | 421 | } |
| 422 | EXPORT_SYMBOL_GPL(ct_sip_get_header); | 422 | EXPORT_SYMBOL_GPL(ct_sip_get_header); |
| 423 | 423 | ||
| 424 | /* Get next header field in a list of comma seperated values */ | 424 | /* Get next header field in a list of comma separated values */ |
| 425 | static int ct_sip_next_header(const struct nf_conn *ct, const char *dptr, | 425 | static int ct_sip_next_header(const struct nf_conn *ct, const char *dptr, |
| 426 | unsigned int dataoff, unsigned int datalen, | 426 | unsigned int dataoff, unsigned int datalen, |
| 427 | enum sip_header_types type, | 427 | enum sip_header_types type, |
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c index 24a42efe62ef..faa8eb3722b9 100644 --- a/net/netfilter/nf_conntrack_standalone.c +++ b/net/netfilter/nf_conntrack_standalone.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | #include <linux/types.h> | 9 | #include <linux/types.h> |
| 10 | #include <linux/netfilter.h> | 10 | #include <linux/netfilter.h> |
| 11 | #include <linux/slab.h> | ||
| 11 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| 12 | #include <linux/skbuff.h> | 13 | #include <linux/skbuff.h> |
| 13 | #include <linux/proc_fs.h> | 14 | #include <linux/proc_fs.h> |
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c index ba095fd014e5..c49ef219899e 100644 --- a/net/netfilter/nf_queue.c +++ b/net/netfilter/nf_queue.c | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | #include <linux/kernel.h> | 1 | #include <linux/kernel.h> |
| 2 | #include <linux/slab.h> | ||
| 2 | #include <linux/init.h> | 3 | #include <linux/init.h> |
| 3 | #include <linux/module.h> | 4 | #include <linux/module.h> |
| 4 | #include <linux/proc_fs.h> | 5 | #include <linux/proc_fs.h> |
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index 8eb0cc23ada3..6afa3d52ea5f 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c | |||
| @@ -113,9 +113,9 @@ int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, | |||
| 113 | } | 113 | } |
| 114 | EXPORT_SYMBOL_GPL(nfnetlink_send); | 114 | EXPORT_SYMBOL_GPL(nfnetlink_send); |
| 115 | 115 | ||
| 116 | void nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error) | 116 | int nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error) |
| 117 | { | 117 | { |
| 118 | netlink_set_err(net->nfnl, pid, group, error); | 118 | return netlink_set_err(net->nfnl, pid, group, error); |
| 119 | } | 119 | } |
| 120 | EXPORT_SYMBOL_GPL(nfnetlink_set_err); | 120 | EXPORT_SYMBOL_GPL(nfnetlink_set_err); |
| 121 | 121 | ||
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index d9b8fb8ab340..203643fb2c52 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/list.h> | 28 | #include <linux/list.h> |
| 29 | #include <linux/jhash.h> | 29 | #include <linux/jhash.h> |
| 30 | #include <linux/random.h> | 30 | #include <linux/random.h> |
| 31 | #include <linux/slab.h> | ||
| 31 | #include <net/sock.h> | 32 | #include <net/sock.h> |
| 32 | #include <net/netfilter/nf_log.h> | 33 | #include <net/netfilter/nf_log.h> |
| 33 | #include <net/netfilter/nfnetlink_log.h> | 34 | #include <net/netfilter/nfnetlink_log.h> |
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index 7ba4abc405c9..e70a6ef1f4f2 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/skbuff.h> | 18 | #include <linux/skbuff.h> |
| 19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
| 20 | #include <linux/spinlock.h> | 20 | #include <linux/spinlock.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | #include <linux/notifier.h> | 22 | #include <linux/notifier.h> |
| 22 | #include <linux/netdevice.h> | 23 | #include <linux/netdevice.h> |
| 23 | #include <linux/netfilter.h> | 24 | #include <linux/netfilter.h> |
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c index 0a12cedfe9e3..665f5beef6ad 100644 --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/vmalloc.h> | 22 | #include <linux/vmalloc.h> |
| 23 | #include <linux/mutex.h> | 23 | #include <linux/mutex.h> |
| 24 | #include <linux/mm.h> | 24 | #include <linux/mm.h> |
| 25 | #include <linux/slab.h> | ||
| 25 | #include <net/net_namespace.h> | 26 | #include <net/net_namespace.h> |
| 26 | 27 | ||
| 27 | #include <linux/netfilter/x_tables.h> | 28 | #include <linux/netfilter/x_tables.h> |
diff --git a/net/netfilter/xt_CT.c b/net/netfilter/xt_CT.c index 61c50fa84703..ee18b231b950 100644 --- a/net/netfilter/xt_CT.c +++ b/net/netfilter/xt_CT.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 10 | #include <linux/gfp.h> | ||
| 10 | #include <linux/skbuff.h> | 11 | #include <linux/skbuff.h> |
| 11 | #include <linux/selinux.h> | 12 | #include <linux/selinux.h> |
| 12 | #include <linux/netfilter_ipv4/ip_tables.h> | 13 | #include <linux/netfilter_ipv4/ip_tables.h> |
diff --git a/net/netfilter/xt_LED.c b/net/netfilter/xt_LED.c index 8ff7843bb921..3271c8e52153 100644 --- a/net/netfilter/xt_LED.c +++ b/net/netfilter/xt_LED.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
| 23 | #include <linux/skbuff.h> | 23 | #include <linux/skbuff.h> |
| 24 | #include <linux/netfilter/x_tables.h> | 24 | #include <linux/netfilter/x_tables.h> |
| 25 | #include <linux/slab.h> | ||
| 25 | #include <linux/leds.h> | 26 | #include <linux/leds.h> |
| 26 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
| 27 | 28 | ||
diff --git a/net/netfilter/xt_RATEEST.c b/net/netfilter/xt_RATEEST.c index 87ae97e5516f..d16d55df4f61 100644 --- a/net/netfilter/xt_RATEEST.c +++ b/net/netfilter/xt_RATEEST.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/jhash.h> | 11 | #include <linux/jhash.h> |
| 12 | #include <linux/rtnetlink.h> | 12 | #include <linux/rtnetlink.h> |
| 13 | #include <linux/random.h> | 13 | #include <linux/random.h> |
| 14 | #include <linux/slab.h> | ||
| 14 | #include <net/gen_stats.h> | 15 | #include <net/gen_stats.h> |
| 15 | #include <net/netlink.h> | 16 | #include <net/netlink.h> |
| 16 | 17 | ||
diff --git a/net/netfilter/xt_TCPMSS.c b/net/netfilter/xt_TCPMSS.c index 0e357ac9a2a8..c5f4b9919e9a 100644 --- a/net/netfilter/xt_TCPMSS.c +++ b/net/netfilter/xt_TCPMSS.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
| 12 | #include <linux/skbuff.h> | 12 | #include <linux/skbuff.h> |
| 13 | #include <linux/ip.h> | 13 | #include <linux/ip.h> |
| 14 | #include <linux/gfp.h> | ||
| 14 | #include <linux/ipv6.h> | 15 | #include <linux/ipv6.h> |
| 15 | #include <linux/tcp.h> | 16 | #include <linux/tcp.h> |
| 16 | #include <net/dst.h> | 17 | #include <net/dst.h> |
diff --git a/net/netfilter/xt_connlimit.c b/net/netfilter/xt_connlimit.c index 26997ce90e48..388ca4596098 100644 --- a/net/netfilter/xt_connlimit.c +++ b/net/netfilter/xt_connlimit.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/ip.h> | 17 | #include <linux/ip.h> |
| 18 | #include <linux/ipv6.h> | 18 | #include <linux/ipv6.h> |
| 19 | #include <linux/jhash.h> | 19 | #include <linux/jhash.h> |
| 20 | #include <linux/slab.h> | ||
| 20 | #include <linux/list.h> | 21 | #include <linux/list.h> |
| 21 | #include <linux/module.h> | 22 | #include <linux/module.h> |
| 22 | #include <linux/random.h> | 23 | #include <linux/random.h> |
diff --git a/net/netfilter/xt_dccp.c b/net/netfilter/xt_dccp.c index 0989f29ade2e..395af5943ffd 100644 --- a/net/netfilter/xt_dccp.c +++ b/net/netfilter/xt_dccp.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
| 12 | #include <linux/skbuff.h> | 12 | #include <linux/skbuff.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <linux/spinlock.h> | 14 | #include <linux/spinlock.h> |
| 14 | #include <net/ip.h> | 15 | #include <net/ip.h> |
| 15 | #include <linux/dccp.h> | 16 | #include <linux/dccp.h> |
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index d952806b6469..215a64835de8 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * xt_hashlimit - Netfilter module to limit the number of packets per time | 2 | * xt_hashlimit - Netfilter module to limit the number of packets per time |
| 3 | * seperately for each hashbucket (sourceip/sourceport/dstip/dstport) | 3 | * separately for each hashbucket (sourceip/sourceport/dstip/dstport) |
| 4 | * | 4 | * |
| 5 | * (C) 2003-2004 by Harald Welte <laforge@netfilter.org> | 5 | * (C) 2003-2004 by Harald Welte <laforge@netfilter.org> |
| 6 | * Copyright © CC Computer Consultants GmbH, 2007 - 2008 | 6 | * Copyright © CC Computer Consultants GmbH, 2007 - 2008 |
| @@ -493,6 +493,7 @@ static void hashlimit_ipv6_mask(__be32 *i, unsigned int p) | |||
| 493 | case 64 ... 95: | 493 | case 64 ... 95: |
| 494 | i[2] = maskl(i[2], p - 64); | 494 | i[2] = maskl(i[2], p - 64); |
| 495 | i[3] = 0; | 495 | i[3] = 0; |
| 496 | break; | ||
| 496 | case 96 ... 127: | 497 | case 96 ... 127: |
| 497 | i[3] = maskl(i[3], p - 96); | 498 | i[3] = maskl(i[3], p - 96); |
| 498 | break; | 499 | break; |
| @@ -879,7 +880,8 @@ static void dl_seq_stop(struct seq_file *s, void *v) | |||
| 879 | struct xt_hashlimit_htable *htable = s->private; | 880 | struct xt_hashlimit_htable *htable = s->private; |
| 880 | unsigned int *bucket = (unsigned int *)v; | 881 | unsigned int *bucket = (unsigned int *)v; |
| 881 | 882 | ||
| 882 | kfree(bucket); | 883 | if (!IS_ERR(bucket)) |
| 884 | kfree(bucket); | ||
| 883 | spin_unlock_bh(&htable->lock); | 885 | spin_unlock_bh(&htable->lock); |
| 884 | } | 886 | } |
| 885 | 887 | ||
diff --git a/net/netfilter/xt_limit.c b/net/netfilter/xt_limit.c index a0ca5339af41..e5d7e1ffb1a4 100644 --- a/net/netfilter/xt_limit.c +++ b/net/netfilter/xt_limit.c | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <linux/slab.h> | ||
| 9 | #include <linux/module.h> | 10 | #include <linux/module.h> |
| 10 | #include <linux/skbuff.h> | 11 | #include <linux/skbuff.h> |
| 11 | #include <linux/spinlock.h> | 12 | #include <linux/spinlock.h> |
diff --git a/net/netfilter/xt_quota.c b/net/netfilter/xt_quota.c index 390b7d09fe51..2d5562498c43 100644 --- a/net/netfilter/xt_quota.c +++ b/net/netfilter/xt_quota.c | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | * Sam Johnston <samj@samj.net> | 4 | * Sam Johnston <samj@samj.net> |
| 5 | */ | 5 | */ |
| 6 | #include <linux/skbuff.h> | 6 | #include <linux/skbuff.h> |
| 7 | #include <linux/slab.h> | ||
| 7 | #include <linux/spinlock.h> | 8 | #include <linux/spinlock.h> |
| 8 | 9 | ||
| 9 | #include <linux/netfilter/x_tables.h> | 10 | #include <linux/netfilter/x_tables.h> |
diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c index 7073dbb8100c..834b736857cb 100644 --- a/net/netfilter/xt_recent.c +++ b/net/netfilter/xt_recent.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <linux/bitops.h> | 27 | #include <linux/bitops.h> |
| 28 | #include <linux/skbuff.h> | 28 | #include <linux/skbuff.h> |
| 29 | #include <linux/inet.h> | 29 | #include <linux/inet.h> |
| 30 | #include <linux/slab.h> | ||
| 30 | #include <net/net_namespace.h> | 31 | #include <net/net_namespace.h> |
| 31 | #include <net/netns/generic.h> | 32 | #include <net/netns/generic.h> |
| 32 | 33 | ||
| @@ -267,7 +268,7 @@ recent_mt(const struct sk_buff *skb, const struct xt_match_param *par) | |||
| 267 | for (i = 0; i < e->nstamps; i++) { | 268 | for (i = 0; i < e->nstamps; i++) { |
| 268 | if (info->seconds && time_after(time, e->stamps[i])) | 269 | if (info->seconds && time_after(time, e->stamps[i])) |
| 269 | continue; | 270 | continue; |
| 270 | if (info->hit_count && ++hits >= info->hit_count) { | 271 | if (!info->hit_count || ++hits >= info->hit_count) { |
| 271 | ret = !ret; | 272 | ret = !ret; |
| 272 | break; | 273 | break; |
| 273 | } | 274 | } |
diff --git a/net/netfilter/xt_statistic.c b/net/netfilter/xt_statistic.c index d8c0f8f1a78e..937ce0633e99 100644 --- a/net/netfilter/xt_statistic.c +++ b/net/netfilter/xt_statistic.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/spinlock.h> | 12 | #include <linux/spinlock.h> |
| 13 | #include <linux/skbuff.h> | 13 | #include <linux/skbuff.h> |
| 14 | #include <linux/net.h> | 14 | #include <linux/net.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | 16 | ||
| 16 | #include <linux/netfilter/xt_statistic.h> | 17 | #include <linux/netfilter/xt_statistic.h> |
| 17 | #include <linux/netfilter/x_tables.h> | 18 | #include <linux/netfilter/x_tables.h> |
diff --git a/net/netfilter/xt_string.c b/net/netfilter/xt_string.c index b4d774111311..96801ffd8af8 100644 --- a/net/netfilter/xt_string.c +++ b/net/netfilter/xt_string.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | #include <linux/gfp.h> | ||
| 10 | #include <linux/init.h> | 11 | #include <linux/init.h> |
| 11 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| 12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c index e639298bc9c8..5f14c8462e30 100644 --- a/net/netlabel/netlabel_cipso_v4.c +++ b/net/netlabel/netlabel_cipso_v4.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <linux/string.h> | 33 | #include <linux/string.h> |
| 34 | #include <linux/skbuff.h> | 34 | #include <linux/skbuff.h> |
| 35 | #include <linux/audit.h> | 35 | #include <linux/audit.h> |
| 36 | #include <linux/slab.h> | ||
| 36 | #include <net/sock.h> | 37 | #include <net/sock.h> |
| 37 | #include <net/netlink.h> | 38 | #include <net/netlink.h> |
| 38 | #include <net/genetlink.h> | 39 | #include <net/genetlink.h> |
diff --git a/net/netlabel/netlabel_domainhash.c b/net/netlabel/netlabel_domainhash.c index 0bfeaab88ef5..d37b7f80fa37 100644 --- a/net/netlabel/netlabel_domainhash.c +++ b/net/netlabel/netlabel_domainhash.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #include <linux/spinlock.h> | 35 | #include <linux/spinlock.h> |
| 36 | #include <linux/string.h> | 36 | #include <linux/string.h> |
| 37 | #include <linux/audit.h> | 37 | #include <linux/audit.h> |
| 38 | #include <linux/slab.h> | ||
| 38 | #include <net/netlabel.h> | 39 | #include <net/netlabel.h> |
| 39 | #include <net/cipso_ipv4.h> | 40 | #include <net/cipso_ipv4.h> |
| 40 | #include <asm/bug.h> | 41 | #include <asm/bug.h> |
| @@ -50,9 +51,12 @@ struct netlbl_domhsh_tbl { | |||
| 50 | }; | 51 | }; |
| 51 | 52 | ||
| 52 | /* Domain hash table */ | 53 | /* Domain hash table */ |
| 53 | /* XXX - updates should be so rare that having one spinlock for the entire | 54 | /* updates should be so rare that having one spinlock for the entire hash table |
| 54 | * hash table should be okay */ | 55 | * should be okay */ |
| 55 | static DEFINE_SPINLOCK(netlbl_domhsh_lock); | 56 | static DEFINE_SPINLOCK(netlbl_domhsh_lock); |
| 57 | #define netlbl_domhsh_rcu_deref(p) \ | ||
| 58 | rcu_dereference_check(p, rcu_read_lock_held() || \ | ||
| 59 | lockdep_is_held(&netlbl_domhsh_lock)) | ||
| 56 | static struct netlbl_domhsh_tbl *netlbl_domhsh = NULL; | 60 | static struct netlbl_domhsh_tbl *netlbl_domhsh = NULL; |
| 57 | static struct netlbl_dom_map *netlbl_domhsh_def = NULL; | 61 | static struct netlbl_dom_map *netlbl_domhsh_def = NULL; |
| 58 | 62 | ||
| @@ -106,7 +110,8 @@ static void netlbl_domhsh_free_entry(struct rcu_head *entry) | |||
| 106 | * Description: | 110 | * Description: |
| 107 | * This is the hashing function for the domain hash table, it returns the | 111 | * This is the hashing function for the domain hash table, it returns the |
| 108 | * correct bucket number for the domain. The caller is responsibile for | 112 | * correct bucket number for the domain. The caller is responsibile for |
| 109 | * calling the rcu_read_[un]lock() functions. | 113 | * ensuring that the hash table is protected with either a RCU read lock or the |
| 114 | * hash table lock. | ||
| 110 | * | 115 | * |
| 111 | */ | 116 | */ |
| 112 | static u32 netlbl_domhsh_hash(const char *key) | 117 | static u32 netlbl_domhsh_hash(const char *key) |
| @@ -120,7 +125,7 @@ static u32 netlbl_domhsh_hash(const char *key) | |||
| 120 | 125 | ||
| 121 | for (iter = 0, val = 0, len = strlen(key); iter < len; iter++) | 126 | for (iter = 0, val = 0, len = strlen(key); iter < len; iter++) |
| 122 | val = (val << 4 | (val >> (8 * sizeof(u32) - 4))) ^ key[iter]; | 127 | val = (val << 4 | (val >> (8 * sizeof(u32) - 4))) ^ key[iter]; |
| 123 | return val & (rcu_dereference(netlbl_domhsh)->size - 1); | 128 | return val & (netlbl_domhsh_rcu_deref(netlbl_domhsh)->size - 1); |
| 124 | } | 129 | } |
| 125 | 130 | ||
| 126 | /** | 131 | /** |
| @@ -130,7 +135,8 @@ static u32 netlbl_domhsh_hash(const char *key) | |||
| 130 | * Description: | 135 | * Description: |
| 131 | * Searches the domain hash table and returns a pointer to the hash table | 136 | * Searches the domain hash table and returns a pointer to the hash table |
| 132 | * entry if found, otherwise NULL is returned. The caller is responsibile for | 137 | * entry if found, otherwise NULL is returned. The caller is responsibile for |
| 133 | * the rcu hash table locks (i.e. the caller much call rcu_read_[un]lock()). | 138 | * ensuring that the hash table is protected with either a RCU read lock or the |
| 139 | * hash table lock. | ||
| 134 | * | 140 | * |
| 135 | */ | 141 | */ |
| 136 | static struct netlbl_dom_map *netlbl_domhsh_search(const char *domain) | 142 | static struct netlbl_dom_map *netlbl_domhsh_search(const char *domain) |
| @@ -141,7 +147,7 @@ static struct netlbl_dom_map *netlbl_domhsh_search(const char *domain) | |||
| 141 | 147 | ||
| 142 | if (domain != NULL) { | 148 | if (domain != NULL) { |
| 143 | bkt = netlbl_domhsh_hash(domain); | 149 | bkt = netlbl_domhsh_hash(domain); |
| 144 | bkt_list = &rcu_dereference(netlbl_domhsh)->tbl[bkt]; | 150 | bkt_list = &netlbl_domhsh_rcu_deref(netlbl_domhsh)->tbl[bkt]; |
| 145 | list_for_each_entry_rcu(iter, bkt_list, list) | 151 | list_for_each_entry_rcu(iter, bkt_list, list) |
| 146 | if (iter->valid && strcmp(iter->domain, domain) == 0) | 152 | if (iter->valid && strcmp(iter->domain, domain) == 0) |
| 147 | return iter; | 153 | return iter; |
| @@ -159,8 +165,8 @@ static struct netlbl_dom_map *netlbl_domhsh_search(const char *domain) | |||
| 159 | * Searches the domain hash table and returns a pointer to the hash table | 165 | * Searches the domain hash table and returns a pointer to the hash table |
| 160 | * entry if an exact match is found, if an exact match is not present in the | 166 | * entry if an exact match is found, if an exact match is not present in the |
| 161 | * hash table then the default entry is returned if valid otherwise NULL is | 167 | * hash table then the default entry is returned if valid otherwise NULL is |
| 162 | * returned. The caller is responsibile for the rcu hash table locks | 168 | * returned. The caller is responsibile ensuring that the hash table is |
| 163 | * (i.e. the caller much call rcu_read_[un]lock()). | 169 | * protected with either a RCU read lock or the hash table lock. |
| 164 | * | 170 | * |
| 165 | */ | 171 | */ |
| 166 | static struct netlbl_dom_map *netlbl_domhsh_search_def(const char *domain) | 172 | static struct netlbl_dom_map *netlbl_domhsh_search_def(const char *domain) |
| @@ -169,7 +175,7 @@ static struct netlbl_dom_map *netlbl_domhsh_search_def(const char *domain) | |||
| 169 | 175 | ||
| 170 | entry = netlbl_domhsh_search(domain); | 176 | entry = netlbl_domhsh_search(domain); |
| 171 | if (entry == NULL) { | 177 | if (entry == NULL) { |
| 172 | entry = rcu_dereference(netlbl_domhsh_def); | 178 | entry = netlbl_domhsh_rcu_deref(netlbl_domhsh_def); |
| 173 | if (entry != NULL && !entry->valid) | 179 | if (entry != NULL && !entry->valid) |
| 174 | entry = NULL; | 180 | entry = NULL; |
| 175 | } | 181 | } |
| @@ -306,8 +312,11 @@ int netlbl_domhsh_add(struct netlbl_dom_map *entry, | |||
| 306 | struct netlbl_af6list *tmp6; | 312 | struct netlbl_af6list *tmp6; |
| 307 | #endif /* IPv6 */ | 313 | #endif /* IPv6 */ |
| 308 | 314 | ||
| 315 | /* XXX - we can remove this RCU read lock as the spinlock protects the | ||
| 316 | * entire function, but before we do we need to fixup the | ||
| 317 | * netlbl_af[4,6]list RCU functions to do "the right thing" with | ||
| 318 | * respect to rcu_dereference() when only a spinlock is held. */ | ||
| 309 | rcu_read_lock(); | 319 | rcu_read_lock(); |
| 310 | |||
| 311 | spin_lock(&netlbl_domhsh_lock); | 320 | spin_lock(&netlbl_domhsh_lock); |
| 312 | if (entry->domain != NULL) | 321 | if (entry->domain != NULL) |
| 313 | entry_old = netlbl_domhsh_search(entry->domain); | 322 | entry_old = netlbl_domhsh_search(entry->domain); |
diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c index 6ce00205f342..1b83e0009d8d 100644 --- a/net/netlabel/netlabel_kapi.c +++ b/net/netlabel/netlabel_kapi.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | 30 | ||
| 31 | #include <linux/init.h> | 31 | #include <linux/init.h> |
| 32 | #include <linux/types.h> | 32 | #include <linux/types.h> |
| 33 | #include <linux/slab.h> | ||
| 33 | #include <linux/audit.h> | 34 | #include <linux/audit.h> |
| 34 | #include <linux/in.h> | 35 | #include <linux/in.h> |
| 35 | #include <linux/in6.h> | 36 | #include <linux/in6.h> |
diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c index 8203623e65ad..998e85e895d0 100644 --- a/net/netlabel/netlabel_mgmt.c +++ b/net/netlabel/netlabel_mgmt.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <linux/skbuff.h> | 34 | #include <linux/skbuff.h> |
| 35 | #include <linux/in.h> | 35 | #include <linux/in.h> |
| 36 | #include <linux/in6.h> | 36 | #include <linux/in6.h> |
| 37 | #include <linux/slab.h> | ||
| 37 | #include <net/sock.h> | 38 | #include <net/sock.h> |
| 38 | #include <net/netlink.h> | 39 | #include <net/netlink.h> |
| 39 | #include <net/genetlink.h> | 40 | #include <net/genetlink.h> |
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index 852d9d7976b9..a3d64aabe2f7 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c | |||
| @@ -43,6 +43,7 @@ | |||
| 43 | #include <linux/notifier.h> | 43 | #include <linux/notifier.h> |
| 44 | #include <linux/netdevice.h> | 44 | #include <linux/netdevice.h> |
| 45 | #include <linux/security.h> | 45 | #include <linux/security.h> |
| 46 | #include <linux/slab.h> | ||
| 46 | #include <net/sock.h> | 47 | #include <net/sock.h> |
| 47 | #include <net/netlink.h> | 48 | #include <net/netlink.h> |
| 48 | #include <net/genetlink.h> | 49 | #include <net/genetlink.h> |
| @@ -114,6 +115,9 @@ struct netlbl_unlhsh_walk_arg { | |||
| 114 | /* updates should be so rare that having one spinlock for the entire | 115 | /* updates should be so rare that having one spinlock for the entire |
| 115 | * hash table should be okay */ | 116 | * hash table should be okay */ |
| 116 | static DEFINE_SPINLOCK(netlbl_unlhsh_lock); | 117 | static DEFINE_SPINLOCK(netlbl_unlhsh_lock); |
| 118 | #define netlbl_unlhsh_rcu_deref(p) \ | ||
| 119 | rcu_dereference_check(p, rcu_read_lock_held() || \ | ||
| 120 | lockdep_is_held(&netlbl_unlhsh_lock)) | ||
| 117 | static struct netlbl_unlhsh_tbl *netlbl_unlhsh = NULL; | 121 | static struct netlbl_unlhsh_tbl *netlbl_unlhsh = NULL; |
| 118 | static struct netlbl_unlhsh_iface *netlbl_unlhsh_def = NULL; | 122 | static struct netlbl_unlhsh_iface *netlbl_unlhsh_def = NULL; |
| 119 | 123 | ||
| @@ -235,15 +239,13 @@ static void netlbl_unlhsh_free_iface(struct rcu_head *entry) | |||
| 235 | * Description: | 239 | * Description: |
| 236 | * This is the hashing function for the unlabeled hash table, it returns the | 240 | * This is the hashing function for the unlabeled hash table, it returns the |
| 237 | * bucket number for the given device/interface. The caller is responsible for | 241 | * bucket number for the given device/interface. The caller is responsible for |
| 238 | * calling the rcu_read_[un]lock() functions. | 242 | * ensuring that the hash table is protected with either a RCU read lock or |
| 243 | * the hash table lock. | ||
| 239 | * | 244 | * |
| 240 | */ | 245 | */ |
| 241 | static u32 netlbl_unlhsh_hash(int ifindex) | 246 | static u32 netlbl_unlhsh_hash(int ifindex) |
| 242 | { | 247 | { |
| 243 | /* this is taken _almost_ directly from | 248 | return ifindex & (netlbl_unlhsh_rcu_deref(netlbl_unlhsh)->size - 1); |
| 244 | * security/selinux/netif.c:sel_netif_hasfn() as they do pretty much | ||
| 245 | * the same thing */ | ||
| 246 | return ifindex & (rcu_dereference(netlbl_unlhsh)->size - 1); | ||
| 247 | } | 249 | } |
| 248 | 250 | ||
| 249 | /** | 251 | /** |
| @@ -253,7 +255,8 @@ static u32 netlbl_unlhsh_hash(int ifindex) | |||
| 253 | * Description: | 255 | * Description: |
| 254 | * Searches the unlabeled connection hash table and returns a pointer to the | 256 | * Searches the unlabeled connection hash table and returns a pointer to the |
| 255 | * interface entry which matches @ifindex, otherwise NULL is returned. The | 257 | * interface entry which matches @ifindex, otherwise NULL is returned. The |
| 256 | * caller is responsible for calling the rcu_read_[un]lock() functions. | 258 | * caller is responsible for ensuring that the hash table is protected with |
| 259 | * either a RCU read lock or the hash table lock. | ||
| 257 | * | 260 | * |
| 258 | */ | 261 | */ |
| 259 | static struct netlbl_unlhsh_iface *netlbl_unlhsh_search_iface(int ifindex) | 262 | static struct netlbl_unlhsh_iface *netlbl_unlhsh_search_iface(int ifindex) |
| @@ -263,7 +266,7 @@ static struct netlbl_unlhsh_iface *netlbl_unlhsh_search_iface(int ifindex) | |||
| 263 | struct netlbl_unlhsh_iface *iter; | 266 | struct netlbl_unlhsh_iface *iter; |
| 264 | 267 | ||
| 265 | bkt = netlbl_unlhsh_hash(ifindex); | 268 | bkt = netlbl_unlhsh_hash(ifindex); |
| 266 | bkt_list = &rcu_dereference(netlbl_unlhsh)->tbl[bkt]; | 269 | bkt_list = &netlbl_unlhsh_rcu_deref(netlbl_unlhsh)->tbl[bkt]; |
| 267 | list_for_each_entry_rcu(iter, bkt_list, list) | 270 | list_for_each_entry_rcu(iter, bkt_list, list) |
| 268 | if (iter->valid && iter->ifindex == ifindex) | 271 | if (iter->valid && iter->ifindex == ifindex) |
| 269 | return iter; | 272 | return iter; |
| @@ -272,33 +275,6 @@ static struct netlbl_unlhsh_iface *netlbl_unlhsh_search_iface(int ifindex) | |||
| 272 | } | 275 | } |
| 273 | 276 | ||
| 274 | /** | 277 | /** |
| 275 | * netlbl_unlhsh_search_iface_def - Search for a matching interface entry | ||
| 276 | * @ifindex: the network interface | ||
| 277 | * | ||
| 278 | * Description: | ||
| 279 | * Searches the unlabeled connection hash table and returns a pointer to the | ||
| 280 | * interface entry which matches @ifindex. If an exact match can not be found | ||
| 281 | * and there is a valid default entry, the default entry is returned, otherwise | ||
| 282 | * NULL is returned. The caller is responsible for calling the | ||
| 283 | * rcu_read_[un]lock() functions. | ||
| 284 | * | ||
| 285 | */ | ||
| 286 | static struct netlbl_unlhsh_iface *netlbl_unlhsh_search_iface_def(int ifindex) | ||
| 287 | { | ||
| 288 | struct netlbl_unlhsh_iface *entry; | ||
| 289 | |||
| 290 | entry = netlbl_unlhsh_search_iface(ifindex); | ||
| 291 | if (entry != NULL) | ||
| 292 | return entry; | ||
| 293 | |||
| 294 | entry = rcu_dereference(netlbl_unlhsh_def); | ||
| 295 | if (entry != NULL && entry->valid) | ||
| 296 | return entry; | ||
| 297 | |||
| 298 | return NULL; | ||
| 299 | } | ||
| 300 | |||
| 301 | /** | ||
| 302 | * netlbl_unlhsh_add_addr4 - Add a new IPv4 address entry to the hash table | 278 | * netlbl_unlhsh_add_addr4 - Add a new IPv4 address entry to the hash table |
| 303 | * @iface: the associated interface entry | 279 | * @iface: the associated interface entry |
| 304 | * @addr: IPv4 address in network byte order | 280 | * @addr: IPv4 address in network byte order |
| @@ -308,8 +284,7 @@ static struct netlbl_unlhsh_iface *netlbl_unlhsh_search_iface_def(int ifindex) | |||
| 308 | * Description: | 284 | * Description: |
| 309 | * Add a new address entry into the unlabeled connection hash table using the | 285 | * Add a new address entry into the unlabeled connection hash table using the |
| 310 | * interface entry specified by @iface. On success zero is returned, otherwise | 286 | * interface entry specified by @iface. On success zero is returned, otherwise |
| 311 | * a negative value is returned. The caller is responsible for calling the | 287 | * a negative value is returned. |
| 312 | * rcu_read_[un]lock() functions. | ||
| 313 | * | 288 | * |
| 314 | */ | 289 | */ |
| 315 | static int netlbl_unlhsh_add_addr4(struct netlbl_unlhsh_iface *iface, | 290 | static int netlbl_unlhsh_add_addr4(struct netlbl_unlhsh_iface *iface, |
| @@ -349,8 +324,7 @@ static int netlbl_unlhsh_add_addr4(struct netlbl_unlhsh_iface *iface, | |||
| 349 | * Description: | 324 | * Description: |
| 350 | * Add a new address entry into the unlabeled connection hash table using the | 325 | * Add a new address entry into the unlabeled connection hash table using the |
| 351 | * interface entry specified by @iface. On success zero is returned, otherwise | 326 | * interface entry specified by @iface. On success zero is returned, otherwise |
| 352 | * a negative value is returned. The caller is responsible for calling the | 327 | * a negative value is returned. |
| 353 | * rcu_read_[un]lock() functions. | ||
| 354 | * | 328 | * |
| 355 | */ | 329 | */ |
| 356 | static int netlbl_unlhsh_add_addr6(struct netlbl_unlhsh_iface *iface, | 330 | static int netlbl_unlhsh_add_addr6(struct netlbl_unlhsh_iface *iface, |
| @@ -391,8 +365,7 @@ static int netlbl_unlhsh_add_addr6(struct netlbl_unlhsh_iface *iface, | |||
| 391 | * Description: | 365 | * Description: |
| 392 | * Add a new, empty, interface entry into the unlabeled connection hash table. | 366 | * Add a new, empty, interface entry into the unlabeled connection hash table. |
| 393 | * On success a pointer to the new interface entry is returned, on failure NULL | 367 | * On success a pointer to the new interface entry is returned, on failure NULL |
| 394 | * is returned. The caller is responsible for calling the rcu_read_[un]lock() | 368 | * is returned. |
| 395 | * functions. | ||
| 396 | * | 369 | * |
| 397 | */ | 370 | */ |
| 398 | static struct netlbl_unlhsh_iface *netlbl_unlhsh_add_iface(int ifindex) | 371 | static struct netlbl_unlhsh_iface *netlbl_unlhsh_add_iface(int ifindex) |
| @@ -415,10 +388,10 @@ static struct netlbl_unlhsh_iface *netlbl_unlhsh_add_iface(int ifindex) | |||
| 415 | if (netlbl_unlhsh_search_iface(ifindex) != NULL) | 388 | if (netlbl_unlhsh_search_iface(ifindex) != NULL) |
| 416 | goto add_iface_failure; | 389 | goto add_iface_failure; |
| 417 | list_add_tail_rcu(&iface->list, | 390 | list_add_tail_rcu(&iface->list, |
| 418 | &rcu_dereference(netlbl_unlhsh)->tbl[bkt]); | 391 | &netlbl_unlhsh_rcu_deref(netlbl_unlhsh)->tbl[bkt]); |
| 419 | } else { | 392 | } else { |
| 420 | INIT_LIST_HEAD(&iface->list); | 393 | INIT_LIST_HEAD(&iface->list); |
| 421 | if (rcu_dereference(netlbl_unlhsh_def) != NULL) | 394 | if (netlbl_unlhsh_rcu_deref(netlbl_unlhsh_def) != NULL) |
| 422 | goto add_iface_failure; | 395 | goto add_iface_failure; |
| 423 | rcu_assign_pointer(netlbl_unlhsh_def, iface); | 396 | rcu_assign_pointer(netlbl_unlhsh_def, iface); |
| 424 | } | 397 | } |
| @@ -548,8 +521,7 @@ unlhsh_add_return: | |||
| 548 | * | 521 | * |
| 549 | * Description: | 522 | * Description: |
| 550 | * Remove an IP address entry from the unlabeled connection hash table. | 523 | * Remove an IP address entry from the unlabeled connection hash table. |
| 551 | * Returns zero on success, negative values on failure. The caller is | 524 | * Returns zero on success, negative values on failure. |
| 552 | * responsible for calling the rcu_read_[un]lock() functions. | ||
| 553 | * | 525 | * |
| 554 | */ | 526 | */ |
| 555 | static int netlbl_unlhsh_remove_addr4(struct net *net, | 527 | static int netlbl_unlhsh_remove_addr4(struct net *net, |
| @@ -611,8 +583,7 @@ static int netlbl_unlhsh_remove_addr4(struct net *net, | |||
| 611 | * | 583 | * |
| 612 | * Description: | 584 | * Description: |
| 613 | * Remove an IP address entry from the unlabeled connection hash table. | 585 | * Remove an IP address entry from the unlabeled connection hash table. |
| 614 | * Returns zero on success, negative values on failure. The caller is | 586 | * Returns zero on success, negative values on failure. |
| 615 | * responsible for calling the rcu_read_[un]lock() functions. | ||
| 616 | * | 587 | * |
| 617 | */ | 588 | */ |
| 618 | static int netlbl_unlhsh_remove_addr6(struct net *net, | 589 | static int netlbl_unlhsh_remove_addr6(struct net *net, |
| @@ -1547,8 +1518,10 @@ int netlbl_unlabel_getattr(const struct sk_buff *skb, | |||
| 1547 | struct netlbl_unlhsh_iface *iface; | 1518 | struct netlbl_unlhsh_iface *iface; |
| 1548 | 1519 | ||
| 1549 | rcu_read_lock(); | 1520 | rcu_read_lock(); |
| 1550 | iface = netlbl_unlhsh_search_iface_def(skb->skb_iif); | 1521 | iface = netlbl_unlhsh_search_iface(skb->skb_iif); |
| 1551 | if (iface == NULL) | 1522 | if (iface == NULL) |
| 1523 | iface = rcu_dereference(netlbl_unlhsh_def); | ||
| 1524 | if (iface == NULL || !iface->valid) | ||
| 1552 | goto unlabel_getattr_nolabel; | 1525 | goto unlabel_getattr_nolabel; |
| 1553 | switch (family) { | 1526 | switch (family) { |
| 1554 | case PF_INET: { | 1527 | case PF_INET: { |
diff --git a/net/netlabel/netlabel_user.c b/net/netlabel/netlabel_user.c index 68706b4e3bf8..a3fd75ac3fa5 100644 --- a/net/netlabel/netlabel_user.c +++ b/net/netlabel/netlabel_user.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #include <linux/audit.h> | 35 | #include <linux/audit.h> |
| 36 | #include <linux/tty.h> | 36 | #include <linux/tty.h> |
| 37 | #include <linux/security.h> | 37 | #include <linux/security.h> |
| 38 | #include <linux/gfp.h> | ||
| 38 | #include <net/sock.h> | 39 | #include <net/sock.h> |
| 39 | #include <net/netlink.h> | 40 | #include <net/netlink.h> |
| 40 | #include <net/genetlink.h> | 41 | #include <net/genetlink.h> |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 320d0423a240..795424396aff 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
| @@ -683,6 +683,9 @@ static int netlink_connect(struct socket *sock, struct sockaddr *addr, | |||
| 683 | struct netlink_sock *nlk = nlk_sk(sk); | 683 | struct netlink_sock *nlk = nlk_sk(sk); |
| 684 | struct sockaddr_nl *nladdr = (struct sockaddr_nl *)addr; | 684 | struct sockaddr_nl *nladdr = (struct sockaddr_nl *)addr; |
| 685 | 685 | ||
| 686 | if (alen < sizeof(addr->sa_family)) | ||
| 687 | return -EINVAL; | ||
| 688 | |||
| 686 | if (addr->sa_family == AF_UNSPEC) { | 689 | if (addr->sa_family == AF_UNSPEC) { |
| 687 | sk->sk_state = NETLINK_UNCONNECTED; | 690 | sk->sk_state = NETLINK_UNCONNECTED; |
| 688 | nlk->dst_pid = 0; | 691 | nlk->dst_pid = 0; |
| @@ -1093,6 +1096,7 @@ static inline int do_one_set_err(struct sock *sk, | |||
| 1093 | struct netlink_set_err_data *p) | 1096 | struct netlink_set_err_data *p) |
| 1094 | { | 1097 | { |
| 1095 | struct netlink_sock *nlk = nlk_sk(sk); | 1098 | struct netlink_sock *nlk = nlk_sk(sk); |
| 1099 | int ret = 0; | ||
| 1096 | 1100 | ||
| 1097 | if (sk == p->exclude_sk) | 1101 | if (sk == p->exclude_sk) |
| 1098 | goto out; | 1102 | goto out; |
| @@ -1104,10 +1108,15 @@ static inline int do_one_set_err(struct sock *sk, | |||
| 1104 | !test_bit(p->group - 1, nlk->groups)) | 1108 | !test_bit(p->group - 1, nlk->groups)) |
| 1105 | goto out; | 1109 | goto out; |
| 1106 | 1110 | ||
| 1111 | if (p->code == ENOBUFS && nlk->flags & NETLINK_RECV_NO_ENOBUFS) { | ||
| 1112 | ret = 1; | ||
| 1113 | goto out; | ||
| 1114 | } | ||
| 1115 | |||
| 1107 | sk->sk_err = p->code; | 1116 | sk->sk_err = p->code; |
| 1108 | sk->sk_error_report(sk); | 1117 | sk->sk_error_report(sk); |
| 1109 | out: | 1118 | out: |
| 1110 | return 0; | 1119 | return ret; |
| 1111 | } | 1120 | } |
| 1112 | 1121 | ||
| 1113 | /** | 1122 | /** |
| @@ -1116,12 +1125,16 @@ out: | |||
| 1116 | * @pid: the PID of a process that we want to skip (if any) | 1125 | * @pid: the PID of a process that we want to skip (if any) |
| 1117 | * @groups: the broadcast group that will notice the error | 1126 | * @groups: the broadcast group that will notice the error |
| 1118 | * @code: error code, must be negative (as usual in kernelspace) | 1127 | * @code: error code, must be negative (as usual in kernelspace) |
| 1128 | * | ||
| 1129 | * This function returns the number of broadcast listeners that have set the | ||
| 1130 | * NETLINK_RECV_NO_ENOBUFS socket option. | ||
| 1119 | */ | 1131 | */ |
| 1120 | void netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code) | 1132 | int netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code) |
| 1121 | { | 1133 | { |
| 1122 | struct netlink_set_err_data info; | 1134 | struct netlink_set_err_data info; |
| 1123 | struct hlist_node *node; | 1135 | struct hlist_node *node; |
| 1124 | struct sock *sk; | 1136 | struct sock *sk; |
| 1137 | int ret = 0; | ||
| 1125 | 1138 | ||
| 1126 | info.exclude_sk = ssk; | 1139 | info.exclude_sk = ssk; |
| 1127 | info.pid = pid; | 1140 | info.pid = pid; |
| @@ -1132,9 +1145,10 @@ void netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code) | |||
| 1132 | read_lock(&nl_table_lock); | 1145 | read_lock(&nl_table_lock); |
| 1133 | 1146 | ||
| 1134 | sk_for_each_bound(sk, node, &nl_table[ssk->sk_protocol].mc_list) | 1147 | sk_for_each_bound(sk, node, &nl_table[ssk->sk_protocol].mc_list) |
| 1135 | do_one_set_err(sk, &info); | 1148 | ret += do_one_set_err(sk, &info); |
| 1136 | 1149 | ||
| 1137 | read_unlock(&nl_table_lock); | 1150 | read_unlock(&nl_table_lock); |
| 1151 | return ret; | ||
| 1138 | } | 1152 | } |
| 1139 | EXPORT_SYMBOL(netlink_set_err); | 1153 | EXPORT_SYMBOL(netlink_set_err); |
| 1140 | 1154 | ||
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index a4b6e148c5de..06438fa2b1e5 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
| 11 | #include <linux/slab.h> | ||
| 11 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
| 12 | #include <linux/types.h> | 13 | #include <linux/types.h> |
| 13 | #include <linux/socket.h> | 14 | #include <linux/socket.h> |
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index a249127020a5..fa07f044b599 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
| 16 | #include <linux/socket.h> | 16 | #include <linux/socket.h> |
| 17 | #include <linux/in.h> | 17 | #include <linux/in.h> |
| 18 | #include <linux/slab.h> | ||
| 18 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
| 19 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
| 20 | #include <linux/timer.h> | 21 | #include <linux/timer.h> |
diff --git a/net/netrom/nr_dev.c b/net/netrom/nr_dev.c index 7aa11b01b2e2..64e6dde9749d 100644 --- a/net/netrom/nr_dev.c +++ b/net/netrom/nr_dev.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/fcntl.h> | 19 | #include <linux/fcntl.h> |
| 20 | #include <linux/in.h> | 20 | #include <linux/in.h> |
| 21 | #include <linux/if_ether.h> /* For the statistics structure. */ | 21 | #include <linux/if_ether.h> /* For the statistics structure. */ |
| 22 | #include <linux/slab.h> | ||
| 22 | 23 | ||
| 23 | #include <asm/system.h> | 24 | #include <asm/system.h> |
| 24 | #include <asm/uaccess.h> | 25 | #include <asm/uaccess.h> |
diff --git a/net/netrom/nr_in.c b/net/netrom/nr_in.c index 68176483617f..6d4ef6d65b3d 100644 --- a/net/netrom/nr_in.c +++ b/net/netrom/nr_in.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/string.h> | 16 | #include <linux/string.h> |
| 17 | #include <linux/sockios.h> | 17 | #include <linux/sockios.h> |
| 18 | #include <linux/net.h> | 18 | #include <linux/net.h> |
| 19 | #include <linux/slab.h> | ||
| 19 | #include <net/ax25.h> | 20 | #include <net/ax25.h> |
| 20 | #include <linux/inet.h> | 21 | #include <linux/inet.h> |
| 21 | #include <linux/netdevice.h> | 22 | #include <linux/netdevice.h> |
diff --git a/net/netrom/nr_loopback.c b/net/netrom/nr_loopback.c index f324d5df4186..94d4e922af53 100644 --- a/net/netrom/nr_loopback.c +++ b/net/netrom/nr_loopback.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | * Copyright Tomi Manninen OH2BNS (oh2bns@sral.fi) | 7 | * Copyright Tomi Manninen OH2BNS (oh2bns@sral.fi) |
| 8 | */ | 8 | */ |
| 9 | #include <linux/types.h> | 9 | #include <linux/types.h> |
| 10 | #include <linux/slab.h> | ||
| 10 | #include <linux/socket.h> | 11 | #include <linux/socket.h> |
| 11 | #include <linux/timer.h> | 12 | #include <linux/timer.h> |
| 12 | #include <net/ax25.h> | 13 | #include <net/ax25.h> |
diff --git a/net/netrom/nr_out.c b/net/netrom/nr_out.c index e3e6c44e1890..607fddb4fdbb 100644 --- a/net/netrom/nr_out.c +++ b/net/netrom/nr_out.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/string.h> | 16 | #include <linux/string.h> |
| 17 | #include <linux/sockios.h> | 17 | #include <linux/sockios.h> |
| 18 | #include <linux/net.h> | 18 | #include <linux/net.h> |
| 19 | #include <linux/slab.h> | ||
| 19 | #include <net/ax25.h> | 20 | #include <net/ax25.h> |
| 20 | #include <linux/inet.h> | 21 | #include <linux/inet.h> |
| 21 | #include <linux/netdevice.h> | 22 | #include <linux/netdevice.h> |
diff --git a/net/netrom/nr_route.c b/net/netrom/nr_route.c index 5cc648012f50..44059d0c8dd1 100644 --- a/net/netrom/nr_route.c +++ b/net/netrom/nr_route.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/string.h> | 17 | #include <linux/string.h> |
| 18 | #include <linux/sockios.h> | 18 | #include <linux/sockios.h> |
| 19 | #include <linux/net.h> | 19 | #include <linux/net.h> |
| 20 | #include <linux/slab.h> | ||
| 20 | #include <net/ax25.h> | 21 | #include <net/ax25.h> |
| 21 | #include <linux/inet.h> | 22 | #include <linux/inet.h> |
| 22 | #include <linux/netdevice.h> | 23 | #include <linux/netdevice.h> |
diff --git a/net/netrom/nr_subr.c b/net/netrom/nr_subr.c index 04e7d0d2fd8f..6a947ae50dbd 100644 --- a/net/netrom/nr_subr.c +++ b/net/netrom/nr_subr.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/string.h> | 15 | #include <linux/string.h> |
| 16 | #include <linux/sockios.h> | 16 | #include <linux/sockios.h> |
| 17 | #include <linux/net.h> | 17 | #include <linux/net.h> |
| 18 | #include <linux/slab.h> | ||
| 18 | #include <net/ax25.h> | 19 | #include <net/ax25.h> |
| 19 | #include <linux/inet.h> | 20 | #include <linux/inet.h> |
| 20 | #include <linux/netdevice.h> | 21 | #include <linux/netdevice.h> |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 031a5e6fb4aa..243946d4809d 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
| @@ -60,6 +60,7 @@ | |||
| 60 | #include <linux/wireless.h> | 60 | #include <linux/wireless.h> |
| 61 | #include <linux/kernel.h> | 61 | #include <linux/kernel.h> |
| 62 | #include <linux/kmod.h> | 62 | #include <linux/kmod.h> |
| 63 | #include <linux/slab.h> | ||
| 63 | #include <net/net_namespace.h> | 64 | #include <net/net_namespace.h> |
| 64 | #include <net/ip.h> | 65 | #include <net/ip.h> |
| 65 | #include <net/protocol.h> | 66 | #include <net/protocol.h> |
| @@ -1688,6 +1689,8 @@ static int packet_dev_mc(struct net_device *dev, struct packet_mclist *i, | |||
| 1688 | { | 1689 | { |
| 1689 | switch (i->type) { | 1690 | switch (i->type) { |
| 1690 | case PACKET_MR_MULTICAST: | 1691 | case PACKET_MR_MULTICAST: |
| 1692 | if (i->alen != dev->addr_len) | ||
| 1693 | return -EINVAL; | ||
| 1691 | if (what > 0) | 1694 | if (what > 0) |
| 1692 | return dev_mc_add(dev, i->addr, i->alen, 0); | 1695 | return dev_mc_add(dev, i->addr, i->alen, 0); |
| 1693 | else | 1696 | else |
| @@ -1700,6 +1703,8 @@ static int packet_dev_mc(struct net_device *dev, struct packet_mclist *i, | |||
| 1700 | return dev_set_allmulti(dev, what); | 1703 | return dev_set_allmulti(dev, what); |
| 1701 | break; | 1704 | break; |
| 1702 | case PACKET_MR_UNICAST: | 1705 | case PACKET_MR_UNICAST: |
| 1706 | if (i->alen != dev->addr_len) | ||
| 1707 | return -EINVAL; | ||
| 1703 | if (what > 0) | 1708 | if (what > 0) |
| 1704 | return dev_unicast_add(dev, i->addr); | 1709 | return dev_unicast_add(dev, i->addr); |
| 1705 | else | 1710 | else |
| @@ -1734,7 +1739,7 @@ static int packet_mc_add(struct sock *sk, struct packet_mreq_max *mreq) | |||
| 1734 | goto done; | 1739 | goto done; |
| 1735 | 1740 | ||
| 1736 | err = -EINVAL; | 1741 | err = -EINVAL; |
| 1737 | if (mreq->mr_alen != dev->addr_len) | 1742 | if (mreq->mr_alen > dev->addr_len) |
| 1738 | goto done; | 1743 | goto done; |
| 1739 | 1744 | ||
| 1740 | err = -ENOBUFS; | 1745 | err = -ENOBUFS; |
| @@ -2164,8 +2169,6 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd, | |||
| 2164 | case SIOCGIFDSTADDR: | 2169 | case SIOCGIFDSTADDR: |
| 2165 | case SIOCSIFDSTADDR: | 2170 | case SIOCSIFDSTADDR: |
| 2166 | case SIOCSIFFLAGS: | 2171 | case SIOCSIFFLAGS: |
| 2167 | if (!net_eq(sock_net(sk), &init_net)) | ||
| 2168 | return -ENOIOCTLCMD; | ||
| 2169 | return inet_dgram_ops.ioctl(sock, cmd, arg); | 2172 | return inet_dgram_ops.ioctl(sock, cmd, arg); |
| 2170 | #endif | 2173 | #endif |
| 2171 | 2174 | ||
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c index 526d0273991a..73aee7f2fcdc 100644 --- a/net/phonet/af_phonet.c +++ b/net/phonet/af_phonet.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
| 27 | #include <linux/module.h> | 27 | #include <linux/module.h> |
| 28 | #include <linux/slab.h> | ||
| 28 | #include <asm/unaligned.h> | 29 | #include <asm/unaligned.h> |
| 29 | #include <net/sock.h> | 30 | #include <net/sock.h> |
| 30 | 31 | ||
diff --git a/net/phonet/datagram.c b/net/phonet/datagram.c index 387197b579b1..1bd38db4fe1e 100644 --- a/net/phonet/datagram.c +++ b/net/phonet/datagram.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | */ | 24 | */ |
| 25 | 25 | ||
| 26 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
| 27 | #include <linux/slab.h> | ||
| 27 | #include <linux/socket.h> | 28 | #include <linux/socket.h> |
| 28 | #include <asm/ioctls.h> | 29 | #include <asm/ioctls.h> |
| 29 | #include <net/sock.h> | 30 | #include <net/sock.h> |
diff --git a/net/phonet/pep.c b/net/phonet/pep.c index 360cf377693e..e2a95762abd3 100644 --- a/net/phonet/pep.c +++ b/net/phonet/pep.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
| 26 | #include <linux/slab.h> | ||
| 26 | #include <linux/socket.h> | 27 | #include <linux/socket.h> |
| 27 | #include <net/sock.h> | 28 | #include <net/sock.h> |
| 28 | #include <net/tcp_states.h> | 29 | #include <net/tcp_states.h> |
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index c597cc53a6fb..9b4ced6e0968 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
| 27 | #include <linux/net.h> | 27 | #include <linux/net.h> |
| 28 | #include <linux/slab.h> | ||
| 28 | #include <linux/netdevice.h> | 29 | #include <linux/netdevice.h> |
| 29 | #include <linux/phonet.h> | 30 | #include <linux/phonet.h> |
| 30 | #include <linux/proc_fs.h> | 31 | #include <linux/proc_fs.h> |
| @@ -107,8 +108,7 @@ static void phonet_device_destroy(struct net_device *dev) | |||
| 107 | if (pnd) { | 108 | if (pnd) { |
| 108 | u8 addr; | 109 | u8 addr; |
| 109 | 110 | ||
| 110 | for (addr = find_first_bit(pnd->addrs, 64); addr < 64; | 111 | for_each_set_bit(addr, pnd->addrs, 64) |
| 111 | addr = find_next_bit(pnd->addrs, 64, 1+addr)) | ||
| 112 | phonet_address_notify(RTM_DELADDR, dev, addr); | 112 | phonet_address_notify(RTM_DELADDR, dev, addr); |
| 113 | kfree(pnd); | 113 | kfree(pnd); |
| 114 | } | 114 | } |
diff --git a/net/phonet/pn_netlink.c b/net/phonet/pn_netlink.c index 2e6c7eb8e76a..58b3b1f991ed 100644 --- a/net/phonet/pn_netlink.c +++ b/net/phonet/pn_netlink.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
| 27 | #include <linux/netlink.h> | 27 | #include <linux/netlink.h> |
| 28 | #include <linux/phonet.h> | 28 | #include <linux/phonet.h> |
| 29 | #include <linux/slab.h> | ||
| 29 | #include <net/sock.h> | 30 | #include <net/sock.h> |
| 30 | #include <net/phonet/pn_dev.h> | 31 | #include <net/phonet/pn_dev.h> |
| 31 | 32 | ||
| @@ -141,8 +142,7 @@ static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb) | |||
| 141 | continue; | 142 | continue; |
| 142 | 143 | ||
| 143 | addr_idx = 0; | 144 | addr_idx = 0; |
| 144 | for (addr = find_first_bit(pnd->addrs, 64); addr < 64; | 145 | for_each_set_bit(addr, pnd->addrs, 64) { |
| 145 | addr = find_next_bit(pnd->addrs, 64, 1+addr)) { | ||
| 146 | if (addr_idx++ < addr_start_idx) | 146 | if (addr_idx++ < addr_start_idx) |
| 147 | continue; | 147 | continue; |
| 148 | 148 | ||
diff --git a/net/phonet/socket.c b/net/phonet/socket.c index 69c8b826a0ce..c785bfd0744f 100644 --- a/net/phonet/socket.c +++ b/net/phonet/socket.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | * 02110-1301 USA | 23 | * 02110-1301 USA |
| 24 | */ | 24 | */ |
| 25 | 25 | ||
| 26 | #include <linux/gfp.h> | ||
| 26 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
| 27 | #include <linux/net.h> | 28 | #include <linux/net.h> |
| 28 | #include <linux/poll.h> | 29 | #include <linux/poll.h> |
diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c index 853c52be781f..f81862baf4d0 100644 --- a/net/rds/af_rds.c +++ b/net/rds/af_rds.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <linux/module.h> | 33 | #include <linux/module.h> |
| 34 | #include <linux/errno.h> | 34 | #include <linux/errno.h> |
| 35 | #include <linux/kernel.h> | 35 | #include <linux/kernel.h> |
| 36 | #include <linux/gfp.h> | ||
| 36 | #include <linux/in.h> | 37 | #include <linux/in.h> |
| 37 | #include <linux/poll.h> | 38 | #include <linux/poll.h> |
| 38 | #include <net/sock.h> | 39 | #include <net/sock.h> |
diff --git a/net/rds/cong.c b/net/rds/cong.c index 6d06cac2649c..f1da27ceb064 100644 --- a/net/rds/cong.c +++ b/net/rds/cong.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | * SOFTWARE. | 30 | * SOFTWARE. |
| 31 | * | 31 | * |
| 32 | */ | 32 | */ |
| 33 | #include <linux/slab.h> | ||
| 33 | #include <linux/types.h> | 34 | #include <linux/types.h> |
| 34 | #include <linux/rbtree.h> | 35 | #include <linux/rbtree.h> |
| 35 | 36 | ||
diff --git a/net/rds/connection.c b/net/rds/connection.c index 278f607ab603..7619b671ca28 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | */ | 32 | */ |
| 33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
| 34 | #include <linux/list.h> | 34 | #include <linux/list.h> |
| 35 | #include <linux/slab.h> | ||
| 35 | #include <net/inet_hashtables.h> | 36 | #include <net/inet_hashtables.h> |
| 36 | 37 | ||
| 37 | #include "rds.h" | 38 | #include "rds.h" |
diff --git a/net/rds/ib.c b/net/rds/ib.c index 3b8992361042..8f2d6dd7700a 100644 --- a/net/rds/ib.c +++ b/net/rds/ib.c | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | #include <linux/inetdevice.h> | 37 | #include <linux/inetdevice.h> |
| 38 | #include <linux/if_arp.h> | 38 | #include <linux/if_arp.h> |
| 39 | #include <linux/delay.h> | 39 | #include <linux/delay.h> |
| 40 | #include <linux/slab.h> | ||
| 40 | 41 | ||
| 41 | #include "rds.h" | 42 | #include "rds.h" |
| 42 | #include "ib.h" | 43 | #include "ib.h" |
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index 647cb8ffc39b..88d0856cb797 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | */ | 32 | */ |
| 33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
| 34 | #include <linux/in.h> | 34 | #include <linux/in.h> |
| 35 | #include <linux/slab.h> | ||
| 35 | #include <linux/vmalloc.h> | 36 | #include <linux/vmalloc.h> |
| 36 | 37 | ||
| 37 | #include "rds.h" | 38 | #include "rds.h" |
diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c index 4b0da865a72c..059989fdb7d7 100644 --- a/net/rds/ib_rdma.c +++ b/net/rds/ib_rdma.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | * | 31 | * |
| 32 | */ | 32 | */ |
| 33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | 35 | ||
| 35 | #include "rds.h" | 36 | #include "rds.h" |
| 36 | #include "rdma.h" | 37 | #include "rdma.h" |
diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c index 04dc0d3f3c95..c7dd11b835f0 100644 --- a/net/rds/ib_recv.c +++ b/net/rds/ib_recv.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | * | 31 | * |
| 32 | */ | 32 | */ |
| 33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | #include <linux/pci.h> | 35 | #include <linux/pci.h> |
| 35 | #include <linux/dma-mapping.h> | 36 | #include <linux/dma-mapping.h> |
| 36 | #include <rdma/rdma_cm.h> | 37 | #include <rdma/rdma_cm.h> |
diff --git a/net/rds/info.c b/net/rds/info.c index 814a91a6f4a7..c45c4173a44d 100644 --- a/net/rds/info.c +++ b/net/rds/info.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | */ | 32 | */ |
| 33 | #include <linux/percpu.h> | 33 | #include <linux/percpu.h> |
| 34 | #include <linux/seq_file.h> | 34 | #include <linux/seq_file.h> |
| 35 | #include <linux/slab.h> | ||
| 35 | #include <linux/proc_fs.h> | 36 | #include <linux/proc_fs.h> |
| 36 | 37 | ||
| 37 | #include "rds.h" | 38 | #include "rds.h" |
diff --git a/net/rds/iw.c b/net/rds/iw.c index b28fa8525b24..c8f3d3525cb9 100644 --- a/net/rds/iw.c +++ b/net/rds/iw.c | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | #include <linux/inetdevice.h> | 37 | #include <linux/inetdevice.h> |
| 38 | #include <linux/if_arp.h> | 38 | #include <linux/if_arp.h> |
| 39 | #include <linux/delay.h> | 39 | #include <linux/delay.h> |
| 40 | #include <linux/slab.h> | ||
| 40 | 41 | ||
| 41 | #include "rds.h" | 42 | #include "rds.h" |
| 42 | #include "iw.h" | 43 | #include "iw.h" |
diff --git a/net/rds/iw_cm.c b/net/rds/iw_cm.c index 394cf6b4d0aa..3e9460f935d8 100644 --- a/net/rds/iw_cm.c +++ b/net/rds/iw_cm.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | */ | 32 | */ |
| 33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
| 34 | #include <linux/in.h> | 34 | #include <linux/in.h> |
| 35 | #include <linux/slab.h> | ||
| 35 | #include <linux/vmalloc.h> | 36 | #include <linux/vmalloc.h> |
| 36 | 37 | ||
| 37 | #include "rds.h" | 38 | #include "rds.h" |
diff --git a/net/rds/iw_rdma.c b/net/rds/iw_rdma.c index 9eda11cca956..13dc1862d862 100644 --- a/net/rds/iw_rdma.c +++ b/net/rds/iw_rdma.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | * | 31 | * |
| 32 | */ | 32 | */ |
| 33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | 35 | ||
| 35 | #include "rds.h" | 36 | #include "rds.h" |
| 36 | #include "rdma.h" | 37 | #include "rdma.h" |
diff --git a/net/rds/iw_recv.c b/net/rds/iw_recv.c index 54af7d6b92da..da43ee840ca3 100644 --- a/net/rds/iw_recv.c +++ b/net/rds/iw_recv.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | * | 31 | * |
| 32 | */ | 32 | */ |
| 33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | #include <linux/pci.h> | 35 | #include <linux/pci.h> |
| 35 | #include <linux/dma-mapping.h> | 36 | #include <linux/dma-mapping.h> |
| 36 | #include <rdma/rdma_cm.h> | 37 | #include <rdma/rdma_cm.h> |
diff --git a/net/rds/loop.c b/net/rds/loop.c index 4a61997f554d..0d7a159158b8 100644 --- a/net/rds/loop.c +++ b/net/rds/loop.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | * | 31 | * |
| 32 | */ | 32 | */ |
| 33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | #include <linux/in.h> | 35 | #include <linux/in.h> |
| 35 | 36 | ||
| 36 | #include "rds.h" | 37 | #include "rds.h" |
diff --git a/net/rds/message.c b/net/rds/message.c index 73e600ffd87f..9a1d67e001ba 100644 --- a/net/rds/message.c +++ b/net/rds/message.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | * | 31 | * |
| 32 | */ | 32 | */ |
| 33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | 35 | ||
| 35 | #include "rds.h" | 36 | #include "rds.h" |
| 36 | #include "rdma.h" | 37 | #include "rdma.h" |
diff --git a/net/rds/page.c b/net/rds/page.c index 36790122dfd4..595a952d4b17 100644 --- a/net/rds/page.c +++ b/net/rds/page.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | * | 31 | * |
| 32 | */ | 32 | */ |
| 33 | #include <linux/highmem.h> | 33 | #include <linux/highmem.h> |
| 34 | #include <linux/gfp.h> | ||
| 34 | 35 | ||
| 35 | #include "rds.h" | 36 | #include "rds.h" |
| 36 | 37 | ||
diff --git a/net/rds/rdma.c b/net/rds/rdma.c index 4c64daa1f5d5..5ce9437cad67 100644 --- a/net/rds/rdma.c +++ b/net/rds/rdma.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | * | 31 | * |
| 32 | */ | 32 | */ |
| 33 | #include <linux/pagemap.h> | 33 | #include <linux/pagemap.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | #include <linux/rbtree.h> | 35 | #include <linux/rbtree.h> |
| 35 | #include <linux/dma-mapping.h> /* for DMA_*_DEVICE */ | 36 | #include <linux/dma-mapping.h> /* for DMA_*_DEVICE */ |
| 36 | 37 | ||
diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c index 9ece910ea394..7b155081b4dc 100644 --- a/net/rds/rdma_transport.c +++ b/net/rds/rdma_transport.c | |||
| @@ -134,7 +134,7 @@ static int __init rds_rdma_listen_init(void) | |||
| 134 | ret = PTR_ERR(cm_id); | 134 | ret = PTR_ERR(cm_id); |
| 135 | printk(KERN_ERR "RDS/RDMA: failed to setup listener, " | 135 | printk(KERN_ERR "RDS/RDMA: failed to setup listener, " |
| 136 | "rdma_create_id() returned %d\n", ret); | 136 | "rdma_create_id() returned %d\n", ret); |
| 137 | goto out; | 137 | return ret; |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | sin.sin_family = AF_INET, | 140 | sin.sin_family = AF_INET, |
diff --git a/net/rds/recv.c b/net/rds/recv.c index b426d67f760c..e2a2b9344f7b 100644 --- a/net/rds/recv.c +++ b/net/rds/recv.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | * | 31 | * |
| 32 | */ | 32 | */ |
| 33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | #include <net/sock.h> | 35 | #include <net/sock.h> |
| 35 | #include <linux/in.h> | 36 | #include <linux/in.h> |
| 36 | 37 | ||
diff --git a/net/rds/send.c b/net/rds/send.c index b2fccfc20769..f04b929ded92 100644 --- a/net/rds/send.c +++ b/net/rds/send.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | * | 31 | * |
| 32 | */ | 32 | */ |
| 33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
| 34 | #include <linux/gfp.h> | ||
| 34 | #include <net/sock.h> | 35 | #include <net/sock.h> |
| 35 | #include <linux/in.h> | 36 | #include <linux/in.h> |
| 36 | #include <linux/list.h> | 37 | #include <linux/list.h> |
diff --git a/net/rds/tcp.c b/net/rds/tcp.c index b5198aee45d3..babf4577ff7d 100644 --- a/net/rds/tcp.c +++ b/net/rds/tcp.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | * | 31 | * |
| 32 | */ | 32 | */ |
| 33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | #include <linux/in.h> | 35 | #include <linux/in.h> |
| 35 | #include <net/tcp.h> | 36 | #include <net/tcp.h> |
| 36 | 37 | ||
diff --git a/net/rds/tcp_listen.c b/net/rds/tcp_listen.c index 53cb1b54165d..975183fe6950 100644 --- a/net/rds/tcp_listen.c +++ b/net/rds/tcp_listen.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | * | 31 | * |
| 32 | */ | 32 | */ |
| 33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
| 34 | #include <linux/gfp.h> | ||
| 34 | #include <linux/in.h> | 35 | #include <linux/in.h> |
| 35 | #include <net/tcp.h> | 36 | #include <net/tcp.h> |
| 36 | 37 | ||
diff --git a/net/rds/tcp_recv.c b/net/rds/tcp_recv.c index c00dafffbb5a..e08ec912d8b0 100644 --- a/net/rds/tcp_recv.c +++ b/net/rds/tcp_recv.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | * | 31 | * |
| 32 | */ | 32 | */ |
| 33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | #include <net/tcp.h> | 35 | #include <net/tcp.h> |
| 35 | 36 | ||
| 36 | #include "rds.h" | 37 | #include "rds.h" |
diff --git a/net/rfkill/core.c b/net/rfkill/core.c index c218e07e5caf..a9fa86f65983 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <linux/wait.h> | 33 | #include <linux/wait.h> |
| 34 | #include <linux/poll.h> | 34 | #include <linux/poll.h> |
| 35 | #include <linux/fs.h> | 35 | #include <linux/fs.h> |
| 36 | #include <linux/slab.h> | ||
| 36 | 37 | ||
| 37 | #include "rfkill.h" | 38 | #include "rfkill.h" |
| 38 | 39 | ||
diff --git a/net/rfkill/input.c b/net/rfkill/input.c index a7295ad5f9cb..3713d7ecab96 100644 --- a/net/rfkill/input.c +++ b/net/rfkill/input.c | |||
| @@ -212,6 +212,9 @@ static void rfkill_event(struct input_handle *handle, unsigned int type, | |||
| 212 | case KEY_WIMAX: | 212 | case KEY_WIMAX: |
| 213 | rfkill_schedule_toggle(RFKILL_TYPE_WIMAX); | 213 | rfkill_schedule_toggle(RFKILL_TYPE_WIMAX); |
| 214 | break; | 214 | break; |
| 215 | case KEY_RFKILL: | ||
| 216 | rfkill_schedule_toggle(RFKILL_TYPE_ALL); | ||
| 217 | break; | ||
| 215 | } | 218 | } |
| 216 | } else if (type == EV_SW && code == SW_RFKILL_ALL) | 219 | } else if (type == EV_SW && code == SW_RFKILL_ALL) |
| 217 | rfkill_schedule_evsw_rfkillall(data); | 220 | rfkill_schedule_evsw_rfkillall(data); |
| @@ -295,6 +298,11 @@ static const struct input_device_id rfkill_ids[] = { | |||
| 295 | .keybit = { [BIT_WORD(KEY_WIMAX)] = BIT_MASK(KEY_WIMAX) }, | 298 | .keybit = { [BIT_WORD(KEY_WIMAX)] = BIT_MASK(KEY_WIMAX) }, |
| 296 | }, | 299 | }, |
| 297 | { | 300 | { |
| 301 | .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT, | ||
| 302 | .evbit = { BIT_MASK(EV_KEY) }, | ||
| 303 | .keybit = { [BIT_WORD(KEY_RFKILL)] = BIT_MASK(KEY_RFKILL) }, | ||
| 304 | }, | ||
| 305 | { | ||
| 298 | .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_SWBIT, | 306 | .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_SWBIT, |
| 299 | .evbit = { BIT(EV_SW) }, | 307 | .evbit = { BIT(EV_SW) }, |
| 300 | .swbit = { [BIT_WORD(SW_RFKILL_ALL)] = BIT_MASK(SW_RFKILL_ALL) }, | 308 | .swbit = { [BIT_WORD(SW_RFKILL_ALL)] = BIT_MASK(SW_RFKILL_ALL) }, |
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index e90b9b6c16ae..4fb711a035f4 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
| 19 | #include <linux/socket.h> | 19 | #include <linux/socket.h> |
| 20 | #include <linux/in.h> | 20 | #include <linux/in.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
| 22 | #include <linux/sched.h> | 23 | #include <linux/sched.h> |
| 23 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
diff --git a/net/rose/rose_dev.c b/net/rose/rose_dev.c index 424b893d1450..178ff4f73c85 100644 --- a/net/rose/rose_dev.c +++ b/net/rose/rose_dev.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/fcntl.h> | 19 | #include <linux/fcntl.h> |
| 20 | #include <linux/in.h> | 20 | #include <linux/in.h> |
| 21 | #include <linux/if_ether.h> | 21 | #include <linux/if_ether.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | 23 | ||
| 23 | #include <asm/system.h> | 24 | #include <asm/system.h> |
| 24 | #include <asm/io.h> | 25 | #include <asm/io.h> |
diff --git a/net/rose/rose_link.c b/net/rose/rose_link.c index 5ef5f6988a2e..a750a28e0221 100644 --- a/net/rose/rose_link.c +++ b/net/rose/rose_link.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/string.h> | 16 | #include <linux/string.h> |
| 17 | #include <linux/sockios.h> | 17 | #include <linux/sockios.h> |
| 18 | #include <linux/net.h> | 18 | #include <linux/net.h> |
| 19 | #include <linux/slab.h> | ||
| 19 | #include <net/ax25.h> | 20 | #include <net/ax25.h> |
| 20 | #include <linux/inet.h> | 21 | #include <linux/inet.h> |
| 21 | #include <linux/netdevice.h> | 22 | #include <linux/netdevice.h> |
diff --git a/net/rose/rose_loopback.c b/net/rose/rose_loopback.c index 968e8bac1b5d..ae4a9d99aec7 100644 --- a/net/rose/rose_loopback.c +++ b/net/rose/rose_loopback.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk) | 7 | * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk) |
| 8 | */ | 8 | */ |
| 9 | #include <linux/types.h> | 9 | #include <linux/types.h> |
| 10 | #include <linux/slab.h> | ||
| 10 | #include <linux/socket.h> | 11 | #include <linux/socket.h> |
| 11 | #include <linux/timer.h> | 12 | #include <linux/timer.h> |
| 12 | #include <net/ax25.h> | 13 | #include <net/ax25.h> |
diff --git a/net/rose/rose_out.c b/net/rose/rose_out.c index 69820f93414b..4ebf33afbe47 100644 --- a/net/rose/rose_out.c +++ b/net/rose/rose_out.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/string.h> | 15 | #include <linux/string.h> |
| 16 | #include <linux/sockios.h> | 16 | #include <linux/sockios.h> |
| 17 | #include <linux/net.h> | 17 | #include <linux/net.h> |
| 18 | #include <linux/gfp.h> | ||
| 18 | #include <net/ax25.h> | 19 | #include <net/ax25.h> |
| 19 | #include <linux/inet.h> | 20 | #include <linux/inet.h> |
| 20 | #include <linux/netdevice.h> | 21 | #include <linux/netdevice.h> |
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c index 70a0b3b4b4d2..cbc244a128bd 100644 --- a/net/rose/rose_route.c +++ b/net/rose/rose_route.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/string.h> | 16 | #include <linux/string.h> |
| 17 | #include <linux/sockios.h> | 17 | #include <linux/sockios.h> |
| 18 | #include <linux/net.h> | 18 | #include <linux/net.h> |
| 19 | #include <linux/slab.h> | ||
| 19 | #include <net/ax25.h> | 20 | #include <net/ax25.h> |
| 20 | #include <linux/inet.h> | 21 | #include <linux/inet.h> |
| 21 | #include <linux/netdevice.h> | 22 | #include <linux/netdevice.h> |
diff --git a/net/rose/rose_subr.c b/net/rose/rose_subr.c index b05108f382da..1734abba26a2 100644 --- a/net/rose/rose_subr.c +++ b/net/rose/rose_subr.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/string.h> | 15 | #include <linux/string.h> |
| 16 | #include <linux/sockios.h> | 16 | #include <linux/sockios.h> |
| 17 | #include <linux/net.h> | 17 | #include <linux/net.h> |
| 18 | #include <linux/slab.h> | ||
| 18 | #include <net/ax25.h> | 19 | #include <net/ax25.h> |
| 19 | #include <linux/inet.h> | 20 | #include <linux/inet.h> |
| 20 | #include <linux/netdevice.h> | 21 | #include <linux/netdevice.h> |
diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c index 287b1415cee9..c060095b27ce 100644 --- a/net/rxrpc/af_rxrpc.c +++ b/net/rxrpc/af_rxrpc.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| 13 | #include <linux/net.h> | 13 | #include <linux/net.h> |
| 14 | #include <linux/slab.h> | ||
| 14 | #include <linux/skbuff.h> | 15 | #include <linux/skbuff.h> |
| 15 | #include <linux/poll.h> | 16 | #include <linux/poll.h> |
| 16 | #include <linux/proc_fs.h> | 17 | #include <linux/proc_fs.h> |
diff --git a/net/rxrpc/ar-accept.c b/net/rxrpc/ar-accept.c index 77228f28fa36..6d79310fcaae 100644 --- a/net/rxrpc/ar-accept.c +++ b/net/rxrpc/ar-accept.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/in.h> | 17 | #include <linux/in.h> |
| 18 | #include <linux/in6.h> | 18 | #include <linux/in6.h> |
| 19 | #include <linux/icmp.h> | 19 | #include <linux/icmp.h> |
| 20 | #include <linux/gfp.h> | ||
| 20 | #include <net/sock.h> | 21 | #include <net/sock.h> |
| 21 | #include <net/af_rxrpc.h> | 22 | #include <net/af_rxrpc.h> |
| 22 | #include <net/ip.h> | 23 | #include <net/ip.h> |
| @@ -88,6 +89,11 @@ static int rxrpc_accept_incoming_call(struct rxrpc_local *local, | |||
| 88 | 89 | ||
| 89 | /* get a notification message to send to the server app */ | 90 | /* get a notification message to send to the server app */ |
| 90 | notification = alloc_skb(0, GFP_NOFS); | 91 | notification = alloc_skb(0, GFP_NOFS); |
| 92 | if (!notification) { | ||
| 93 | _debug("no memory"); | ||
| 94 | ret = -ENOMEM; | ||
| 95 | goto error_nofree; | ||
| 96 | } | ||
| 91 | rxrpc_new_skb(notification); | 97 | rxrpc_new_skb(notification); |
| 92 | notification->mark = RXRPC_SKB_MARK_NEW_CALL; | 98 | notification->mark = RXRPC_SKB_MARK_NEW_CALL; |
| 93 | 99 | ||
| @@ -189,6 +195,7 @@ invalid_service: | |||
| 189 | ret = -ECONNREFUSED; | 195 | ret = -ECONNREFUSED; |
| 190 | error: | 196 | error: |
| 191 | rxrpc_free_skb(notification); | 197 | rxrpc_free_skb(notification); |
| 198 | error_nofree: | ||
| 192 | _leave(" = %d", ret); | 199 | _leave(" = %d", ret); |
| 193 | return ret; | 200 | return ret; |
| 194 | } | 201 | } |
diff --git a/net/rxrpc/ar-ack.c b/net/rxrpc/ar-ack.c index b4a220977031..2714da167fb8 100644 --- a/net/rxrpc/ar-ack.c +++ b/net/rxrpc/ar-ack.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/circ_buf.h> | 13 | #include <linux/circ_buf.h> |
| 14 | #include <linux/net.h> | 14 | #include <linux/net.h> |
| 15 | #include <linux/skbuff.h> | 15 | #include <linux/skbuff.h> |
| 16 | #include <linux/slab.h> | ||
| 16 | #include <linux/udp.h> | 17 | #include <linux/udp.h> |
| 17 | #include <net/sock.h> | 18 | #include <net/sock.h> |
| 18 | #include <net/af_rxrpc.h> | 19 | #include <net/af_rxrpc.h> |
diff --git a/net/rxrpc/ar-call.c b/net/rxrpc/ar-call.c index bc0019f704fe..909d092de9f4 100644 --- a/net/rxrpc/ar-call.c +++ b/net/rxrpc/ar-call.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | * 2 of the License, or (at your option) any later version. | 9 | * 2 of the License, or (at your option) any later version. |
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/slab.h> | ||
| 12 | #include <linux/module.h> | 13 | #include <linux/module.h> |
| 13 | #include <linux/circ_buf.h> | 14 | #include <linux/circ_buf.h> |
| 14 | #include <net/sock.h> | 15 | #include <net/sock.h> |
diff --git a/net/rxrpc/ar-connection.c b/net/rxrpc/ar-connection.c index 9f1ce841a0bb..4106ca95ec86 100644 --- a/net/rxrpc/ar-connection.c +++ b/net/rxrpc/ar-connection.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <linux/net.h> | 14 | #include <linux/net.h> |
| 14 | #include <linux/skbuff.h> | 15 | #include <linux/skbuff.h> |
| 15 | #include <linux/crypto.h> | 16 | #include <linux/crypto.h> |
diff --git a/net/rxrpc/ar-input.c b/net/rxrpc/ar-input.c index f98c8027e5c1..89315009bab1 100644 --- a/net/rxrpc/ar-input.c +++ b/net/rxrpc/ar-input.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/in.h> | 17 | #include <linux/in.h> |
| 18 | #include <linux/in6.h> | 18 | #include <linux/in6.h> |
| 19 | #include <linux/icmp.h> | 19 | #include <linux/icmp.h> |
| 20 | #include <linux/gfp.h> | ||
| 20 | #include <net/sock.h> | 21 | #include <net/sock.h> |
| 21 | #include <net/af_rxrpc.h> | 22 | #include <net/af_rxrpc.h> |
| 22 | #include <net/ip.h> | 23 | #include <net/ip.h> |
diff --git a/net/rxrpc/ar-key.c b/net/rxrpc/ar-key.c index 74697b200496..5ee16f0353fe 100644 --- a/net/rxrpc/ar-key.c +++ b/net/rxrpc/ar-key.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/key-type.h> | 18 | #include <linux/key-type.h> |
| 19 | #include <linux/crypto.h> | 19 | #include <linux/crypto.h> |
| 20 | #include <linux/ctype.h> | 20 | #include <linux/ctype.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | #include <net/sock.h> | 22 | #include <net/sock.h> |
| 22 | #include <net/af_rxrpc.h> | 23 | #include <net/af_rxrpc.h> |
| 23 | #include <keys/rxrpc-type.h> | 24 | #include <keys/rxrpc-type.h> |
diff --git a/net/rxrpc/ar-local.c b/net/rxrpc/ar-local.c index 807535ff29b5..87f7135d238b 100644 --- a/net/rxrpc/ar-local.c +++ b/net/rxrpc/ar-local.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| 13 | #include <linux/net.h> | 13 | #include <linux/net.h> |
| 14 | #include <linux/skbuff.h> | 14 | #include <linux/skbuff.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | #include <net/sock.h> | 16 | #include <net/sock.h> |
| 16 | #include <net/af_rxrpc.h> | 17 | #include <net/af_rxrpc.h> |
| 17 | #include "ar-internal.h" | 18 | #include "ar-internal.h" |
diff --git a/net/rxrpc/ar-output.c b/net/rxrpc/ar-output.c index cc9102c5b588..5f22e263eda7 100644 --- a/net/rxrpc/ar-output.c +++ b/net/rxrpc/ar-output.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/net.h> | 12 | #include <linux/net.h> |
| 13 | #include <linux/gfp.h> | ||
| 13 | #include <linux/skbuff.h> | 14 | #include <linux/skbuff.h> |
| 14 | #include <linux/circ_buf.h> | 15 | #include <linux/circ_buf.h> |
| 15 | #include <net/sock.h> | 16 | #include <net/sock.h> |
diff --git a/net/rxrpc/ar-peer.c b/net/rxrpc/ar-peer.c index edc026c1eb76..f0f85b0123f7 100644 --- a/net/rxrpc/ar-peer.c +++ b/net/rxrpc/ar-peer.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/in.h> | 16 | #include <linux/in.h> |
| 17 | #include <linux/in6.h> | 17 | #include <linux/in6.h> |
| 18 | #include <linux/icmp.h> | 18 | #include <linux/icmp.h> |
| 19 | #include <linux/slab.h> | ||
| 19 | #include <net/sock.h> | 20 | #include <net/sock.h> |
| 20 | #include <net/af_rxrpc.h> | 21 | #include <net/af_rxrpc.h> |
| 21 | #include <net/ip.h> | 22 | #include <net/ip.h> |
diff --git a/net/rxrpc/ar-transport.c b/net/rxrpc/ar-transport.c index 0936e1acc30e..5e0226fe587e 100644 --- a/net/rxrpc/ar-transport.c +++ b/net/rxrpc/ar-transport.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| 13 | #include <linux/net.h> | 13 | #include <linux/net.h> |
| 14 | #include <linux/skbuff.h> | 14 | #include <linux/skbuff.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | #include <net/sock.h> | 16 | #include <net/sock.h> |
| 16 | #include <net/af_rxrpc.h> | 17 | #include <net/af_rxrpc.h> |
| 17 | #include "ar-internal.h" | 18 | #include "ar-internal.h" |
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c index 713ac593e2e9..7635107726ce 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/crypto.h> | 16 | #include <linux/crypto.h> |
| 17 | #include <linux/scatterlist.h> | 17 | #include <linux/scatterlist.h> |
| 18 | #include <linux/ctype.h> | 18 | #include <linux/ctype.h> |
| 19 | #include <linux/slab.h> | ||
| 19 | #include <net/sock.h> | 20 | #include <net/sock.h> |
| 20 | #include <net/af_rxrpc.h> | 21 | #include <net/af_rxrpc.h> |
| 21 | #include <keys/rxrpc-type.h> | 22 | #include <keys/rxrpc-type.h> |
diff --git a/net/sched/Kconfig b/net/sched/Kconfig index 21f9c7678aa3..2f691fb180d1 100644 --- a/net/sched/Kconfig +++ b/net/sched/Kconfig | |||
| @@ -328,13 +328,16 @@ config NET_CLS_FLOW | |||
| 328 | module will be called cls_flow. | 328 | module will be called cls_flow. |
| 329 | 329 | ||
| 330 | config NET_CLS_CGROUP | 330 | config NET_CLS_CGROUP |
| 331 | bool "Control Group Classifier" | 331 | tristate "Control Group Classifier" |
| 332 | select NET_CLS | 332 | select NET_CLS |
| 333 | depends on CGROUPS | 333 | depends on CGROUPS |
| 334 | ---help--- | 334 | ---help--- |
| 335 | Say Y here if you want to classify packets based on the control | 335 | Say Y here if you want to classify packets based on the control |
| 336 | cgroup of their process. | 336 | cgroup of their process. |
| 337 | 337 | ||
| 338 | To compile this code as a module, choose M here: the | ||
| 339 | module will be called cls_cgroup. | ||
| 340 | |||
| 338 | config NET_EMATCH | 341 | config NET_EMATCH |
| 339 | bool "Extended Matches" | 342 | bool "Extended Matches" |
| 340 | select NET_CLS | 343 | select NET_CLS |
diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 64f5e328cee9..d8e0171d9a4b 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
| 16 | #include <linux/string.h> | 16 | #include <linux/string.h> |
| 17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
| 18 | #include <linux/slab.h> | ||
| 18 | #include <linux/skbuff.h> | 19 | #include <linux/skbuff.h> |
| 19 | #include <linux/init.h> | 20 | #include <linux/init.h> |
| 20 | #include <linux/kmod.h> | 21 | #include <linux/kmod.h> |
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c index 082c520b0def..da27a170b6b7 100644 --- a/net/sched/act_ipt.c +++ b/net/sched/act_ipt.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/rtnetlink.h> | 19 | #include <linux/rtnetlink.h> |
| 20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
| 21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | #include <net/netlink.h> | 23 | #include <net/netlink.h> |
| 23 | #include <net/pkt_sched.h> | 24 | #include <net/pkt_sched.h> |
| 24 | #include <linux/tc_act/tc_ipt.h> | 25 | #include <linux/tc_act/tc_ipt.h> |
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index d329170243cb..c046682054eb 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/rtnetlink.h> | 20 | #include <linux/rtnetlink.h> |
| 21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
| 22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
| 23 | #include <linux/gfp.h> | ||
| 23 | #include <net/net_namespace.h> | 24 | #include <net/net_namespace.h> |
| 24 | #include <net/netlink.h> | 25 | #include <net/netlink.h> |
| 25 | #include <net/pkt_sched.h> | 26 | #include <net/pkt_sched.h> |
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index 6b0359a500e6..b7dcfedc802e 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/rtnetlink.h> | 17 | #include <linux/rtnetlink.h> |
| 18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
| 19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
| 20 | #include <linux/slab.h> | ||
| 20 | #include <net/netlink.h> | 21 | #include <net/netlink.h> |
| 21 | #include <net/pkt_sched.h> | 22 | #include <net/pkt_sched.h> |
| 22 | #include <linux/tc_act/tc_pedit.h> | 23 | #include <linux/tc_act/tc_pedit.h> |
diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 723964c3ee4f..654f73dff7c1 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/skbuff.h> | 18 | #include <linux/skbuff.h> |
| 19 | #include <linux/rtnetlink.h> | 19 | #include <linux/rtnetlink.h> |
| 20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | #include <net/act_api.h> | 22 | #include <net/act_api.h> |
| 22 | #include <net/netlink.h> | 23 | #include <net/netlink.h> |
| 23 | 24 | ||
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c index 8daa1ebc7413..622ca809c15c 100644 --- a/net/sched/act_simple.c +++ b/net/sched/act_simple.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | */ | 11 | */ |
| 12 | 12 | ||
| 13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
| 14 | #include <linux/slab.h> | ||
| 14 | #include <linux/init.h> | 15 | #include <linux/init.h> |
| 15 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
| 16 | #include <linux/skbuff.h> | 17 | #include <linux/skbuff.h> |
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 3725d8fa29db..f082b27ff46d 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/kmod.h> | 24 | #include <linux/kmod.h> |
| 25 | #include <linux/netlink.h> | 25 | #include <linux/netlink.h> |
| 26 | #include <linux/err.h> | 26 | #include <linux/err.h> |
| 27 | #include <linux/slab.h> | ||
| 27 | #include <net/net_namespace.h> | 28 | #include <net/net_namespace.h> |
| 28 | #include <net/sock.h> | 29 | #include <net/sock.h> |
| 29 | #include <net/netlink.h> | 30 | #include <net/netlink.h> |
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c index 4e2bda854119..efd4f95fd050 100644 --- a/net/sched/cls_basic.c +++ b/net/sched/cls_basic.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <linux/types.h> | 14 | #include <linux/types.h> |
| 14 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
| 15 | #include <linux/string.h> | 16 | #include <linux/string.h> |
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c index e4877ca6727c..221180384fd7 100644 --- a/net/sched/cls_cgroup.c +++ b/net/sched/cls_cgroup.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <linux/types.h> | 14 | #include <linux/types.h> |
| 14 | #include <linux/string.h> | 15 | #include <linux/string.h> |
| 15 | #include <linux/errno.h> | 16 | #include <linux/errno.h> |
| @@ -24,6 +25,25 @@ struct cgroup_cls_state | |||
| 24 | u32 classid; | 25 | u32 classid; |
| 25 | }; | 26 | }; |
| 26 | 27 | ||
| 28 | static struct cgroup_subsys_state *cgrp_create(struct cgroup_subsys *ss, | ||
| 29 | struct cgroup *cgrp); | ||
| 30 | static void cgrp_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp); | ||
| 31 | static int cgrp_populate(struct cgroup_subsys *ss, struct cgroup *cgrp); | ||
| 32 | |||
| 33 | struct cgroup_subsys net_cls_subsys = { | ||
| 34 | .name = "net_cls", | ||
| 35 | .create = cgrp_create, | ||
| 36 | .destroy = cgrp_destroy, | ||
| 37 | .populate = cgrp_populate, | ||
| 38 | #ifdef CONFIG_NET_CLS_CGROUP | ||
| 39 | .subsys_id = net_cls_subsys_id, | ||
| 40 | #else | ||
| 41 | #define net_cls_subsys_id net_cls_subsys.subsys_id | ||
| 42 | #endif | ||
| 43 | .module = THIS_MODULE, | ||
| 44 | }; | ||
| 45 | |||
| 46 | |||
| 27 | static inline struct cgroup_cls_state *cgrp_cls_state(struct cgroup *cgrp) | 47 | static inline struct cgroup_cls_state *cgrp_cls_state(struct cgroup *cgrp) |
| 28 | { | 48 | { |
| 29 | return container_of(cgroup_subsys_state(cgrp, net_cls_subsys_id), | 49 | return container_of(cgroup_subsys_state(cgrp, net_cls_subsys_id), |
| @@ -79,14 +99,6 @@ static int cgrp_populate(struct cgroup_subsys *ss, struct cgroup *cgrp) | |||
| 79 | return cgroup_add_files(cgrp, ss, ss_files, ARRAY_SIZE(ss_files)); | 99 | return cgroup_add_files(cgrp, ss, ss_files, ARRAY_SIZE(ss_files)); |
| 80 | } | 100 | } |
| 81 | 101 | ||
| 82 | struct cgroup_subsys net_cls_subsys = { | ||
| 83 | .name = "net_cls", | ||
| 84 | .create = cgrp_create, | ||
| 85 | .destroy = cgrp_destroy, | ||
| 86 | .populate = cgrp_populate, | ||
| 87 | .subsys_id = net_cls_subsys_id, | ||
| 88 | }; | ||
| 89 | |||
| 90 | struct cls_cgroup_head | 102 | struct cls_cgroup_head |
| 91 | { | 103 | { |
| 92 | u32 handle; | 104 | u32 handle; |
| @@ -277,12 +289,19 @@ static struct tcf_proto_ops cls_cgroup_ops __read_mostly = { | |||
| 277 | 289 | ||
| 278 | static int __init init_cgroup_cls(void) | 290 | static int __init init_cgroup_cls(void) |
| 279 | { | 291 | { |
| 280 | return register_tcf_proto_ops(&cls_cgroup_ops); | 292 | int ret = register_tcf_proto_ops(&cls_cgroup_ops); |
| 293 | if (ret) | ||
| 294 | return ret; | ||
| 295 | ret = cgroup_load_subsys(&net_cls_subsys); | ||
| 296 | if (ret) | ||
| 297 | unregister_tcf_proto_ops(&cls_cgroup_ops); | ||
| 298 | return ret; | ||
| 281 | } | 299 | } |
| 282 | 300 | ||
| 283 | static void __exit exit_cgroup_cls(void) | 301 | static void __exit exit_cgroup_cls(void) |
| 284 | { | 302 | { |
| 285 | unregister_tcf_proto_ops(&cls_cgroup_ops); | 303 | unregister_tcf_proto_ops(&cls_cgroup_ops); |
| 304 | cgroup_unload_subsys(&net_cls_subsys); | ||
| 286 | } | 305 | } |
| 287 | 306 | ||
| 288 | module_init(init_cgroup_cls); | 307 | module_init(init_cgroup_cls); |
diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c index e054c62857e1..6ed61b10e002 100644 --- a/net/sched/cls_flow.c +++ b/net/sched/cls_flow.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/ip.h> | 20 | #include <linux/ip.h> |
| 21 | #include <linux/ipv6.h> | 21 | #include <linux/ipv6.h> |
| 22 | #include <linux/if_vlan.h> | 22 | #include <linux/if_vlan.h> |
| 23 | #include <linux/slab.h> | ||
| 23 | 24 | ||
| 24 | #include <net/pkt_cls.h> | 25 | #include <net/pkt_cls.h> |
| 25 | #include <net/ip.h> | 26 | #include <net/ip.h> |
diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c index 6d6e87585fb1..93b0a7b6f9b4 100644 --- a/net/sched/cls_fw.c +++ b/net/sched/cls_fw.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | */ | 19 | */ |
| 20 | 20 | ||
| 21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | #include <linux/types.h> | 23 | #include <linux/types.h> |
| 23 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
| 24 | #include <linux/string.h> | 25 | #include <linux/string.h> |
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c index dd872d5383ef..694dcd85dec8 100644 --- a/net/sched/cls_route.c +++ b/net/sched/cls_route.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <linux/types.h> | 14 | #include <linux/types.h> |
| 14 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
| 15 | #include <linux/string.h> | 16 | #include <linux/string.h> |
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c index e806f2314b5e..20ef330bb918 100644 --- a/net/sched/cls_tcindex.c +++ b/net/sched/cls_tcindex.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
| 10 | #include <linux/skbuff.h> | 10 | #include <linux/skbuff.h> |
| 11 | #include <linux/errno.h> | 11 | #include <linux/errno.h> |
| 12 | #include <linux/slab.h> | ||
| 12 | #include <net/act_api.h> | 13 | #include <net/act_api.h> |
| 13 | #include <net/netlink.h> | 14 | #include <net/netlink.h> |
| 14 | #include <net/pkt_cls.h> | 15 | #include <net/pkt_cls.h> |
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 07372f60bee3..17c5dfc67320 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | */ | 31 | */ |
| 32 | 32 | ||
| 33 | #include <linux/module.h> | 33 | #include <linux/module.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | #include <linux/types.h> | 35 | #include <linux/types.h> |
| 35 | #include <linux/kernel.h> | 36 | #include <linux/kernel.h> |
| 36 | #include <linux/string.h> | 37 | #include <linux/string.h> |
diff --git a/net/sched/em_meta.c b/net/sched/em_meta.c index 24dce8b648a4..3bcac8aa333c 100644 --- a/net/sched/em_meta.c +++ b/net/sched/em_meta.c | |||
| @@ -58,6 +58,7 @@ | |||
| 58 | * only available if that subsystem is enabled in the kernel. | 58 | * only available if that subsystem is enabled in the kernel. |
| 59 | */ | 59 | */ |
| 60 | 60 | ||
| 61 | #include <linux/slab.h> | ||
| 61 | #include <linux/module.h> | 62 | #include <linux/module.h> |
| 62 | #include <linux/types.h> | 63 | #include <linux/types.h> |
| 63 | #include <linux/kernel.h> | 64 | #include <linux/kernel.h> |
diff --git a/net/sched/em_nbyte.c b/net/sched/em_nbyte.c index 370a1b2ea317..1a4176aee6e5 100644 --- a/net/sched/em_nbyte.c +++ b/net/sched/em_nbyte.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | * Authors: Thomas Graf <tgraf@suug.ch> | 9 | * Authors: Thomas Graf <tgraf@suug.ch> |
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/gfp.h> | ||
| 12 | #include <linux/module.h> | 13 | #include <linux/module.h> |
| 13 | #include <linux/types.h> | 14 | #include <linux/types.h> |
| 14 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
diff --git a/net/sched/em_text.c b/net/sched/em_text.c index 853c5ead87fd..763253257411 100644 --- a/net/sched/em_text.c +++ b/net/sched/em_text.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | * Authors: Thomas Graf <tgraf@suug.ch> | 9 | * Authors: Thomas Graf <tgraf@suug.ch> |
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/slab.h> | ||
| 12 | #include <linux/module.h> | 13 | #include <linux/module.h> |
| 13 | #include <linux/types.h> | 14 | #include <linux/types.h> |
| 14 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
diff --git a/net/sched/ematch.c b/net/sched/ematch.c index aab59409728b..e782bdeedc58 100644 --- a/net/sched/ematch.c +++ b/net/sched/ematch.c | |||
| @@ -82,6 +82,7 @@ | |||
| 82 | */ | 82 | */ |
| 83 | 83 | ||
| 84 | #include <linux/module.h> | 84 | #include <linux/module.h> |
| 85 | #include <linux/slab.h> | ||
| 85 | #include <linux/types.h> | 86 | #include <linux/types.h> |
| 86 | #include <linux/kernel.h> | 87 | #include <linux/kernel.h> |
| 87 | #include <linux/errno.h> | 88 | #include <linux/errno.h> |
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 6cd491013b50..145268ca57cf 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/list.h> | 28 | #include <linux/list.h> |
| 29 | #include <linux/hrtimer.h> | 29 | #include <linux/hrtimer.h> |
| 30 | #include <linux/lockdep.h> | 30 | #include <linux/lockdep.h> |
| 31 | #include <linux/slab.h> | ||
| 31 | 32 | ||
| 32 | #include <net/net_namespace.h> | 33 | #include <net/net_namespace.h> |
| 33 | #include <net/sock.h> | 34 | #include <net/sock.h> |
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c index ab82f145f689..fcbb86a486a2 100644 --- a/net/sched/sch_atm.c +++ b/net/sched/sch_atm.c | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | /* Written 1998-2000 by Werner Almesberger, EPFL ICA */ | 3 | /* Written 1998-2000 by Werner Almesberger, EPFL ICA */ |
| 4 | 4 | ||
| 5 | #include <linux/module.h> | 5 | #include <linux/module.h> |
| 6 | #include <linux/slab.h> | ||
| 6 | #include <linux/init.h> | 7 | #include <linux/init.h> |
| 7 | #include <linux/string.h> | 8 | #include <linux/string.h> |
| 8 | #include <linux/errno.h> | 9 | #include <linux/errno.h> |
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index 3846d65bc03e..28c01ef5abc8 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | */ | 11 | */ |
| 12 | 12 | ||
| 13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
| 14 | #include <linux/slab.h> | ||
| 14 | #include <linux/types.h> | 15 | #include <linux/types.h> |
| 15 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
| 16 | #include <linux/string.h> | 17 | #include <linux/string.h> |
diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c index a65604f8f2b8..b74046a95397 100644 --- a/net/sched/sch_drr.c +++ b/net/sched/sch_drr.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
| 12 | #include <linux/slab.h> | ||
| 12 | #include <linux/init.h> | 13 | #include <linux/init.h> |
| 13 | #include <linux/errno.h> | 14 | #include <linux/errno.h> |
| 14 | #include <linux/netdevice.h> | 15 | #include <linux/netdevice.h> |
diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c index d303daa45d49..63d41f86679c 100644 --- a/net/sched/sch_dsmark.c +++ b/net/sched/sch_dsmark.c | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | #include <linux/module.h> | 6 | #include <linux/module.h> |
| 7 | #include <linux/init.h> | 7 | #include <linux/init.h> |
| 8 | #include <linux/slab.h> | ||
| 8 | #include <linux/types.h> | 9 | #include <linux/types.h> |
| 9 | #include <linux/string.h> | 10 | #include <linux/string.h> |
| 10 | #include <linux/errno.h> | 11 | #include <linux/errno.h> |
diff --git a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c index 4b0a6cc44c77..5948bafa8ce2 100644 --- a/net/sched/sch_fifo.c +++ b/net/sched/sch_fifo.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <linux/types.h> | 14 | #include <linux/types.h> |
| 14 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
| 15 | #include <linux/errno.h> | 16 | #include <linux/errno.h> |
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 5173c1e1b19c..ff4dd53eeff0 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
| 25 | #include <linux/rcupdate.h> | 25 | #include <linux/rcupdate.h> |
| 26 | #include <linux/list.h> | 26 | #include <linux/list.h> |
| 27 | #include <linux/slab.h> | ||
| 27 | #include <net/pkt_sched.h> | 28 | #include <net/pkt_sched.h> |
| 28 | 29 | ||
| 29 | /* Main transmission queue. */ | 30 | /* Main transmission queue. */ |
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c index 40408d595c08..51dcc2aa5c92 100644 --- a/net/sched/sch_gred.c +++ b/net/sched/sch_gred.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | * For all the glorious comments look at include/net/red.h | 18 | * For all the glorious comments look at include/net/red.h |
| 19 | */ | 19 | */ |
| 20 | 20 | ||
| 21 | #include <linux/slab.h> | ||
| 21 | #include <linux/module.h> | 22 | #include <linux/module.h> |
| 22 | #include <linux/types.h> | 23 | #include <linux/types.h> |
| 23 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 508cf5f3a6d5..0b52b8de562c 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/compiler.h> | 36 | #include <linux/compiler.h> |
| 37 | #include <linux/rbtree.h> | 37 | #include <linux/rbtree.h> |
| 38 | #include <linux/workqueue.h> | 38 | #include <linux/workqueue.h> |
| 39 | #include <linux/slab.h> | ||
| 39 | #include <net/netlink.h> | 40 | #include <net/netlink.h> |
| 40 | #include <net/pkt_sched.h> | 41 | #include <net/pkt_sched.h> |
| 41 | 42 | ||
diff --git a/net/sched/sch_mq.c b/net/sched/sch_mq.c index d1dea3d5dc92..b2aba3f5e6fa 100644 --- a/net/sched/sch_mq.c +++ b/net/sched/sch_mq.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 12 | #include <linux/slab.h> | ||
| 12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
| 13 | #include <linux/string.h> | 14 | #include <linux/string.h> |
| 14 | #include <linux/errno.h> | 15 | #include <linux/errno.h> |
diff --git a/net/sched/sch_multiq.c b/net/sched/sch_multiq.c index 7db2c88ce585..c50876cd8704 100644 --- a/net/sched/sch_multiq.c +++ b/net/sched/sch_multiq.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | */ | 18 | */ |
| 19 | 19 | ||
| 20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | #include <linux/types.h> | 22 | #include <linux/types.h> |
| 22 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
| 23 | #include <linux/string.h> | 24 | #include <linux/string.h> |
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index d8b10e054627..4714ff162bbd 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | #include <linux/types.h> | 18 | #include <linux/types.h> |
| 18 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
| 19 | #include <linux/errno.h> | 20 | #include <linux/errno.h> |
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index 93285cecb246..81672e0c1b25 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | */ | 12 | */ |
| 13 | 13 | ||
| 14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | #include <linux/types.h> | 16 | #include <linux/types.h> |
| 16 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
| 17 | #include <linux/string.h> | 18 | #include <linux/string.h> |
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index cb21380c0605..c5a9ac566007 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/ipv6.h> | 20 | #include <linux/ipv6.h> |
| 21 | #include <linux/skbuff.h> | 21 | #include <linux/skbuff.h> |
| 22 | #include <linux/jhash.h> | 22 | #include <linux/jhash.h> |
| 23 | #include <linux/slab.h> | ||
| 23 | #include <net/ip.h> | 24 | #include <net/ip.h> |
| 24 | #include <net/netlink.h> | 25 | #include <net/netlink.h> |
| 25 | #include <net/pkt_sched.h> | 26 | #include <net/pkt_sched.h> |
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c index db69637069c4..3415b6ce1c0a 100644 --- a/net/sched/sch_teql.c +++ b/net/sched/sch_teql.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
| 12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
| 13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
| 14 | #include <linux/slab.h> | ||
| 14 | #include <linux/string.h> | 15 | #include <linux/string.h> |
| 15 | #include <linux/errno.h> | 16 | #include <linux/errno.h> |
| 16 | #include <linux/if_arp.h> | 17 | #include <linux/if_arp.h> |
diff --git a/net/sctp/associola.c b/net/sctp/associola.c index df5abbff63e2..99c93ee98ad9 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c | |||
| @@ -1194,8 +1194,10 @@ void sctp_assoc_update(struct sctp_association *asoc, | |||
| 1194 | /* Remove any peer addresses not present in the new association. */ | 1194 | /* Remove any peer addresses not present in the new association. */ |
| 1195 | list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { | 1195 | list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { |
| 1196 | trans = list_entry(pos, struct sctp_transport, transports); | 1196 | trans = list_entry(pos, struct sctp_transport, transports); |
| 1197 | if (!sctp_assoc_lookup_paddr(new, &trans->ipaddr)) | 1197 | if (!sctp_assoc_lookup_paddr(new, &trans->ipaddr)) { |
| 1198 | sctp_assoc_del_peer(asoc, &trans->ipaddr); | 1198 | sctp_assoc_rm_peer(asoc, trans); |
| 1199 | continue; | ||
| 1200 | } | ||
| 1199 | 1201 | ||
| 1200 | if (asoc->state >= SCTP_STATE_ESTABLISHED) | 1202 | if (asoc->state >= SCTP_STATE_ESTABLISHED) |
| 1201 | sctp_transport_reset(trans); | 1203 | sctp_transport_reset(trans); |
diff --git a/net/sctp/auth.c b/net/sctp/auth.c index 56935bbc1496..86366390038a 100644 --- a/net/sctp/auth.c +++ b/net/sctp/auth.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | * be incorporated into the next SCTP release. | 34 | * be incorporated into the next SCTP release. |
| 35 | */ | 35 | */ |
| 36 | 36 | ||
| 37 | #include <linux/slab.h> | ||
| 37 | #include <linux/types.h> | 38 | #include <linux/types.h> |
| 38 | #include <linux/crypto.h> | 39 | #include <linux/crypto.h> |
| 39 | #include <linux/scatterlist.h> | 40 | #include <linux/scatterlist.h> |
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c index bef133731683..faf71d179e46 100644 --- a/net/sctp/bind_addr.c +++ b/net/sctp/bind_addr.c | |||
| @@ -43,6 +43,7 @@ | |||
| 43 | */ | 43 | */ |
| 44 | 44 | ||
| 45 | #include <linux/types.h> | 45 | #include <linux/types.h> |
| 46 | #include <linux/slab.h> | ||
| 46 | #include <linux/in.h> | 47 | #include <linux/in.h> |
| 47 | #include <net/sock.h> | 48 | #include <net/sock.h> |
| 48 | #include <net/ipv6.h> | 49 | #include <net/ipv6.h> |
diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c index 8e4320040f05..3eab6db59a37 100644 --- a/net/sctp/chunk.c +++ b/net/sctp/chunk.c | |||
| @@ -42,6 +42,7 @@ | |||
| 42 | #include <linux/net.h> | 42 | #include <linux/net.h> |
| 43 | #include <linux/inet.h> | 43 | #include <linux/inet.h> |
| 44 | #include <linux/skbuff.h> | 44 | #include <linux/skbuff.h> |
| 45 | #include <linux/slab.h> | ||
| 45 | #include <net/sock.h> | 46 | #include <net/sock.h> |
| 46 | #include <net/sctp/sctp.h> | 47 | #include <net/sctp/sctp.h> |
| 47 | #include <net/sctp/sm.h> | 48 | #include <net/sctp/sm.h> |
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c index 905fda582b92..7ec09ba03a1c 100644 --- a/net/sctp/endpointola.c +++ b/net/sctp/endpointola.c | |||
| @@ -144,6 +144,7 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep, | |||
| 144 | /* Use SCTP specific send buffer space queues. */ | 144 | /* Use SCTP specific send buffer space queues. */ |
| 145 | ep->sndbuf_policy = sctp_sndbuf_policy; | 145 | ep->sndbuf_policy = sctp_sndbuf_policy; |
| 146 | 146 | ||
| 147 | sk->sk_data_ready = sctp_data_ready; | ||
| 147 | sk->sk_write_space = sctp_write_space; | 148 | sk->sk_write_space = sctp_write_space; |
| 148 | sock_set_flag(sk, SOCK_USE_WRITE_QUEUE); | 149 | sock_set_flag(sk, SOCK_USE_WRITE_QUEUE); |
| 149 | 150 | ||
diff --git a/net/sctp/input.c b/net/sctp/input.c index c0c973e67add..ea2192444ce6 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
| @@ -53,6 +53,7 @@ | |||
| 53 | #include <linux/socket.h> | 53 | #include <linux/socket.h> |
| 54 | #include <linux/ip.h> | 54 | #include <linux/ip.h> |
| 55 | #include <linux/time.h> /* For struct timeval */ | 55 | #include <linux/time.h> /* For struct timeval */ |
| 56 | #include <linux/slab.h> | ||
| 56 | #include <net/ip.h> | 57 | #include <net/ip.h> |
| 57 | #include <net/icmp.h> | 58 | #include <net/icmp.h> |
| 58 | #include <net/snmp.h> | 59 | #include <net/snmp.h> |
| @@ -75,7 +76,7 @@ static struct sctp_association *__sctp_lookup_association( | |||
| 75 | const union sctp_addr *peer, | 76 | const union sctp_addr *peer, |
| 76 | struct sctp_transport **pt); | 77 | struct sctp_transport **pt); |
| 77 | 78 | ||
| 78 | static void sctp_add_backlog(struct sock *sk, struct sk_buff *skb); | 79 | static int sctp_add_backlog(struct sock *sk, struct sk_buff *skb); |
| 79 | 80 | ||
| 80 | 81 | ||
| 81 | /* Calculate the SCTP checksum of an SCTP packet. */ | 82 | /* Calculate the SCTP checksum of an SCTP packet. */ |
| @@ -265,8 +266,13 @@ int sctp_rcv(struct sk_buff *skb) | |||
| 265 | } | 266 | } |
| 266 | 267 | ||
| 267 | if (sock_owned_by_user(sk)) { | 268 | if (sock_owned_by_user(sk)) { |
| 269 | if (sctp_add_backlog(sk, skb)) { | ||
| 270 | sctp_bh_unlock_sock(sk); | ||
| 271 | sctp_chunk_free(chunk); | ||
| 272 | skb = NULL; /* sctp_chunk_free already freed the skb */ | ||
| 273 | goto discard_release; | ||
| 274 | } | ||
| 268 | SCTP_INC_STATS_BH(SCTP_MIB_IN_PKT_BACKLOG); | 275 | SCTP_INC_STATS_BH(SCTP_MIB_IN_PKT_BACKLOG); |
| 269 | sctp_add_backlog(sk, skb); | ||
| 270 | } else { | 276 | } else { |
| 271 | SCTP_INC_STATS_BH(SCTP_MIB_IN_PKT_SOFTIRQ); | 277 | SCTP_INC_STATS_BH(SCTP_MIB_IN_PKT_SOFTIRQ); |
| 272 | sctp_inq_push(&chunk->rcvr->inqueue, chunk); | 278 | sctp_inq_push(&chunk->rcvr->inqueue, chunk); |
| @@ -336,8 +342,10 @@ int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb) | |||
| 336 | sctp_bh_lock_sock(sk); | 342 | sctp_bh_lock_sock(sk); |
| 337 | 343 | ||
| 338 | if (sock_owned_by_user(sk)) { | 344 | if (sock_owned_by_user(sk)) { |
| 339 | sk_add_backlog(sk, skb); | 345 | if (sk_add_backlog(sk, skb)) |
| 340 | backloged = 1; | 346 | sctp_chunk_free(chunk); |
| 347 | else | ||
| 348 | backloged = 1; | ||
| 341 | } else | 349 | } else |
| 342 | sctp_inq_push(inqueue, chunk); | 350 | sctp_inq_push(inqueue, chunk); |
| 343 | 351 | ||
| @@ -362,22 +370,27 @@ done: | |||
| 362 | return 0; | 370 | return 0; |
| 363 | } | 371 | } |
| 364 | 372 | ||
| 365 | static void sctp_add_backlog(struct sock *sk, struct sk_buff *skb) | 373 | static int sctp_add_backlog(struct sock *sk, struct sk_buff *skb) |
| 366 | { | 374 | { |
| 367 | struct sctp_chunk *chunk = SCTP_INPUT_CB(skb)->chunk; | 375 | struct sctp_chunk *chunk = SCTP_INPUT_CB(skb)->chunk; |
| 368 | struct sctp_ep_common *rcvr = chunk->rcvr; | 376 | struct sctp_ep_common *rcvr = chunk->rcvr; |
| 377 | int ret; | ||
| 369 | 378 | ||
| 370 | /* Hold the assoc/ep while hanging on the backlog queue. | 379 | ret = sk_add_backlog(sk, skb); |
| 371 | * This way, we know structures we need will not disappear from us | 380 | if (!ret) { |
| 372 | */ | 381 | /* Hold the assoc/ep while hanging on the backlog queue. |
| 373 | if (SCTP_EP_TYPE_ASSOCIATION == rcvr->type) | 382 | * This way, we know structures we need will not disappear |
| 374 | sctp_association_hold(sctp_assoc(rcvr)); | 383 | * from us |
| 375 | else if (SCTP_EP_TYPE_SOCKET == rcvr->type) | 384 | */ |
| 376 | sctp_endpoint_hold(sctp_ep(rcvr)); | 385 | if (SCTP_EP_TYPE_ASSOCIATION == rcvr->type) |
| 377 | else | 386 | sctp_association_hold(sctp_assoc(rcvr)); |
| 378 | BUG(); | 387 | else if (SCTP_EP_TYPE_SOCKET == rcvr->type) |
| 388 | sctp_endpoint_hold(sctp_ep(rcvr)); | ||
| 389 | else | ||
| 390 | BUG(); | ||
| 391 | } | ||
| 392 | return ret; | ||
| 379 | 393 | ||
| 380 | sk_add_backlog(sk, skb); | ||
| 381 | } | 394 | } |
| 382 | 395 | ||
| 383 | /* Handle icmp frag needed error. */ | 396 | /* Handle icmp frag needed error. */ |
| @@ -427,11 +440,25 @@ void sctp_icmp_proto_unreachable(struct sock *sk, | |||
| 427 | { | 440 | { |
| 428 | SCTP_DEBUG_PRINTK("%s\n", __func__); | 441 | SCTP_DEBUG_PRINTK("%s\n", __func__); |
| 429 | 442 | ||
| 430 | sctp_do_sm(SCTP_EVENT_T_OTHER, | 443 | if (sock_owned_by_user(sk)) { |
| 431 | SCTP_ST_OTHER(SCTP_EVENT_ICMP_PROTO_UNREACH), | 444 | if (timer_pending(&t->proto_unreach_timer)) |
| 432 | asoc->state, asoc->ep, asoc, t, | 445 | return; |
| 433 | GFP_ATOMIC); | 446 | else { |
| 447 | if (!mod_timer(&t->proto_unreach_timer, | ||
| 448 | jiffies + (HZ/20))) | ||
| 449 | sctp_association_hold(asoc); | ||
| 450 | } | ||
| 451 | |||
| 452 | } else { | ||
| 453 | if (timer_pending(&t->proto_unreach_timer) && | ||
| 454 | del_timer(&t->proto_unreach_timer)) | ||
| 455 | sctp_association_put(asoc); | ||
| 434 | 456 | ||
| 457 | sctp_do_sm(SCTP_EVENT_T_OTHER, | ||
| 458 | SCTP_ST_OTHER(SCTP_EVENT_ICMP_PROTO_UNREACH), | ||
| 459 | asoc->state, asoc->ep, asoc, t, | ||
| 460 | GFP_ATOMIC); | ||
| 461 | } | ||
| 435 | } | 462 | } |
| 436 | 463 | ||
| 437 | /* Common lookup code for icmp/icmpv6 error handler. */ | 464 | /* Common lookup code for icmp/icmpv6 error handler. */ |
diff --git a/net/sctp/inqueue.c b/net/sctp/inqueue.c index bbf5dd2a97c4..ccb6dc48d15b 100644 --- a/net/sctp/inqueue.c +++ b/net/sctp/inqueue.c | |||
| @@ -46,6 +46,7 @@ | |||
| 46 | #include <net/sctp/sctp.h> | 46 | #include <net/sctp/sctp.h> |
| 47 | #include <net/sctp/sm.h> | 47 | #include <net/sctp/sm.h> |
| 48 | #include <linux/interrupt.h> | 48 | #include <linux/interrupt.h> |
| 49 | #include <linux/slab.h> | ||
| 49 | 50 | ||
| 50 | /* Initialize an SCTP inqueue. */ | 51 | /* Initialize an SCTP inqueue. */ |
| 51 | void sctp_inq_init(struct sctp_inq *queue) | 52 | void sctp_inq_init(struct sctp_inq *queue) |
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index 1d7ac70ba39f..9fb5d37c37ad 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c | |||
| @@ -58,6 +58,7 @@ | |||
| 58 | #include <linux/netdevice.h> | 58 | #include <linux/netdevice.h> |
| 59 | #include <linux/init.h> | 59 | #include <linux/init.h> |
| 60 | #include <linux/ipsec.h> | 60 | #include <linux/ipsec.h> |
| 61 | #include <linux/slab.h> | ||
| 61 | 62 | ||
| 62 | #include <linux/ipv6.h> | 63 | #include <linux/ipv6.h> |
| 63 | #include <linux/icmpv6.h> | 64 | #include <linux/icmpv6.h> |
diff --git a/net/sctp/output.c b/net/sctp/output.c index 7c5589363433..fad261d41ec2 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c | |||
| @@ -48,6 +48,7 @@ | |||
| 48 | #include <linux/ip.h> | 48 | #include <linux/ip.h> |
| 49 | #include <linux/ipv6.h> | 49 | #include <linux/ipv6.h> |
| 50 | #include <linux/init.h> | 50 | #include <linux/init.h> |
| 51 | #include <linux/slab.h> | ||
| 51 | #include <net/inet_ecn.h> | 52 | #include <net/inet_ecn.h> |
| 52 | #include <net/ip.h> | 53 | #include <net/ip.h> |
| 53 | #include <net/icmp.h> | 54 | #include <net/icmp.h> |
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index 229690f02a1d..abfc0b8dee74 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c | |||
| @@ -50,6 +50,7 @@ | |||
| 50 | #include <linux/list.h> /* For struct list_head */ | 50 | #include <linux/list.h> /* For struct list_head */ |
| 51 | #include <linux/socket.h> | 51 | #include <linux/socket.h> |
| 52 | #include <linux/ip.h> | 52 | #include <linux/ip.h> |
| 53 | #include <linux/slab.h> | ||
| 53 | #include <net/sock.h> /* For skb_set_owner_w */ | 54 | #include <net/sock.h> /* For skb_set_owner_w */ |
| 54 | 55 | ||
| 55 | #include <net/sctp/sctp.h> | 56 | #include <net/sctp/sctp.h> |
diff --git a/net/sctp/primitive.c b/net/sctp/primitive.c index 8cb4f060bce6..534c7eae9d15 100644 --- a/net/sctp/primitive.c +++ b/net/sctp/primitive.c | |||
| @@ -50,6 +50,7 @@ | |||
| 50 | #include <linux/socket.h> | 50 | #include <linux/socket.h> |
| 51 | #include <linux/ip.h> | 51 | #include <linux/ip.h> |
| 52 | #include <linux/time.h> /* For struct timeval */ | 52 | #include <linux/time.h> /* For struct timeval */ |
| 53 | #include <linux/gfp.h> | ||
| 53 | #include <net/sock.h> | 54 | #include <net/sock.h> |
| 54 | #include <net/sctp/sctp.h> | 55 | #include <net/sctp/sctp.h> |
| 55 | #include <net/sctp/sm.h> | 56 | #include <net/sctp/sm.h> |
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index e771690f6d5d..a56f98e82f92 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
| @@ -54,6 +54,7 @@ | |||
| 54 | #include <linux/bootmem.h> | 54 | #include <linux/bootmem.h> |
| 55 | #include <linux/highmem.h> | 55 | #include <linux/highmem.h> |
| 56 | #include <linux/swap.h> | 56 | #include <linux/swap.h> |
| 57 | #include <linux/slab.h> | ||
| 57 | #include <net/net_namespace.h> | 58 | #include <net/net_namespace.h> |
| 58 | #include <net/protocol.h> | 59 | #include <net/protocol.h> |
| 59 | #include <net/ip.h> | 60 | #include <net/ip.h> |
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 9e732916b671..30c1767186b8 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
| @@ -58,6 +58,7 @@ | |||
| 58 | #include <linux/inet.h> | 58 | #include <linux/inet.h> |
| 59 | #include <linux/scatterlist.h> | 59 | #include <linux/scatterlist.h> |
| 60 | #include <linux/crypto.h> | 60 | #include <linux/crypto.h> |
| 61 | #include <linux/slab.h> | ||
| 61 | #include <net/sock.h> | 62 | #include <net/sock.h> |
| 62 | 63 | ||
| 63 | #include <linux/skbuff.h> | 64 | #include <linux/skbuff.h> |
| @@ -107,7 +108,7 @@ static const struct sctp_paramhdr prsctp_param = { | |||
| 107 | cpu_to_be16(sizeof(struct sctp_paramhdr)), | 108 | cpu_to_be16(sizeof(struct sctp_paramhdr)), |
| 108 | }; | 109 | }; |
| 109 | 110 | ||
| 110 | /* A helper to initialize to initialize an op error inside a | 111 | /* A helper to initialize an op error inside a |
| 111 | * provided chunk, as most cause codes will be embedded inside an | 112 | * provided chunk, as most cause codes will be embedded inside an |
| 112 | * abort chunk. | 113 | * abort chunk. |
| 113 | */ | 114 | */ |
| @@ -124,6 +125,29 @@ void sctp_init_cause(struct sctp_chunk *chunk, __be16 cause_code, | |||
| 124 | chunk->subh.err_hdr = sctp_addto_chunk(chunk, sizeof(sctp_errhdr_t), &err); | 125 | chunk->subh.err_hdr = sctp_addto_chunk(chunk, sizeof(sctp_errhdr_t), &err); |
| 125 | } | 126 | } |
| 126 | 127 | ||
| 128 | /* A helper to initialize an op error inside a | ||
| 129 | * provided chunk, as most cause codes will be embedded inside an | ||
| 130 | * abort chunk. Differs from sctp_init_cause in that it won't oops | ||
| 131 | * if there isn't enough space in the op error chunk | ||
| 132 | */ | ||
| 133 | int sctp_init_cause_fixed(struct sctp_chunk *chunk, __be16 cause_code, | ||
| 134 | size_t paylen) | ||
| 135 | { | ||
| 136 | sctp_errhdr_t err; | ||
| 137 | __u16 len; | ||
| 138 | |||
| 139 | /* Cause code constants are now defined in network order. */ | ||
| 140 | err.cause = cause_code; | ||
| 141 | len = sizeof(sctp_errhdr_t) + paylen; | ||
| 142 | err.length = htons(len); | ||
| 143 | |||
| 144 | if (skb_tailroom(chunk->skb) > len) | ||
| 145 | return -ENOSPC; | ||
| 146 | chunk->subh.err_hdr = sctp_addto_chunk_fixed(chunk, | ||
| 147 | sizeof(sctp_errhdr_t), | ||
| 148 | &err); | ||
| 149 | return 0; | ||
| 150 | } | ||
| 127 | /* 3.3.2 Initiation (INIT) (1) | 151 | /* 3.3.2 Initiation (INIT) (1) |
| 128 | * | 152 | * |
| 129 | * This chunk is used to initiate a SCTP association between two | 153 | * This chunk is used to initiate a SCTP association between two |
| @@ -207,7 +231,8 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc, | |||
| 207 | sp = sctp_sk(asoc->base.sk); | 231 | sp = sctp_sk(asoc->base.sk); |
| 208 | num_types = sp->pf->supported_addrs(sp, types); | 232 | num_types = sp->pf->supported_addrs(sp, types); |
| 209 | 233 | ||
| 210 | chunksize = sizeof(init) + addrs_len + SCTP_SAT_LEN(num_types); | 234 | chunksize = sizeof(init) + addrs_len; |
| 235 | chunksize += WORD_ROUND(SCTP_SAT_LEN(num_types)); | ||
| 211 | chunksize += sizeof(ecap_param); | 236 | chunksize += sizeof(ecap_param); |
| 212 | 237 | ||
| 213 | if (sctp_prsctp_enable) | 238 | if (sctp_prsctp_enable) |
| @@ -237,14 +262,14 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc, | |||
| 237 | /* Add HMACS parameter length if any were defined */ | 262 | /* Add HMACS parameter length if any were defined */ |
| 238 | auth_hmacs = (sctp_paramhdr_t *)asoc->c.auth_hmacs; | 263 | auth_hmacs = (sctp_paramhdr_t *)asoc->c.auth_hmacs; |
| 239 | if (auth_hmacs->length) | 264 | if (auth_hmacs->length) |
| 240 | chunksize += ntohs(auth_hmacs->length); | 265 | chunksize += WORD_ROUND(ntohs(auth_hmacs->length)); |
| 241 | else | 266 | else |
| 242 | auth_hmacs = NULL; | 267 | auth_hmacs = NULL; |
| 243 | 268 | ||
| 244 | /* Add CHUNKS parameter length */ | 269 | /* Add CHUNKS parameter length */ |
| 245 | auth_chunks = (sctp_paramhdr_t *)asoc->c.auth_chunks; | 270 | auth_chunks = (sctp_paramhdr_t *)asoc->c.auth_chunks; |
| 246 | if (auth_chunks->length) | 271 | if (auth_chunks->length) |
| 247 | chunksize += ntohs(auth_chunks->length); | 272 | chunksize += WORD_ROUND(ntohs(auth_chunks->length)); |
| 248 | else | 273 | else |
| 249 | auth_chunks = NULL; | 274 | auth_chunks = NULL; |
| 250 | 275 | ||
| @@ -254,7 +279,8 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc, | |||
| 254 | 279 | ||
| 255 | /* If we have any extensions to report, account for that */ | 280 | /* If we have any extensions to report, account for that */ |
| 256 | if (num_ext) | 281 | if (num_ext) |
| 257 | chunksize += sizeof(sctp_supported_ext_param_t) + num_ext; | 282 | chunksize += WORD_ROUND(sizeof(sctp_supported_ext_param_t) + |
| 283 | num_ext); | ||
| 258 | 284 | ||
| 259 | /* RFC 2960 3.3.2 Initiation (INIT) (1) | 285 | /* RFC 2960 3.3.2 Initiation (INIT) (1) |
| 260 | * | 286 | * |
| @@ -396,13 +422,13 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc, | |||
| 396 | 422 | ||
| 397 | auth_hmacs = (sctp_paramhdr_t *)asoc->c.auth_hmacs; | 423 | auth_hmacs = (sctp_paramhdr_t *)asoc->c.auth_hmacs; |
| 398 | if (auth_hmacs->length) | 424 | if (auth_hmacs->length) |
| 399 | chunksize += ntohs(auth_hmacs->length); | 425 | chunksize += WORD_ROUND(ntohs(auth_hmacs->length)); |
| 400 | else | 426 | else |
| 401 | auth_hmacs = NULL; | 427 | auth_hmacs = NULL; |
| 402 | 428 | ||
| 403 | auth_chunks = (sctp_paramhdr_t *)asoc->c.auth_chunks; | 429 | auth_chunks = (sctp_paramhdr_t *)asoc->c.auth_chunks; |
| 404 | if (auth_chunks->length) | 430 | if (auth_chunks->length) |
| 405 | chunksize += ntohs(auth_chunks->length); | 431 | chunksize += WORD_ROUND(ntohs(auth_chunks->length)); |
| 406 | else | 432 | else |
| 407 | auth_chunks = NULL; | 433 | auth_chunks = NULL; |
| 408 | 434 | ||
| @@ -411,7 +437,8 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc, | |||
| 411 | } | 437 | } |
| 412 | 438 | ||
| 413 | if (num_ext) | 439 | if (num_ext) |
| 414 | chunksize += sizeof(sctp_supported_ext_param_t) + num_ext; | 440 | chunksize += WORD_ROUND(sizeof(sctp_supported_ext_param_t) + |
| 441 | num_ext); | ||
| 415 | 442 | ||
| 416 | /* Now allocate and fill out the chunk. */ | 443 | /* Now allocate and fill out the chunk. */ |
| 417 | retval = sctp_make_chunk(asoc, SCTP_CID_INIT_ACK, 0, chunksize); | 444 | retval = sctp_make_chunk(asoc, SCTP_CID_INIT_ACK, 0, chunksize); |
| @@ -1128,6 +1155,24 @@ nodata: | |||
| 1128 | return retval; | 1155 | return retval; |
| 1129 | } | 1156 | } |
| 1130 | 1157 | ||
| 1158 | /* Create an Operation Error chunk of a fixed size, | ||
| 1159 | * specifically, max(asoc->pathmtu, SCTP_DEFAULT_MAXSEGMENT) | ||
| 1160 | * This is a helper function to allocate an error chunk for | ||
| 1161 | * for those invalid parameter codes in which we may not want | ||
| 1162 | * to report all the errors, if the incomming chunk is large | ||
| 1163 | */ | ||
| 1164 | static inline struct sctp_chunk *sctp_make_op_error_fixed( | ||
| 1165 | const struct sctp_association *asoc, | ||
| 1166 | const struct sctp_chunk *chunk) | ||
| 1167 | { | ||
| 1168 | size_t size = asoc ? asoc->pathmtu : 0; | ||
| 1169 | |||
| 1170 | if (!size) | ||
| 1171 | size = SCTP_DEFAULT_MAXSEGMENT; | ||
| 1172 | |||
| 1173 | return sctp_make_op_error_space(asoc, chunk, size); | ||
| 1174 | } | ||
| 1175 | |||
| 1131 | /* Create an Operation Error chunk. */ | 1176 | /* Create an Operation Error chunk. */ |
| 1132 | struct sctp_chunk *sctp_make_op_error(const struct sctp_association *asoc, | 1177 | struct sctp_chunk *sctp_make_op_error(const struct sctp_association *asoc, |
| 1133 | const struct sctp_chunk *chunk, | 1178 | const struct sctp_chunk *chunk, |
| @@ -1370,6 +1415,18 @@ void *sctp_addto_chunk(struct sctp_chunk *chunk, int len, const void *data) | |||
| 1370 | return target; | 1415 | return target; |
| 1371 | } | 1416 | } |
| 1372 | 1417 | ||
| 1418 | /* Append bytes to the end of a chunk. Returns NULL if there isn't sufficient | ||
| 1419 | * space in the chunk | ||
| 1420 | */ | ||
| 1421 | void *sctp_addto_chunk_fixed(struct sctp_chunk *chunk, | ||
| 1422 | int len, const void *data) | ||
| 1423 | { | ||
| 1424 | if (skb_tailroom(chunk->skb) > len) | ||
| 1425 | return sctp_addto_chunk(chunk, len, data); | ||
| 1426 | else | ||
| 1427 | return NULL; | ||
| 1428 | } | ||
| 1429 | |||
| 1373 | /* Append bytes from user space to the end of a chunk. Will panic if | 1430 | /* Append bytes from user space to the end of a chunk. Will panic if |
| 1374 | * chunk is not big enough. | 1431 | * chunk is not big enough. |
| 1375 | * Returns a kernel err value. | 1432 | * Returns a kernel err value. |
| @@ -1973,13 +2030,12 @@ static sctp_ierror_t sctp_process_unk_param(const struct sctp_association *asoc, | |||
| 1973 | * returning multiple unknown parameters. | 2030 | * returning multiple unknown parameters. |
| 1974 | */ | 2031 | */ |
| 1975 | if (NULL == *errp) | 2032 | if (NULL == *errp) |
| 1976 | *errp = sctp_make_op_error_space(asoc, chunk, | 2033 | *errp = sctp_make_op_error_fixed(asoc, chunk); |
| 1977 | ntohs(chunk->chunk_hdr->length)); | ||
| 1978 | 2034 | ||
| 1979 | if (*errp) { | 2035 | if (*errp) { |
| 1980 | sctp_init_cause(*errp, SCTP_ERROR_UNKNOWN_PARAM, | 2036 | sctp_init_cause_fixed(*errp, SCTP_ERROR_UNKNOWN_PARAM, |
| 1981 | WORD_ROUND(ntohs(param.p->length))); | 2037 | WORD_ROUND(ntohs(param.p->length))); |
| 1982 | sctp_addto_chunk(*errp, | 2038 | sctp_addto_chunk_fixed(*errp, |
| 1983 | WORD_ROUND(ntohs(param.p->length)), | 2039 | WORD_ROUND(ntohs(param.p->length)), |
| 1984 | param.v); | 2040 | param.v); |
| 1985 | } else { | 2041 | } else { |
| @@ -3314,21 +3370,6 @@ int sctp_process_asconf_ack(struct sctp_association *asoc, | |||
| 3314 | sctp_chunk_free(asconf); | 3370 | sctp_chunk_free(asconf); |
| 3315 | asoc->addip_last_asconf = NULL; | 3371 | asoc->addip_last_asconf = NULL; |
| 3316 | 3372 | ||
| 3317 | /* Send the next asconf chunk from the addip chunk queue. */ | ||
| 3318 | if (!list_empty(&asoc->addip_chunk_list)) { | ||
| 3319 | struct list_head *entry = asoc->addip_chunk_list.next; | ||
| 3320 | asconf = list_entry(entry, struct sctp_chunk, list); | ||
| 3321 | |||
| 3322 | list_del_init(entry); | ||
| 3323 | |||
| 3324 | /* Hold the chunk until an ASCONF_ACK is received. */ | ||
| 3325 | sctp_chunk_hold(asconf); | ||
| 3326 | if (sctp_primitive_ASCONF(asoc, asconf)) | ||
| 3327 | sctp_chunk_free(asconf); | ||
| 3328 | else | ||
| 3329 | asoc->addip_last_asconf = asconf; | ||
| 3330 | } | ||
| 3331 | |||
| 3332 | return retval; | 3373 | return retval; |
| 3333 | } | 3374 | } |
| 3334 | 3375 | ||
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 4e4ca65cd320..eb1f42f45fdd 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c | |||
| @@ -51,6 +51,7 @@ | |||
| 51 | #include <linux/types.h> | 51 | #include <linux/types.h> |
| 52 | #include <linux/socket.h> | 52 | #include <linux/socket.h> |
| 53 | #include <linux/ip.h> | 53 | #include <linux/ip.h> |
| 54 | #include <linux/gfp.h> | ||
| 54 | #include <net/sock.h> | 55 | #include <net/sock.h> |
| 55 | #include <net/sctp/sctp.h> | 56 | #include <net/sctp/sctp.h> |
| 56 | #include <net/sctp/sm.h> | 57 | #include <net/sctp/sm.h> |
| @@ -396,6 +397,41 @@ out_unlock: | |||
| 396 | sctp_transport_put(transport); | 397 | sctp_transport_put(transport); |
| 397 | } | 398 | } |
| 398 | 399 | ||
| 400 | /* Handle the timeout of the ICMP protocol unreachable timer. Trigger | ||
| 401 | * the correct state machine transition that will close the association. | ||
| 402 | */ | ||
| 403 | void sctp_generate_proto_unreach_event(unsigned long data) | ||
| 404 | { | ||
| 405 | struct sctp_transport *transport = (struct sctp_transport *) data; | ||
| 406 | struct sctp_association *asoc = transport->asoc; | ||
| 407 | |||
| 408 | sctp_bh_lock_sock(asoc->base.sk); | ||
| 409 | if (sock_owned_by_user(asoc->base.sk)) { | ||
| 410 | SCTP_DEBUG_PRINTK("%s:Sock is busy.\n", __func__); | ||
| 411 | |||
| 412 | /* Try again later. */ | ||
| 413 | if (!mod_timer(&transport->proto_unreach_timer, | ||
| 414 | jiffies + (HZ/20))) | ||
| 415 | sctp_association_hold(asoc); | ||
| 416 | goto out_unlock; | ||
| 417 | } | ||
| 418 | |||
| 419 | /* Is this structure just waiting around for us to actually | ||
| 420 | * get destroyed? | ||
| 421 | */ | ||
| 422 | if (asoc->base.dead) | ||
| 423 | goto out_unlock; | ||
| 424 | |||
| 425 | sctp_do_sm(SCTP_EVENT_T_OTHER, | ||
| 426 | SCTP_ST_OTHER(SCTP_EVENT_ICMP_PROTO_UNREACH), | ||
| 427 | asoc->state, asoc->ep, asoc, transport, GFP_ATOMIC); | ||
| 428 | |||
| 429 | out_unlock: | ||
| 430 | sctp_bh_unlock_sock(asoc->base.sk); | ||
| 431 | sctp_association_put(asoc); | ||
| 432 | } | ||
| 433 | |||
| 434 | |||
| 399 | /* Inject a SACK Timeout event into the state machine. */ | 435 | /* Inject a SACK Timeout event into the state machine. */ |
| 400 | static void sctp_generate_sack_event(unsigned long data) | 436 | static void sctp_generate_sack_event(unsigned long data) |
| 401 | { | 437 | { |
| @@ -475,7 +511,7 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc, | |||
| 475 | * used to provide an upper bound to this doubling operation. | 511 | * used to provide an upper bound to this doubling operation. |
| 476 | * | 512 | * |
| 477 | * Special Case: the first HB doesn't trigger exponential backoff. | 513 | * Special Case: the first HB doesn't trigger exponential backoff. |
| 478 | * The first unacknowleged HB triggers it. We do this with a flag | 514 | * The first unacknowledged HB triggers it. We do this with a flag |
| 479 | * that indicates that we have an outstanding HB. | 515 | * that indicates that we have an outstanding HB. |
| 480 | */ | 516 | */ |
| 481 | if (!is_hb || transport->hb_sent) { | 517 | if (!is_hb || transport->hb_sent) { |
| @@ -961,6 +997,29 @@ static int sctp_cmd_send_msg(struct sctp_association *asoc, | |||
| 961 | } | 997 | } |
| 962 | 998 | ||
| 963 | 999 | ||
| 1000 | /* Sent the next ASCONF packet currently stored in the association. | ||
| 1001 | * This happens after the ASCONF_ACK was succeffully processed. | ||
| 1002 | */ | ||
| 1003 | static void sctp_cmd_send_asconf(struct sctp_association *asoc) | ||
| 1004 | { | ||
| 1005 | /* Send the next asconf chunk from the addip chunk | ||
| 1006 | * queue. | ||
| 1007 | */ | ||
| 1008 | if (!list_empty(&asoc->addip_chunk_list)) { | ||
| 1009 | struct list_head *entry = asoc->addip_chunk_list.next; | ||
| 1010 | struct sctp_chunk *asconf = list_entry(entry, | ||
| 1011 | struct sctp_chunk, list); | ||
| 1012 | list_del_init(entry); | ||
| 1013 | |||
| 1014 | /* Hold the chunk until an ASCONF_ACK is received. */ | ||
| 1015 | sctp_chunk_hold(asconf); | ||
| 1016 | if (sctp_primitive_ASCONF(asoc, asconf)) | ||
| 1017 | sctp_chunk_free(asconf); | ||
| 1018 | else | ||
| 1019 | asoc->addip_last_asconf = asconf; | ||
| 1020 | } | ||
| 1021 | } | ||
| 1022 | |||
| 964 | 1023 | ||
| 965 | /* These three macros allow us to pull the debugging code out of the | 1024 | /* These three macros allow us to pull the debugging code out of the |
| 966 | * main flow of sctp_do_sm() to keep attention focused on the real | 1025 | * main flow of sctp_do_sm() to keep attention focused on the real |
| @@ -1616,6 +1675,9 @@ static int sctp_cmd_interpreter(sctp_event_t event_type, | |||
| 1616 | } | 1675 | } |
| 1617 | error = sctp_cmd_send_msg(asoc, cmd->obj.msg); | 1676 | error = sctp_cmd_send_msg(asoc, cmd->obj.msg); |
| 1618 | break; | 1677 | break; |
| 1678 | case SCTP_CMD_SEND_NEXT_ASCONF: | ||
| 1679 | sctp_cmd_send_asconf(asoc); | ||
| 1680 | break; | ||
| 1619 | default: | 1681 | default: |
| 1620 | printk(KERN_WARNING "Impossible command: %u, %p\n", | 1682 | printk(KERN_WARNING "Impossible command: %u, %p\n", |
| 1621 | cmd->verb, cmd->obj.ptr); | 1683 | cmd->verb, cmd->obj.ptr); |
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 47bc20d3a85b..24b2cd555637 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
| @@ -56,6 +56,7 @@ | |||
| 56 | #include <linux/ipv6.h> | 56 | #include <linux/ipv6.h> |
| 57 | #include <linux/net.h> | 57 | #include <linux/net.h> |
| 58 | #include <linux/inet.h> | 58 | #include <linux/inet.h> |
| 59 | #include <linux/slab.h> | ||
| 59 | #include <net/sock.h> | 60 | #include <net/sock.h> |
| 60 | #include <net/inet_ecn.h> | 61 | #include <net/inet_ecn.h> |
| 61 | #include <linux/skbuff.h> | 62 | #include <linux/skbuff.h> |
| @@ -3675,8 +3676,14 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep, | |||
| 3675 | SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO)); | 3676 | SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO)); |
| 3676 | 3677 | ||
| 3677 | if (!sctp_process_asconf_ack((struct sctp_association *)asoc, | 3678 | if (!sctp_process_asconf_ack((struct sctp_association *)asoc, |
| 3678 | asconf_ack)) | 3679 | asconf_ack)) { |
| 3680 | /* Successfully processed ASCONF_ACK. We can | ||
| 3681 | * release the next asconf if we have one. | ||
| 3682 | */ | ||
| 3683 | sctp_add_cmd_sf(commands, SCTP_CMD_SEND_NEXT_ASCONF, | ||
| 3684 | SCTP_NULL()); | ||
| 3679 | return SCTP_DISPOSITION_CONSUME; | 3685 | return SCTP_DISPOSITION_CONSUME; |
| 3686 | } | ||
| 3680 | 3687 | ||
| 3681 | abort = sctp_make_abort(asoc, asconf_ack, | 3688 | abort = sctp_make_abort(asoc, asconf_ack, |
| 3682 | sizeof(sctp_errhdr_t)); | 3689 | sizeof(sctp_errhdr_t)); |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index f6d1e59c4151..44a1ab03a3f0 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
| @@ -67,6 +67,7 @@ | |||
| 67 | #include <linux/poll.h> | 67 | #include <linux/poll.h> |
| 68 | #include <linux/init.h> | 68 | #include <linux/init.h> |
| 69 | #include <linux/crypto.h> | 69 | #include <linux/crypto.h> |
| 70 | #include <linux/slab.h> | ||
| 70 | 71 | ||
| 71 | #include <net/ip.h> | 72 | #include <net/ip.h> |
| 72 | #include <net/icmp.h> | 73 | #include <net/icmp.h> |
| @@ -3718,9 +3719,12 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk) | |||
| 3718 | sp->hmac = NULL; | 3719 | sp->hmac = NULL; |
| 3719 | 3720 | ||
| 3720 | SCTP_DBG_OBJCNT_INC(sock); | 3721 | SCTP_DBG_OBJCNT_INC(sock); |
| 3721 | percpu_counter_inc(&sctp_sockets_allocated); | 3722 | |
| 3723 | /* Set socket backlog limit. */ | ||
| 3724 | sk->sk_backlog.limit = sysctl_sctp_rmem[1]; | ||
| 3722 | 3725 | ||
| 3723 | local_bh_disable(); | 3726 | local_bh_disable(); |
| 3727 | percpu_counter_inc(&sctp_sockets_allocated); | ||
| 3724 | sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); | 3728 | sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); |
| 3725 | local_bh_enable(); | 3729 | local_bh_enable(); |
| 3726 | 3730 | ||
| @@ -3737,8 +3741,8 @@ SCTP_STATIC void sctp_destroy_sock(struct sock *sk) | |||
| 3737 | /* Release our hold on the endpoint. */ | 3741 | /* Release our hold on the endpoint. */ |
| 3738 | ep = sctp_sk(sk)->ep; | 3742 | ep = sctp_sk(sk)->ep; |
| 3739 | sctp_endpoint_free(ep); | 3743 | sctp_endpoint_free(ep); |
| 3740 | percpu_counter_dec(&sctp_sockets_allocated); | ||
| 3741 | local_bh_disable(); | 3744 | local_bh_disable(); |
| 3745 | percpu_counter_dec(&sctp_sockets_allocated); | ||
| 3742 | sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); | 3746 | sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); |
| 3743 | local_bh_enable(); | 3747 | local_bh_enable(); |
| 3744 | } | 3748 | } |
| @@ -6185,6 +6189,16 @@ do_nonblock: | |||
| 6185 | goto out; | 6189 | goto out; |
| 6186 | } | 6190 | } |
| 6187 | 6191 | ||
| 6192 | void sctp_data_ready(struct sock *sk, int len) | ||
| 6193 | { | ||
| 6194 | read_lock_bh(&sk->sk_callback_lock); | ||
| 6195 | if (sk_has_sleeper(sk)) | ||
| 6196 | wake_up_interruptible_sync_poll(sk->sk_sleep, POLLIN | | ||
| 6197 | POLLRDNORM | POLLRDBAND); | ||
| 6198 | sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN); | ||
| 6199 | read_unlock_bh(&sk->sk_callback_lock); | ||
| 6200 | } | ||
| 6201 | |||
| 6188 | /* If socket sndbuf has changed, wake up all per association waiters. */ | 6202 | /* If socket sndbuf has changed, wake up all per association waiters. */ |
| 6189 | void sctp_write_space(struct sock *sk) | 6203 | void sctp_write_space(struct sock *sk) |
| 6190 | { | 6204 | { |
diff --git a/net/sctp/ssnmap.c b/net/sctp/ssnmap.c index 737d330e5ffc..442ad4ed6315 100644 --- a/net/sctp/ssnmap.c +++ b/net/sctp/ssnmap.c | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | */ | 37 | */ |
| 38 | 38 | ||
| 39 | #include <linux/types.h> | 39 | #include <linux/types.h> |
| 40 | #include <linux/slab.h> | ||
| 40 | #include <net/sctp/sctp.h> | 41 | #include <net/sctp/sctp.h> |
| 41 | #include <net/sctp/sm.h> | 42 | #include <net/sctp/sm.h> |
| 42 | 43 | ||
diff --git a/net/sctp/transport.c b/net/sctp/transport.c index b827d21dbe54..165d54e07fcd 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c | |||
| @@ -48,6 +48,7 @@ | |||
| 48 | * be incorporated into the next SCTP release. | 48 | * be incorporated into the next SCTP release. |
| 49 | */ | 49 | */ |
| 50 | 50 | ||
| 51 | #include <linux/slab.h> | ||
| 51 | #include <linux/types.h> | 52 | #include <linux/types.h> |
| 52 | #include <linux/random.h> | 53 | #include <linux/random.h> |
| 53 | #include <net/sctp/sctp.h> | 54 | #include <net/sctp/sctp.h> |
| @@ -107,6 +108,8 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer, | |||
| 107 | (unsigned long)peer); | 108 | (unsigned long)peer); |
| 108 | setup_timer(&peer->hb_timer, sctp_generate_heartbeat_event, | 109 | setup_timer(&peer->hb_timer, sctp_generate_heartbeat_event, |
| 109 | (unsigned long)peer); | 110 | (unsigned long)peer); |
| 111 | setup_timer(&peer->proto_unreach_timer, | ||
| 112 | sctp_generate_proto_unreach_event, (unsigned long)peer); | ||
| 110 | 113 | ||
| 111 | /* Initialize the 64-bit random nonce sent with heartbeat. */ | 114 | /* Initialize the 64-bit random nonce sent with heartbeat. */ |
| 112 | get_random_bytes(&peer->hb_nonce, sizeof(peer->hb_nonce)); | 115 | get_random_bytes(&peer->hb_nonce, sizeof(peer->hb_nonce)); |
| @@ -170,6 +173,10 @@ void sctp_transport_free(struct sctp_transport *transport) | |||
| 170 | del_timer(&transport->T3_rtx_timer)) | 173 | del_timer(&transport->T3_rtx_timer)) |
| 171 | sctp_transport_put(transport); | 174 | sctp_transport_put(transport); |
| 172 | 175 | ||
| 176 | /* Delete the ICMP proto unreachable timer if it's active. */ | ||
| 177 | if (timer_pending(&transport->proto_unreach_timer) && | ||
| 178 | del_timer(&transport->proto_unreach_timer)) | ||
| 179 | sctp_association_put(transport->asoc); | ||
| 173 | 180 | ||
| 174 | sctp_transport_put(transport); | 181 | sctp_transport_put(transport); |
| 175 | } | 182 | } |
diff --git a/net/sctp/tsnmap.c b/net/sctp/tsnmap.c index 9bd64565021a..747d5412c463 100644 --- a/net/sctp/tsnmap.c +++ b/net/sctp/tsnmap.c | |||
| @@ -42,6 +42,7 @@ | |||
| 42 | * be incorporated into the next SCTP release. | 42 | * be incorporated into the next SCTP release. |
| 43 | */ | 43 | */ |
| 44 | 44 | ||
| 45 | #include <linux/slab.h> | ||
| 45 | #include <linux/types.h> | 46 | #include <linux/types.h> |
| 46 | #include <linux/bitmap.h> | 47 | #include <linux/bitmap.h> |
| 47 | #include <net/sctp/sctp.h> | 48 | #include <net/sctp/sctp.h> |
diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c index 8b3560fd876d..aa72e89c3ee1 100644 --- a/net/sctp/ulpevent.c +++ b/net/sctp/ulpevent.c | |||
| @@ -43,6 +43,7 @@ | |||
| 43 | * be incorporated into the next SCTP release. | 43 | * be incorporated into the next SCTP release. |
| 44 | */ | 44 | */ |
| 45 | 45 | ||
| 46 | #include <linux/slab.h> | ||
| 46 | #include <linux/types.h> | 47 | #include <linux/types.h> |
| 47 | #include <linux/skbuff.h> | 48 | #include <linux/skbuff.h> |
| 48 | #include <net/sctp/structs.h> | 49 | #include <net/sctp/structs.h> |
diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c index 7b23803343cc..3a448536f0b6 100644 --- a/net/sctp/ulpqueue.c +++ b/net/sctp/ulpqueue.c | |||
| @@ -41,6 +41,7 @@ | |||
| 41 | * be incorporated into the next SCTP release. | 41 | * be incorporated into the next SCTP release. |
| 42 | */ | 42 | */ |
| 43 | 43 | ||
| 44 | #include <linux/slab.h> | ||
| 44 | #include <linux/types.h> | 45 | #include <linux/types.h> |
| 45 | #include <linux/skbuff.h> | 46 | #include <linux/skbuff.h> |
| 46 | #include <net/sock.h> | 47 | #include <net/sock.h> |
diff --git a/net/socket.c b/net/socket.c index 769c386bd428..5e8d0af3c0e7 100644 --- a/net/socket.c +++ b/net/socket.c | |||
| @@ -87,6 +87,7 @@ | |||
| 87 | #include <linux/wireless.h> | 87 | #include <linux/wireless.h> |
| 88 | #include <linux/nsproxy.h> | 88 | #include <linux/nsproxy.h> |
| 89 | #include <linux/magic.h> | 89 | #include <linux/magic.h> |
| 90 | #include <linux/slab.h> | ||
| 90 | 91 | ||
| 91 | #include <asm/uaccess.h> | 92 | #include <asm/uaccess.h> |
| 92 | #include <asm/unistd.h> | 93 | #include <asm/unistd.h> |
| @@ -2135,6 +2136,10 @@ int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, | |||
| 2135 | break; | 2136 | break; |
| 2136 | ++datagrams; | 2137 | ++datagrams; |
| 2137 | 2138 | ||
| 2139 | /* MSG_WAITFORONE turns on MSG_DONTWAIT after one packet */ | ||
| 2140 | if (flags & MSG_WAITFORONE) | ||
| 2141 | flags |= MSG_DONTWAIT; | ||
| 2142 | |||
| 2138 | if (timeout) { | 2143 | if (timeout) { |
| 2139 | ktime_get_ts(timeout); | 2144 | ktime_get_ts(timeout); |
| 2140 | *timeout = timespec_sub(end_time, *timeout); | 2145 | *timeout = timespec_sub(end_time, *timeout); |
diff --git a/net/sunrpc/addr.c b/net/sunrpc/addr.c index f845d9d72f73..1419d0cdbbac 100644 --- a/net/sunrpc/addr.c +++ b/net/sunrpc/addr.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | #include <net/ipv6.h> | 19 | #include <net/ipv6.h> |
| 20 | #include <linux/sunrpc/clnt.h> | 20 | #include <linux/sunrpc/clnt.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | 22 | ||
| 22 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 23 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
| 23 | 24 | ||
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index f394fc190a49..95afe79dd9d7 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c | |||
| @@ -237,7 +237,7 @@ rpcauth_prune_expired(struct list_head *free, int nr_to_scan) | |||
| 237 | list_for_each_entry_safe(cred, next, &cred_unused, cr_lru) { | 237 | list_for_each_entry_safe(cred, next, &cred_unused, cr_lru) { |
| 238 | 238 | ||
| 239 | /* Enforce a 60 second garbage collection moratorium */ | 239 | /* Enforce a 60 second garbage collection moratorium */ |
| 240 | if (time_in_range_open(cred->cr_expire, expired, jiffies) && | 240 | if (time_in_range(cred->cr_expire, expired, jiffies) && |
| 241 | test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) != 0) | 241 | test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) != 0) |
| 242 | continue; | 242 | continue; |
| 243 | 243 | ||
diff --git a/net/sunrpc/auth_generic.c b/net/sunrpc/auth_generic.c index bf88bf8e9365..8f623b0f03dd 100644 --- a/net/sunrpc/auth_generic.c +++ b/net/sunrpc/auth_generic.c | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #include <linux/err.h> | 7 | #include <linux/err.h> |
| 8 | #include <linux/slab.h> | ||
| 8 | #include <linux/types.h> | 9 | #include <linux/types.h> |
| 9 | #include <linux/module.h> | 10 | #include <linux/module.h> |
| 10 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 0cfccc2a0297..c389ccf6437d 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c | |||
| @@ -1280,9 +1280,8 @@ alloc_enc_pages(struct rpc_rqst *rqstp) | |||
| 1280 | rqstp->rq_release_snd_buf = priv_release_snd_buf; | 1280 | rqstp->rq_release_snd_buf = priv_release_snd_buf; |
| 1281 | return 0; | 1281 | return 0; |
| 1282 | out_free: | 1282 | out_free: |
| 1283 | for (i--; i >= 0; i--) { | 1283 | rqstp->rq_enc_pages_num = i; |
| 1284 | __free_page(rqstp->rq_enc_pages[i]); | 1284 | priv_release_snd_buf(rqstp); |
| 1285 | } | ||
| 1286 | out: | 1285 | out: |
| 1287 | return -EAGAIN; | 1286 | return -EAGAIN; |
| 1288 | } | 1287 | } |
diff --git a/net/sunrpc/auth_gss/gss_generic_token.c b/net/sunrpc/auth_gss/gss_generic_token.c index c0ba39c4f5f2..310b78e99456 100644 --- a/net/sunrpc/auth_gss/gss_generic_token.c +++ b/net/sunrpc/auth_gss/gss_generic_token.c | |||
| @@ -33,7 +33,6 @@ | |||
| 33 | 33 | ||
| 34 | #include <linux/types.h> | 34 | #include <linux/types.h> |
| 35 | #include <linux/module.h> | 35 | #include <linux/module.h> |
| 36 | #include <linux/slab.h> | ||
| 37 | #include <linux/string.h> | 36 | #include <linux/string.h> |
| 38 | #include <linux/sunrpc/sched.h> | 37 | #include <linux/sunrpc/sched.h> |
| 39 | #include <linux/sunrpc/gss_asn1.h> | 38 | #include <linux/sunrpc/gss_asn1.h> |
diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c index c93fca204558..e9b636176687 100644 --- a/net/sunrpc/auth_gss/gss_krb5_crypto.c +++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c | |||
| @@ -37,7 +37,6 @@ | |||
| 37 | #include <linux/err.h> | 37 | #include <linux/err.h> |
| 38 | #include <linux/types.h> | 38 | #include <linux/types.h> |
| 39 | #include <linux/mm.h> | 39 | #include <linux/mm.h> |
| 40 | #include <linux/slab.h> | ||
| 41 | #include <linux/scatterlist.h> | 40 | #include <linux/scatterlist.h> |
| 42 | #include <linux/crypto.h> | 41 | #include <linux/crypto.h> |
| 43 | #include <linux/highmem.h> | 42 | #include <linux/highmem.h> |
diff --git a/net/sunrpc/auth_gss/gss_krb5_seal.c b/net/sunrpc/auth_gss/gss_krb5_seal.c index b8f42ef7178e..88fe6e75ed7e 100644 --- a/net/sunrpc/auth_gss/gss_krb5_seal.c +++ b/net/sunrpc/auth_gss/gss_krb5_seal.c | |||
| @@ -59,7 +59,6 @@ | |||
| 59 | */ | 59 | */ |
| 60 | 60 | ||
| 61 | #include <linux/types.h> | 61 | #include <linux/types.h> |
| 62 | #include <linux/slab.h> | ||
| 63 | #include <linux/jiffies.h> | 62 | #include <linux/jiffies.h> |
| 64 | #include <linux/sunrpc/gss_krb5.h> | 63 | #include <linux/sunrpc/gss_krb5.h> |
| 65 | #include <linux/random.h> | 64 | #include <linux/random.h> |
diff --git a/net/sunrpc/auth_gss/gss_krb5_seqnum.c b/net/sunrpc/auth_gss/gss_krb5_seqnum.c index 17562b4c35f6..6331cd6866ec 100644 --- a/net/sunrpc/auth_gss/gss_krb5_seqnum.c +++ b/net/sunrpc/auth_gss/gss_krb5_seqnum.c | |||
| @@ -32,7 +32,6 @@ | |||
| 32 | */ | 32 | */ |
| 33 | 33 | ||
| 34 | #include <linux/types.h> | 34 | #include <linux/types.h> |
| 35 | #include <linux/slab.h> | ||
| 36 | #include <linux/sunrpc/gss_krb5.h> | 35 | #include <linux/sunrpc/gss_krb5.h> |
| 37 | #include <linux/crypto.h> | 36 | #include <linux/crypto.h> |
| 38 | 37 | ||
diff --git a/net/sunrpc/auth_gss/gss_krb5_unseal.c b/net/sunrpc/auth_gss/gss_krb5_unseal.c index 066ec73c84d6..ce6c247edad0 100644 --- a/net/sunrpc/auth_gss/gss_krb5_unseal.c +++ b/net/sunrpc/auth_gss/gss_krb5_unseal.c | |||
| @@ -58,7 +58,6 @@ | |||
| 58 | */ | 58 | */ |
| 59 | 59 | ||
| 60 | #include <linux/types.h> | 60 | #include <linux/types.h> |
| 61 | #include <linux/slab.h> | ||
| 62 | #include <linux/jiffies.h> | 61 | #include <linux/jiffies.h> |
| 63 | #include <linux/sunrpc/gss_krb5.h> | 62 | #include <linux/sunrpc/gss_krb5.h> |
| 64 | #include <linux/crypto.h> | 63 | #include <linux/crypto.h> |
diff --git a/net/sunrpc/auth_gss/gss_krb5_wrap.c b/net/sunrpc/auth_gss/gss_krb5_wrap.c index ae8e69b59c4c..a6e905637e03 100644 --- a/net/sunrpc/auth_gss/gss_krb5_wrap.c +++ b/net/sunrpc/auth_gss/gss_krb5_wrap.c | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | #include <linux/types.h> | 1 | #include <linux/types.h> |
| 2 | #include <linux/slab.h> | ||
| 3 | #include <linux/jiffies.h> | 2 | #include <linux/jiffies.h> |
| 4 | #include <linux/sunrpc/gss_krb5.h> | 3 | #include <linux/sunrpc/gss_krb5.h> |
| 5 | #include <linux/random.h> | 4 | #include <linux/random.h> |
diff --git a/net/sunrpc/auth_gss/gss_spkm3_seal.c b/net/sunrpc/auth_gss/gss_spkm3_seal.c index c832712f8d55..5a3a65a0e2b4 100644 --- a/net/sunrpc/auth_gss/gss_spkm3_seal.c +++ b/net/sunrpc/auth_gss/gss_spkm3_seal.c | |||
| @@ -34,7 +34,6 @@ | |||
| 34 | */ | 34 | */ |
| 35 | 35 | ||
| 36 | #include <linux/types.h> | 36 | #include <linux/types.h> |
| 37 | #include <linux/slab.h> | ||
| 38 | #include <linux/jiffies.h> | 37 | #include <linux/jiffies.h> |
| 39 | #include <linux/sunrpc/gss_spkm3.h> | 38 | #include <linux/sunrpc/gss_spkm3.h> |
| 40 | #include <linux/random.h> | 39 | #include <linux/random.h> |
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index e34bc531fcb9..b81e790ef9f4 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | * | 37 | * |
| 38 | */ | 38 | */ |
| 39 | 39 | ||
| 40 | #include <linux/slab.h> | ||
| 40 | #include <linux/types.h> | 41 | #include <linux/types.h> |
| 41 | #include <linux/module.h> | 42 | #include <linux/module.h> |
| 42 | #include <linux/pagemap.h> | 43 | #include <linux/pagemap.h> |
diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c index 46b2647c5bd2..aac2f8b4ee21 100644 --- a/net/sunrpc/auth_unix.c +++ b/net/sunrpc/auth_unix.c | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de> | 6 | * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de> |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <linux/slab.h> | ||
| 9 | #include <linux/types.h> | 10 | #include <linux/types.h> |
| 10 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
| 11 | #include <linux/module.h> | 12 | #include <linux/module.h> |
diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c index 553621fb2c41..cf06af3b63c6 100644 --- a/net/sunrpc/backchannel_rqst.c +++ b/net/sunrpc/backchannel_rqst.c | |||
| @@ -22,6 +22,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| 22 | ******************************************************************************/ | 22 | ******************************************************************************/ |
| 23 | 23 | ||
| 24 | #include <linux/tcp.h> | 24 | #include <linux/tcp.h> |
| 25 | #include <linux/slab.h> | ||
| 25 | #include <linux/sunrpc/xprt.h> | 26 | #include <linux/sunrpc/xprt.h> |
| 26 | 27 | ||
| 27 | #ifdef RPC_DEBUG | 28 | #ifdef RPC_DEBUG |
diff --git a/net/sunrpc/bc_svc.c b/net/sunrpc/bc_svc.c index 13f214f53120..f0c05d3311c1 100644 --- a/net/sunrpc/bc_svc.c +++ b/net/sunrpc/bc_svc.c | |||
| @@ -37,21 +37,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| 37 | 37 | ||
| 38 | #define RPCDBG_FACILITY RPCDBG_SVCDSP | 38 | #define RPCDBG_FACILITY RPCDBG_SVCDSP |
| 39 | 39 | ||
| 40 | void bc_release_request(struct rpc_task *task) | ||
| 41 | { | ||
| 42 | struct rpc_rqst *req = task->tk_rqstp; | ||
| 43 | |||
| 44 | dprintk("RPC: bc_release_request: task= %p\n", task); | ||
| 45 | |||
| 46 | /* | ||
| 47 | * Release this request only if it's a backchannel | ||
| 48 | * preallocated request | ||
| 49 | */ | ||
| 50 | if (!bc_prealloc(req)) | ||
| 51 | return; | ||
| 52 | xprt_free_bc_request(req); | ||
| 53 | } | ||
| 54 | |||
| 55 | /* Empty callback ops */ | 40 | /* Empty callback ops */ |
| 56 | static const struct rpc_call_ops nfs41_callback_ops = { | 41 | static const struct rpc_call_ops nfs41_callback_ops = { |
| 57 | }; | 42 | }; |
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 154034b675bd..19c9983d5360 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
| @@ -659,6 +659,7 @@ struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req, | |||
| 659 | task = rpc_new_task(&task_setup_data); | 659 | task = rpc_new_task(&task_setup_data); |
| 660 | if (!task) { | 660 | if (!task) { |
| 661 | xprt_free_bc_request(req); | 661 | xprt_free_bc_request(req); |
| 662 | task = ERR_PTR(-ENOMEM); | ||
| 662 | goto out; | 663 | goto out; |
| 663 | } | 664 | } |
| 664 | task->tk_rqstp = req; | 665 | task->tk_rqstp = req; |
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 8d63f8fd29b7..20e30c6f8355 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c | |||
| @@ -587,6 +587,8 @@ static struct dentry *__rpc_lookup_create_exclusive(struct dentry *parent, | |||
| 587 | struct dentry *dentry; | 587 | struct dentry *dentry; |
| 588 | 588 | ||
| 589 | dentry = __rpc_lookup_create(parent, name); | 589 | dentry = __rpc_lookup_create(parent, name); |
| 590 | if (IS_ERR(dentry)) | ||
| 591 | return dentry; | ||
| 590 | if (dentry->d_inode == NULL) | 592 | if (dentry->d_inode == NULL) |
| 591 | return dentry; | 593 | return dentry; |
| 592 | dput(dentry); | 594 | dput(dentry); |
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index 3e3772d8eb92..121105355f60 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
| 22 | #include <linux/errno.h> | 22 | #include <linux/errno.h> |
| 23 | #include <linux/mutex.h> | 23 | #include <linux/mutex.h> |
| 24 | #include <linux/slab.h> | ||
| 24 | #include <net/ipv6.h> | 25 | #include <net/ipv6.h> |
| 25 | 26 | ||
| 26 | #include <linux/sunrpc/clnt.h> | 27 | #include <linux/sunrpc/clnt.h> |
diff --git a/net/sunrpc/socklib.c b/net/sunrpc/socklib.c index a661a3acb37e..10b4319ebbca 100644 --- a/net/sunrpc/socklib.c +++ b/net/sunrpc/socklib.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | #include <linux/compiler.h> | 9 | #include <linux/compiler.h> |
| 10 | #include <linux/netdevice.h> | 10 | #include <linux/netdevice.h> |
| 11 | #include <linux/gfp.h> | ||
| 11 | #include <linux/skbuff.h> | 12 | #include <linux/skbuff.h> |
| 12 | #include <linux/types.h> | 13 | #include <linux/types.h> |
| 13 | #include <linux/pagemap.h> | 14 | #include <linux/pagemap.h> |
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c index 1b4e6791ecf3..5785d2037f45 100644 --- a/net/sunrpc/stats.c +++ b/net/sunrpc/stats.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 16 | #include <linux/slab.h> | ||
| 16 | 17 | ||
| 17 | #include <linux/init.h> | 18 | #include <linux/init.h> |
| 18 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 8420a4205b76..d9017d64597e 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
| 20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
| 21 | #include <linux/kthread.h> | 21 | #include <linux/kthread.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | 23 | ||
| 23 | #include <linux/sunrpc/types.h> | 24 | #include <linux/sunrpc/types.h> |
| 24 | #include <linux/sunrpc/xdr.h> | 25 | #include <linux/sunrpc/xdr.h> |
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 8f0f1fb3dc52..061b2e0f9118 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include <linux/errno.h> | 9 | #include <linux/errno.h> |
| 10 | #include <linux/freezer.h> | 10 | #include <linux/freezer.h> |
| 11 | #include <linux/kthread.h> | 11 | #include <linux/kthread.h> |
| 12 | #include <linux/slab.h> | ||
| 12 | #include <net/sock.h> | 13 | #include <net/sock.h> |
| 13 | #include <linux/sunrpc/stats.h> | 14 | #include <linux/sunrpc/stats.h> |
| 14 | #include <linux/sunrpc/svc_xprt.h> | 15 | #include <linux/sunrpc/svc_xprt.h> |
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index afdcb0459a83..207311610988 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/seq_file.h> | 10 | #include <linux/seq_file.h> |
| 11 | #include <linux/hash.h> | 11 | #include <linux/hash.h> |
| 12 | #include <linux/string.h> | 12 | #include <linux/string.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <net/sock.h> | 14 | #include <net/sock.h> |
| 14 | #include <net/ipv6.h> | 15 | #include <net/ipv6.h> |
| 15 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index 8bd690c48b69..2763fde88499 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 10 | #include <linux/slab.h> | ||
| 10 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 11 | #include <linux/string.h> | 12 | #include <linux/string.h> |
| 12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 469de292c23c..42f09ade0044 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
| @@ -46,6 +46,7 @@ | |||
| 46 | 46 | ||
| 47 | #include <linux/sunrpc/clnt.h> | 47 | #include <linux/sunrpc/clnt.h> |
| 48 | #include <linux/sunrpc/metrics.h> | 48 | #include <linux/sunrpc/metrics.h> |
| 49 | #include <linux/sunrpc/bc_xprt.h> | ||
| 49 | 50 | ||
| 50 | #include "sunrpc.h" | 51 | #include "sunrpc.h" |
| 51 | 52 | ||
| @@ -1032,21 +1033,16 @@ void xprt_release(struct rpc_task *task) | |||
| 1032 | if (req->rq_release_snd_buf) | 1033 | if (req->rq_release_snd_buf) |
| 1033 | req->rq_release_snd_buf(req); | 1034 | req->rq_release_snd_buf(req); |
| 1034 | 1035 | ||
| 1035 | /* | ||
| 1036 | * Early exit if this is a backchannel preallocated request. | ||
| 1037 | * There is no need to have it added to the RPC slot list. | ||
| 1038 | */ | ||
| 1039 | if (is_bc_request) | ||
| 1040 | return; | ||
| 1041 | |||
| 1042 | memset(req, 0, sizeof(*req)); /* mark unused */ | ||
| 1043 | |||
| 1044 | dprintk("RPC: %5u release request %p\n", task->tk_pid, req); | 1036 | dprintk("RPC: %5u release request %p\n", task->tk_pid, req); |
| 1037 | if (likely(!is_bc_request)) { | ||
| 1038 | memset(req, 0, sizeof(*req)); /* mark unused */ | ||
| 1045 | 1039 | ||
| 1046 | spin_lock(&xprt->reserve_lock); | 1040 | spin_lock(&xprt->reserve_lock); |
| 1047 | list_add(&req->rq_list, &xprt->free); | 1041 | list_add(&req->rq_list, &xprt->free); |
| 1048 | rpc_wake_up_next(&xprt->backlog); | 1042 | rpc_wake_up_next(&xprt->backlog); |
| 1049 | spin_unlock(&xprt->reserve_lock); | 1043 | spin_unlock(&xprt->reserve_lock); |
| 1044 | } else | ||
| 1045 | xprt_free_bc_request(req); | ||
| 1050 | } | 1046 | } |
| 1051 | 1047 | ||
| 1052 | /** | 1048 | /** |
diff --git a/net/sunrpc/xprtrdma/svc_rdma.c b/net/sunrpc/xprtrdma/svc_rdma.c index 5b8a8ff93a25..d718b8fa9525 100644 --- a/net/sunrpc/xprtrdma/svc_rdma.c +++ b/net/sunrpc/xprtrdma/svc_rdma.c | |||
| @@ -40,6 +40,7 @@ | |||
| 40 | */ | 40 | */ |
| 41 | #include <linux/module.h> | 41 | #include <linux/module.h> |
| 42 | #include <linux/init.h> | 42 | #include <linux/init.h> |
| 43 | #include <linux/slab.h> | ||
| 43 | #include <linux/fs.h> | 44 | #include <linux/fs.h> |
| 44 | #include <linux/sysctl.h> | 45 | #include <linux/sysctl.h> |
| 45 | #include <linux/sunrpc/clnt.h> | 46 | #include <linux/sunrpc/clnt.h> |
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index 3fa5751af0ec..edea15a54e51 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c | |||
| @@ -43,6 +43,7 @@ | |||
| 43 | #include <linux/sunrpc/debug.h> | 43 | #include <linux/sunrpc/debug.h> |
| 44 | #include <linux/sunrpc/rpc_rdma.h> | 44 | #include <linux/sunrpc/rpc_rdma.h> |
| 45 | #include <linux/sched.h> | 45 | #include <linux/sched.h> |
| 46 | #include <linux/slab.h> | ||
| 46 | #include <linux/spinlock.h> | 47 | #include <linux/spinlock.h> |
| 47 | #include <rdma/ib_verbs.h> | 48 | #include <rdma/ib_verbs.h> |
| 48 | #include <rdma/rdma_cm.h> | 49 | #include <rdma/rdma_cm.h> |
| @@ -678,7 +679,10 @@ static struct svc_xprt *svc_rdma_create(struct svc_serv *serv, | |||
| 678 | int ret; | 679 | int ret; |
| 679 | 680 | ||
| 680 | dprintk("svcrdma: Creating RDMA socket\n"); | 681 | dprintk("svcrdma: Creating RDMA socket\n"); |
| 681 | 682 | if (sa->sa_family != AF_INET) { | |
| 683 | dprintk("svcrdma: Address family %d is not supported.\n", sa->sa_family); | ||
| 684 | return ERR_PTR(-EAFNOSUPPORT); | ||
| 685 | } | ||
| 682 | cma_xprt = rdma_create_xprt(serv, 1); | 686 | cma_xprt = rdma_create_xprt(serv, 1); |
| 683 | if (!cma_xprt) | 687 | if (!cma_xprt) |
| 684 | return ERR_PTR(-ENOMEM); | 688 | return ERR_PTR(-ENOMEM); |
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c index 7018eef1dcdd..187257b1d880 100644 --- a/net/sunrpc/xprtrdma/transport.c +++ b/net/sunrpc/xprtrdma/transport.c | |||
| @@ -49,6 +49,7 @@ | |||
| 49 | 49 | ||
| 50 | #include <linux/module.h> | 50 | #include <linux/module.h> |
| 51 | #include <linux/init.h> | 51 | #include <linux/init.h> |
| 52 | #include <linux/slab.h> | ||
| 52 | #include <linux/seq_file.h> | 53 | #include <linux/seq_file.h> |
| 53 | 54 | ||
| 54 | #include "xprt_rdma.h" | 55 | #include "xprt_rdma.h" |
| @@ -160,16 +161,15 @@ xprt_rdma_format_addresses(struct rpc_xprt *xprt) | |||
| 160 | (void)rpc_ntop(sap, buf, sizeof(buf)); | 161 | (void)rpc_ntop(sap, buf, sizeof(buf)); |
| 161 | xprt->address_strings[RPC_DISPLAY_ADDR] = kstrdup(buf, GFP_KERNEL); | 162 | xprt->address_strings[RPC_DISPLAY_ADDR] = kstrdup(buf, GFP_KERNEL); |
| 162 | 163 | ||
| 163 | (void)snprintf(buf, sizeof(buf), "%u", rpc_get_port(sap)); | 164 | snprintf(buf, sizeof(buf), "%u", rpc_get_port(sap)); |
| 164 | xprt->address_strings[RPC_DISPLAY_PORT] = kstrdup(buf, GFP_KERNEL); | 165 | xprt->address_strings[RPC_DISPLAY_PORT] = kstrdup(buf, GFP_KERNEL); |
| 165 | 166 | ||
| 166 | xprt->address_strings[RPC_DISPLAY_PROTO] = "rdma"; | 167 | xprt->address_strings[RPC_DISPLAY_PROTO] = "rdma"; |
| 167 | 168 | ||
| 168 | (void)snprintf(buf, sizeof(buf), "%02x%02x%02x%02x", | 169 | snprintf(buf, sizeof(buf), "%08x", ntohl(sin->sin_addr.s_addr)); |
| 169 | NIPQUAD(sin->sin_addr.s_addr)); | ||
| 170 | xprt->address_strings[RPC_DISPLAY_HEX_ADDR] = kstrdup(buf, GFP_KERNEL); | 170 | xprt->address_strings[RPC_DISPLAY_HEX_ADDR] = kstrdup(buf, GFP_KERNEL); |
| 171 | 171 | ||
| 172 | (void)snprintf(buf, sizeof(buf), "%4hx", rpc_get_port(sap)); | 172 | snprintf(buf, sizeof(buf), "%4hx", rpc_get_port(sap)); |
| 173 | xprt->address_strings[RPC_DISPLAY_HEX_PORT] = kstrdup(buf, GFP_KERNEL); | 173 | xprt->address_strings[RPC_DISPLAY_HEX_PORT] = kstrdup(buf, GFP_KERNEL); |
| 174 | 174 | ||
| 175 | /* netid */ | 175 | /* netid */ |
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c index 2209aa87d899..27015c6d8eb5 100644 --- a/net/sunrpc/xprtrdma/verbs.c +++ b/net/sunrpc/xprtrdma/verbs.c | |||
| @@ -48,6 +48,7 @@ | |||
| 48 | */ | 48 | */ |
| 49 | 49 | ||
| 50 | #include <linux/pci.h> /* for Tavor hack below */ | 50 | #include <linux/pci.h> /* for Tavor hack below */ |
| 51 | #include <linux/slab.h> | ||
| 51 | 52 | ||
| 52 | #include "xprt_rdma.h" | 53 | #include "xprt_rdma.h" |
| 53 | 54 | ||
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 712412982cee..9847c30b5001 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
| @@ -297,12 +297,11 @@ static void xs_format_common_peer_addresses(struct rpc_xprt *xprt) | |||
| 297 | switch (sap->sa_family) { | 297 | switch (sap->sa_family) { |
| 298 | case AF_INET: | 298 | case AF_INET: |
| 299 | sin = xs_addr_in(xprt); | 299 | sin = xs_addr_in(xprt); |
| 300 | (void)snprintf(buf, sizeof(buf), "%02x%02x%02x%02x", | 300 | snprintf(buf, sizeof(buf), "%08x", ntohl(sin->sin_addr.s_addr)); |
| 301 | NIPQUAD(sin->sin_addr.s_addr)); | ||
| 302 | break; | 301 | break; |
| 303 | case AF_INET6: | 302 | case AF_INET6: |
| 304 | sin6 = xs_addr_in6(xprt); | 303 | sin6 = xs_addr_in6(xprt); |
| 305 | (void)snprintf(buf, sizeof(buf), "%pi6", &sin6->sin6_addr); | 304 | snprintf(buf, sizeof(buf), "%pi6", &sin6->sin6_addr); |
| 306 | break; | 305 | break; |
| 307 | default: | 306 | default: |
| 308 | BUG(); | 307 | BUG(); |
| @@ -315,10 +314,10 @@ static void xs_format_common_peer_ports(struct rpc_xprt *xprt) | |||
| 315 | struct sockaddr *sap = xs_addr(xprt); | 314 | struct sockaddr *sap = xs_addr(xprt); |
| 316 | char buf[128]; | 315 | char buf[128]; |
| 317 | 316 | ||
| 318 | (void)snprintf(buf, sizeof(buf), "%u", rpc_get_port(sap)); | 317 | snprintf(buf, sizeof(buf), "%u", rpc_get_port(sap)); |
| 319 | xprt->address_strings[RPC_DISPLAY_PORT] = kstrdup(buf, GFP_KERNEL); | 318 | xprt->address_strings[RPC_DISPLAY_PORT] = kstrdup(buf, GFP_KERNEL); |
| 320 | 319 | ||
| 321 | (void)snprintf(buf, sizeof(buf), "%4hx", rpc_get_port(sap)); | 320 | snprintf(buf, sizeof(buf), "%4hx", rpc_get_port(sap)); |
| 322 | xprt->address_strings[RPC_DISPLAY_HEX_PORT] = kstrdup(buf, GFP_KERNEL); | 321 | xprt->address_strings[RPC_DISPLAY_HEX_PORT] = kstrdup(buf, GFP_KERNEL); |
| 323 | } | 322 | } |
| 324 | 323 | ||
| @@ -549,8 +548,6 @@ static int xs_udp_send_request(struct rpc_task *task) | |||
| 549 | /* Still some bytes left; set up for a retry later. */ | 548 | /* Still some bytes left; set up for a retry later. */ |
| 550 | status = -EAGAIN; | 549 | status = -EAGAIN; |
| 551 | } | 550 | } |
| 552 | if (!transport->sock) | ||
| 553 | goto out; | ||
| 554 | 551 | ||
| 555 | switch (status) { | 552 | switch (status) { |
| 556 | case -ENOTSOCK: | 553 | case -ENOTSOCK: |
| @@ -570,7 +567,7 @@ static int xs_udp_send_request(struct rpc_task *task) | |||
| 570 | * prompts ECONNREFUSED. */ | 567 | * prompts ECONNREFUSED. */ |
| 571 | clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); | 568 | clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); |
| 572 | } | 569 | } |
| 573 | out: | 570 | |
| 574 | return status; | 571 | return status; |
| 575 | } | 572 | } |
| 576 | 573 | ||
| @@ -652,8 +649,6 @@ static int xs_tcp_send_request(struct rpc_task *task) | |||
| 652 | status = -EAGAIN; | 649 | status = -EAGAIN; |
| 653 | break; | 650 | break; |
| 654 | } | 651 | } |
| 655 | if (!transport->sock) | ||
| 656 | goto out; | ||
| 657 | 652 | ||
| 658 | switch (status) { | 653 | switch (status) { |
| 659 | case -ENOTSOCK: | 654 | case -ENOTSOCK: |
| @@ -673,7 +668,7 @@ static int xs_tcp_send_request(struct rpc_task *task) | |||
| 673 | case -ENOTCONN: | 668 | case -ENOTCONN: |
| 674 | clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); | 669 | clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); |
| 675 | } | 670 | } |
| 676 | out: | 671 | |
| 677 | return status; | 672 | return status; |
| 678 | } | 673 | } |
| 679 | 674 | ||
| @@ -2256,9 +2251,6 @@ static struct rpc_xprt_ops xs_tcp_ops = { | |||
| 2256 | .buf_free = rpc_free, | 2251 | .buf_free = rpc_free, |
| 2257 | .send_request = xs_tcp_send_request, | 2252 | .send_request = xs_tcp_send_request, |
| 2258 | .set_retrans_timeout = xprt_set_retrans_timeout_def, | 2253 | .set_retrans_timeout = xprt_set_retrans_timeout_def, |
| 2259 | #if defined(CONFIG_NFS_V4_1) | ||
| 2260 | .release_request = bc_release_request, | ||
| 2261 | #endif /* CONFIG_NFS_V4_1 */ | ||
| 2262 | .close = xs_tcp_close, | 2254 | .close = xs_tcp_close, |
| 2263 | .destroy = xs_destroy, | 2255 | .destroy = xs_destroy, |
| 2264 | .print_stats = xs_tcp_print_stats, | 2256 | .print_stats = xs_tcp_print_stats, |
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 327011fcc407..78091375ca12 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c | |||
| @@ -45,10 +45,10 @@ | |||
| 45 | 45 | ||
| 46 | #define MAX_ADDR_STR 32 | 46 | #define MAX_ADDR_STR 32 |
| 47 | 47 | ||
| 48 | static struct media *media_list = NULL; | 48 | static struct media media_list[MAX_MEDIA]; |
| 49 | static u32 media_count = 0; | 49 | static u32 media_count = 0; |
| 50 | 50 | ||
| 51 | struct bearer *tipc_bearers = NULL; | 51 | struct bearer tipc_bearers[MAX_BEARERS]; |
| 52 | 52 | ||
| 53 | /** | 53 | /** |
| 54 | * media_name_valid - validate media name | 54 | * media_name_valid - validate media name |
| @@ -108,9 +108,11 @@ int tipc_register_media(u32 media_type, | |||
| 108 | int res = -EINVAL; | 108 | int res = -EINVAL; |
| 109 | 109 | ||
| 110 | write_lock_bh(&tipc_net_lock); | 110 | write_lock_bh(&tipc_net_lock); |
| 111 | if (!media_list) | ||
| 112 | goto exit; | ||
| 113 | 111 | ||
| 112 | if (tipc_mode != TIPC_NET_MODE) { | ||
| 113 | warn("Media <%s> rejected, not in networked mode yet\n", name); | ||
| 114 | goto exit; | ||
| 115 | } | ||
| 114 | if (!media_name_valid(name)) { | 116 | if (!media_name_valid(name)) { |
| 115 | warn("Media <%s> rejected, illegal name\n", name); | 117 | warn("Media <%s> rejected, illegal name\n", name); |
| 116 | goto exit; | 118 | goto exit; |
| @@ -660,33 +662,10 @@ int tipc_disable_bearer(const char *name) | |||
| 660 | 662 | ||
| 661 | 663 | ||
| 662 | 664 | ||
| 663 | int tipc_bearer_init(void) | ||
| 664 | { | ||
| 665 | int res; | ||
| 666 | |||
| 667 | write_lock_bh(&tipc_net_lock); | ||
| 668 | tipc_bearers = kcalloc(MAX_BEARERS, sizeof(struct bearer), GFP_ATOMIC); | ||
| 669 | media_list = kcalloc(MAX_MEDIA, sizeof(struct media), GFP_ATOMIC); | ||
| 670 | if (tipc_bearers && media_list) { | ||
| 671 | res = 0; | ||
| 672 | } else { | ||
| 673 | kfree(tipc_bearers); | ||
| 674 | kfree(media_list); | ||
| 675 | tipc_bearers = NULL; | ||
| 676 | media_list = NULL; | ||
| 677 | res = -ENOMEM; | ||
| 678 | } | ||
| 679 | write_unlock_bh(&tipc_net_lock); | ||
| 680 | return res; | ||
| 681 | } | ||
| 682 | |||
| 683 | void tipc_bearer_stop(void) | 665 | void tipc_bearer_stop(void) |
| 684 | { | 666 | { |
| 685 | u32 i; | 667 | u32 i; |
| 686 | 668 | ||
| 687 | if (!tipc_bearers) | ||
| 688 | return; | ||
| 689 | |||
| 690 | for (i = 0; i < MAX_BEARERS; i++) { | 669 | for (i = 0; i < MAX_BEARERS; i++) { |
| 691 | if (tipc_bearers[i].active) | 670 | if (tipc_bearers[i].active) |
| 692 | tipc_bearers[i].publ.blocked = 1; | 671 | tipc_bearers[i].publ.blocked = 1; |
| @@ -695,10 +674,6 @@ void tipc_bearer_stop(void) | |||
| 695 | if (tipc_bearers[i].active) | 674 | if (tipc_bearers[i].active) |
| 696 | bearer_disable(tipc_bearers[i].publ.name); | 675 | bearer_disable(tipc_bearers[i].publ.name); |
| 697 | } | 676 | } |
| 698 | kfree(tipc_bearers); | ||
| 699 | kfree(media_list); | ||
| 700 | tipc_bearers = NULL; | ||
| 701 | media_list = NULL; | ||
| 702 | media_count = 0; | 677 | media_count = 0; |
| 703 | } | 678 | } |
| 704 | 679 | ||
diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h index ca5734892713..000228e93f9e 100644 --- a/net/tipc/bearer.h +++ b/net/tipc/bearer.h | |||
| @@ -114,7 +114,7 @@ struct bearer_name { | |||
| 114 | 114 | ||
| 115 | struct link; | 115 | struct link; |
| 116 | 116 | ||
| 117 | extern struct bearer *tipc_bearers; | 117 | extern struct bearer tipc_bearers[]; |
| 118 | 118 | ||
| 119 | void tipc_media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a); | 119 | void tipc_media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a); |
| 120 | struct sk_buff *tipc_media_get_names(void); | 120 | struct sk_buff *tipc_media_get_names(void); |
diff --git a/net/tipc/core.h b/net/tipc/core.h index a881f92a8537..c58a1d16563a 100644 --- a/net/tipc/core.h +++ b/net/tipc/core.h | |||
| @@ -56,6 +56,7 @@ | |||
| 56 | #include <linux/netdevice.h> | 56 | #include <linux/netdevice.h> |
| 57 | #include <linux/in.h> | 57 | #include <linux/in.h> |
| 58 | #include <linux/list.h> | 58 | #include <linux/list.h> |
| 59 | #include <linux/slab.h> | ||
| 59 | #include <linux/vmalloc.h> | 60 | #include <linux/vmalloc.h> |
| 60 | 61 | ||
| 61 | /* | 62 | /* |
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c index 524ba5696d4d..6230d16020c4 100644 --- a/net/tipc/eth_media.c +++ b/net/tipc/eth_media.c | |||
| @@ -38,6 +38,7 @@ | |||
| 38 | #include <net/tipc/tipc_bearer.h> | 38 | #include <net/tipc/tipc_bearer.h> |
| 39 | #include <net/tipc/tipc_msg.h> | 39 | #include <net/tipc/tipc_msg.h> |
| 40 | #include <linux/netdevice.h> | 40 | #include <linux/netdevice.h> |
| 41 | #include <linux/slab.h> | ||
| 41 | #include <net/net_namespace.h> | 42 | #include <net/net_namespace.h> |
| 42 | 43 | ||
| 43 | #define MAX_ETH_BEARERS 2 | 44 | #define MAX_ETH_BEARERS 2 |
diff --git a/net/tipc/link.c b/net/tipc/link.c index 6f50f6423f63..1a7e4665af80 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
| @@ -1882,6 +1882,15 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *tb_ptr) | |||
| 1882 | (msg_destnode(msg) != tipc_own_addr))) | 1882 | (msg_destnode(msg) != tipc_own_addr))) |
| 1883 | goto cont; | 1883 | goto cont; |
| 1884 | 1884 | ||
| 1885 | /* Discard non-routeable messages destined for another node */ | ||
| 1886 | |||
| 1887 | if (unlikely(!msg_isdata(msg) && | ||
| 1888 | (msg_destnode(msg) != tipc_own_addr))) { | ||
| 1889 | if ((msg_user(msg) != CONN_MANAGER) && | ||
| 1890 | (msg_user(msg) != MSG_FRAGMENTER)) | ||
| 1891 | goto cont; | ||
| 1892 | } | ||
| 1893 | |||
| 1885 | /* Locate unicast link endpoint that should handle message */ | 1894 | /* Locate unicast link endpoint that should handle message */ |
| 1886 | 1895 | ||
| 1887 | n_ptr = tipc_node_find(msg_prevnode(msg)); | 1896 | n_ptr = tipc_node_find(msg_prevnode(msg)); |
diff --git a/net/tipc/net.c b/net/tipc/net.c index 7906608bf510..f25b1cdb64eb 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c | |||
| @@ -116,7 +116,8 @@ | |||
| 116 | */ | 116 | */ |
| 117 | 117 | ||
| 118 | DEFINE_RWLOCK(tipc_net_lock); | 118 | DEFINE_RWLOCK(tipc_net_lock); |
| 119 | struct network tipc_net = { NULL }; | 119 | struct _zone *tipc_zones[256] = { NULL, }; |
| 120 | struct network tipc_net = { tipc_zones }; | ||
| 120 | 121 | ||
| 121 | struct tipc_node *tipc_net_select_remote_node(u32 addr, u32 ref) | 122 | struct tipc_node *tipc_net_select_remote_node(u32 addr, u32 ref) |
| 122 | { | 123 | { |
| @@ -158,28 +159,12 @@ void tipc_net_send_external_routes(u32 dest) | |||
| 158 | } | 159 | } |
| 159 | } | 160 | } |
| 160 | 161 | ||
| 161 | static int net_init(void) | ||
| 162 | { | ||
| 163 | memset(&tipc_net, 0, sizeof(tipc_net)); | ||
| 164 | tipc_net.zones = kcalloc(tipc_max_zones + 1, sizeof(struct _zone *), GFP_ATOMIC); | ||
| 165 | if (!tipc_net.zones) { | ||
| 166 | return -ENOMEM; | ||
| 167 | } | ||
| 168 | return 0; | ||
| 169 | } | ||
| 170 | |||
| 171 | static void net_stop(void) | 162 | static void net_stop(void) |
| 172 | { | 163 | { |
| 173 | u32 z_num; | 164 | u32 z_num; |
| 174 | 165 | ||
| 175 | if (!tipc_net.zones) | 166 | for (z_num = 1; z_num <= tipc_max_zones; z_num++) |
| 176 | return; | ||
| 177 | |||
| 178 | for (z_num = 1; z_num <= tipc_max_zones; z_num++) { | ||
| 179 | tipc_zone_delete(tipc_net.zones[z_num]); | 167 | tipc_zone_delete(tipc_net.zones[z_num]); |
| 180 | } | ||
| 181 | kfree(tipc_net.zones); | ||
| 182 | tipc_net.zones = NULL; | ||
| 183 | } | 168 | } |
| 184 | 169 | ||
| 185 | static void net_route_named_msg(struct sk_buff *buf) | 170 | static void net_route_named_msg(struct sk_buff *buf) |
| @@ -282,9 +267,7 @@ int tipc_net_start(u32 addr) | |||
| 282 | tipc_named_reinit(); | 267 | tipc_named_reinit(); |
| 283 | tipc_port_reinit(); | 268 | tipc_port_reinit(); |
| 284 | 269 | ||
| 285 | if ((res = tipc_bearer_init()) || | 270 | if ((res = tipc_cltr_init()) || |
| 286 | (res = net_init()) || | ||
| 287 | (res = tipc_cltr_init()) || | ||
| 288 | (res = tipc_bclink_init())) { | 271 | (res = tipc_bclink_init())) { |
| 289 | return res; | 272 | return res; |
| 290 | } | 273 | } |
diff --git a/net/tipc/ref.c b/net/tipc/ref.c index 414fc34b8bea..8dea66500cf5 100644 --- a/net/tipc/ref.c +++ b/net/tipc/ref.c | |||
| @@ -153,11 +153,11 @@ void tipc_ref_table_stop(void) | |||
| 153 | 153 | ||
| 154 | u32 tipc_ref_acquire(void *object, spinlock_t **lock) | 154 | u32 tipc_ref_acquire(void *object, spinlock_t **lock) |
| 155 | { | 155 | { |
| 156 | struct reference *entry; | ||
| 157 | u32 index; | 156 | u32 index; |
| 158 | u32 index_mask; | 157 | u32 index_mask; |
| 159 | u32 next_plus_upper; | 158 | u32 next_plus_upper; |
| 160 | u32 ref; | 159 | u32 ref; |
| 160 | struct reference *entry = NULL; | ||
| 161 | 161 | ||
| 162 | if (!object) { | 162 | if (!object) { |
| 163 | err("Attempt to acquire reference to non-existent object\n"); | 163 | err("Attempt to acquire reference to non-existent object\n"); |
| @@ -175,30 +175,36 @@ u32 tipc_ref_acquire(void *object, spinlock_t **lock) | |||
| 175 | index = tipc_ref_table.first_free; | 175 | index = tipc_ref_table.first_free; |
| 176 | entry = &(tipc_ref_table.entries[index]); | 176 | entry = &(tipc_ref_table.entries[index]); |
| 177 | index_mask = tipc_ref_table.index_mask; | 177 | index_mask = tipc_ref_table.index_mask; |
| 178 | /* take lock in case a previous user of entry still holds it */ | ||
| 179 | spin_lock_bh(&entry->lock); | ||
| 180 | next_plus_upper = entry->ref; | 178 | next_plus_upper = entry->ref; |
| 181 | tipc_ref_table.first_free = next_plus_upper & index_mask; | 179 | tipc_ref_table.first_free = next_plus_upper & index_mask; |
| 182 | ref = (next_plus_upper & ~index_mask) + index; | 180 | ref = (next_plus_upper & ~index_mask) + index; |
| 183 | entry->ref = ref; | ||
| 184 | entry->object = object; | ||
| 185 | *lock = &entry->lock; | ||
| 186 | } | 181 | } |
| 187 | else if (tipc_ref_table.init_point < tipc_ref_table.capacity) { | 182 | else if (tipc_ref_table.init_point < tipc_ref_table.capacity) { |
| 188 | index = tipc_ref_table.init_point++; | 183 | index = tipc_ref_table.init_point++; |
| 189 | entry = &(tipc_ref_table.entries[index]); | 184 | entry = &(tipc_ref_table.entries[index]); |
| 190 | spin_lock_init(&entry->lock); | 185 | spin_lock_init(&entry->lock); |
| 191 | spin_lock_bh(&entry->lock); | ||
| 192 | ref = tipc_ref_table.start_mask + index; | 186 | ref = tipc_ref_table.start_mask + index; |
| 193 | entry->ref = ref; | ||
| 194 | entry->object = object; | ||
| 195 | *lock = &entry->lock; | ||
| 196 | } | 187 | } |
| 197 | else { | 188 | else { |
| 198 | ref = 0; | 189 | ref = 0; |
| 199 | } | 190 | } |
| 200 | write_unlock_bh(&ref_table_lock); | 191 | write_unlock_bh(&ref_table_lock); |
| 201 | 192 | ||
| 193 | /* | ||
| 194 | * Grab the lock so no one else can modify this entry | ||
| 195 | * While we assign its ref value & object pointer | ||
| 196 | */ | ||
| 197 | if (entry) { | ||
| 198 | spin_lock_bh(&entry->lock); | ||
| 199 | entry->ref = ref; | ||
| 200 | entry->object = object; | ||
| 201 | *lock = &entry->lock; | ||
| 202 | /* | ||
| 203 | * keep it locked, the caller is responsible | ||
| 204 | * for unlocking this when they're done with it | ||
| 205 | */ | ||
| 206 | } | ||
| 207 | |||
| 202 | return ref; | 208 | return ref; |
| 203 | } | 209 | } |
| 204 | 210 | ||
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 1ea64f09cc45..cfb20b80b3a1 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
| @@ -40,9 +40,9 @@ | |||
| 40 | #include <linux/socket.h> | 40 | #include <linux/socket.h> |
| 41 | #include <linux/errno.h> | 41 | #include <linux/errno.h> |
| 42 | #include <linux/mm.h> | 42 | #include <linux/mm.h> |
| 43 | #include <linux/slab.h> | ||
| 44 | #include <linux/poll.h> | 43 | #include <linux/poll.h> |
| 45 | #include <linux/fcntl.h> | 44 | #include <linux/fcntl.h> |
| 45 | #include <linux/gfp.h> | ||
| 46 | #include <asm/string.h> | 46 | #include <asm/string.h> |
| 47 | #include <asm/atomic.h> | 47 | #include <asm/atomic.h> |
| 48 | #include <net/sock.h> | 48 | #include <net/sock.h> |
| @@ -1322,8 +1322,10 @@ static u32 dispatch(struct tipc_port *tport, struct sk_buff *buf) | |||
| 1322 | if (!sock_owned_by_user(sk)) { | 1322 | if (!sock_owned_by_user(sk)) { |
| 1323 | res = filter_rcv(sk, buf); | 1323 | res = filter_rcv(sk, buf); |
| 1324 | } else { | 1324 | } else { |
| 1325 | sk_add_backlog(sk, buf); | 1325 | if (sk_add_backlog(sk, buf)) |
| 1326 | res = TIPC_OK; | 1326 | res = TIPC_ERR_OVERLOAD; |
| 1327 | else | ||
| 1328 | res = TIPC_OK; | ||
| 1327 | } | 1329 | } |
| 1328 | bh_unlock_sock(sk); | 1330 | bh_unlock_sock(sk); |
| 1329 | 1331 | ||
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c index ac91f0dfa144..ff123e56114a 100644 --- a/net/tipc/subscr.c +++ b/net/tipc/subscr.c | |||
| @@ -76,19 +76,6 @@ struct top_srv { | |||
| 76 | static struct top_srv topsrv = { 0 }; | 76 | static struct top_srv topsrv = { 0 }; |
| 77 | 77 | ||
| 78 | /** | 78 | /** |
| 79 | * htohl - convert value to endianness used by destination | ||
| 80 | * @in: value to convert | ||
| 81 | * @swap: non-zero if endianness must be reversed | ||
| 82 | * | ||
| 83 | * Returns converted value | ||
| 84 | */ | ||
| 85 | |||
| 86 | static u32 htohl(u32 in, int swap) | ||
| 87 | { | ||
| 88 | return swap ? swab32(in) : in; | ||
| 89 | } | ||
| 90 | |||
| 91 | /** | ||
| 92 | * subscr_send_event - send a message containing a tipc_event to the subscriber | 79 | * subscr_send_event - send a message containing a tipc_event to the subscriber |
| 93 | * | 80 | * |
| 94 | * Note: Must not hold subscriber's server port lock, since tipc_send() will | 81 | * Note: Must not hold subscriber's server port lock, since tipc_send() will |
| @@ -107,11 +94,11 @@ static void subscr_send_event(struct subscription *sub, | |||
| 107 | msg_sect.iov_base = (void *)&sub->evt; | 94 | msg_sect.iov_base = (void *)&sub->evt; |
| 108 | msg_sect.iov_len = sizeof(struct tipc_event); | 95 | msg_sect.iov_len = sizeof(struct tipc_event); |
| 109 | 96 | ||
| 110 | sub->evt.event = htohl(event, sub->swap); | 97 | sub->evt.event = htonl(event); |
| 111 | sub->evt.found_lower = htohl(found_lower, sub->swap); | 98 | sub->evt.found_lower = htonl(found_lower); |
| 112 | sub->evt.found_upper = htohl(found_upper, sub->swap); | 99 | sub->evt.found_upper = htonl(found_upper); |
| 113 | sub->evt.port.ref = htohl(port_ref, sub->swap); | 100 | sub->evt.port.ref = htonl(port_ref); |
| 114 | sub->evt.port.node = htohl(node, sub->swap); | 101 | sub->evt.port.node = htonl(node); |
| 115 | tipc_send(sub->server_ref, 1, &msg_sect); | 102 | tipc_send(sub->server_ref, 1, &msg_sect); |
| 116 | } | 103 | } |
| 117 | 104 | ||
| @@ -287,16 +274,23 @@ static void subscr_cancel(struct tipc_subscr *s, | |||
| 287 | { | 274 | { |
| 288 | struct subscription *sub; | 275 | struct subscription *sub; |
| 289 | struct subscription *sub_temp; | 276 | struct subscription *sub_temp; |
| 277 | __u32 type, lower, upper; | ||
| 290 | int found = 0; | 278 | int found = 0; |
| 291 | 279 | ||
| 292 | /* Find first matching subscription, exit if not found */ | 280 | /* Find first matching subscription, exit if not found */ |
| 293 | 281 | ||
| 282 | type = ntohl(s->seq.type); | ||
| 283 | lower = ntohl(s->seq.lower); | ||
| 284 | upper = ntohl(s->seq.upper); | ||
| 285 | |||
| 294 | list_for_each_entry_safe(sub, sub_temp, &subscriber->subscription_list, | 286 | list_for_each_entry_safe(sub, sub_temp, &subscriber->subscription_list, |
| 295 | subscription_list) { | 287 | subscription_list) { |
| 296 | if (!memcmp(s, &sub->evt.s, sizeof(struct tipc_subscr))) { | 288 | if ((type == sub->seq.type) && |
| 297 | found = 1; | 289 | (lower == sub->seq.lower) && |
| 298 | break; | 290 | (upper == sub->seq.upper)) { |
| 299 | } | 291 | found = 1; |
| 292 | break; | ||
| 293 | } | ||
| 300 | } | 294 | } |
| 301 | if (!found) | 295 | if (!found) |
| 302 | return; | 296 | return; |
| @@ -325,16 +319,10 @@ static struct subscription *subscr_subscribe(struct tipc_subscr *s, | |||
| 325 | struct subscriber *subscriber) | 319 | struct subscriber *subscriber) |
| 326 | { | 320 | { |
| 327 | struct subscription *sub; | 321 | struct subscription *sub; |
| 328 | int swap; | ||
| 329 | |||
| 330 | /* Determine subscriber's endianness */ | ||
| 331 | |||
| 332 | swap = !(s->filter & (TIPC_SUB_PORTS | TIPC_SUB_SERVICE)); | ||
| 333 | 322 | ||
| 334 | /* Detect & process a subscription cancellation request */ | 323 | /* Detect & process a subscription cancellation request */ |
| 335 | 324 | ||
| 336 | if (s->filter & htohl(TIPC_SUB_CANCEL, swap)) { | 325 | if (ntohl(s->filter) & TIPC_SUB_CANCEL) { |
| 337 | s->filter &= ~htohl(TIPC_SUB_CANCEL, swap); | ||
| 338 | subscr_cancel(s, subscriber); | 326 | subscr_cancel(s, subscriber); |
| 339 | return NULL; | 327 | return NULL; |
| 340 | } | 328 | } |
| @@ -359,11 +347,11 @@ static struct subscription *subscr_subscribe(struct tipc_subscr *s, | |||
| 359 | 347 | ||
| 360 | /* Initialize subscription object */ | 348 | /* Initialize subscription object */ |
| 361 | 349 | ||
| 362 | sub->seq.type = htohl(s->seq.type, swap); | 350 | sub->seq.type = ntohl(s->seq.type); |
| 363 | sub->seq.lower = htohl(s->seq.lower, swap); | 351 | sub->seq.lower = ntohl(s->seq.lower); |
| 364 | sub->seq.upper = htohl(s->seq.upper, swap); | 352 | sub->seq.upper = ntohl(s->seq.upper); |
| 365 | sub->timeout = htohl(s->timeout, swap); | 353 | sub->timeout = ntohl(s->timeout); |
| 366 | sub->filter = htohl(s->filter, swap); | 354 | sub->filter = ntohl(s->filter); |
| 367 | if ((!(sub->filter & TIPC_SUB_PORTS) == | 355 | if ((!(sub->filter & TIPC_SUB_PORTS) == |
| 368 | !(sub->filter & TIPC_SUB_SERVICE)) || | 356 | !(sub->filter & TIPC_SUB_SERVICE)) || |
| 369 | (sub->seq.lower > sub->seq.upper)) { | 357 | (sub->seq.lower > sub->seq.upper)) { |
| @@ -376,7 +364,6 @@ static struct subscription *subscr_subscribe(struct tipc_subscr *s, | |||
| 376 | INIT_LIST_HEAD(&sub->nameseq_list); | 364 | INIT_LIST_HEAD(&sub->nameseq_list); |
| 377 | list_add(&sub->subscription_list, &subscriber->subscription_list); | 365 | list_add(&sub->subscription_list, &subscriber->subscription_list); |
| 378 | sub->server_ref = subscriber->port_ref; | 366 | sub->server_ref = subscriber->port_ref; |
| 379 | sub->swap = swap; | ||
| 380 | memcpy(&sub->evt.s, s, sizeof(struct tipc_subscr)); | 367 | memcpy(&sub->evt.s, s, sizeof(struct tipc_subscr)); |
| 381 | atomic_inc(&topsrv.subscription_count); | 368 | atomic_inc(&topsrv.subscription_count); |
| 382 | if (sub->timeout != TIPC_WAIT_FOREVER) { | 369 | if (sub->timeout != TIPC_WAIT_FOREVER) { |
diff --git a/net/tipc/subscr.h b/net/tipc/subscr.h index 45d89bf4d202..c20f496d95b2 100644 --- a/net/tipc/subscr.h +++ b/net/tipc/subscr.h | |||
| @@ -53,7 +53,6 @@ typedef void (*tipc_subscr_event) (struct subscription *sub, | |||
| 53 | * @nameseq_list: adjacent subscriptions in name sequence's subscription list | 53 | * @nameseq_list: adjacent subscriptions in name sequence's subscription list |
| 54 | * @subscription_list: adjacent subscriptions in subscriber's subscription list | 54 | * @subscription_list: adjacent subscriptions in subscriber's subscription list |
| 55 | * @server_ref: object reference of server port associated with subscription | 55 | * @server_ref: object reference of server port associated with subscription |
| 56 | * @swap: indicates if subscriber uses opposite endianness in its messages | ||
| 57 | * @evt: template for events generated by subscription | 56 | * @evt: template for events generated by subscription |
| 58 | */ | 57 | */ |
| 59 | 58 | ||
| @@ -66,7 +65,6 @@ struct subscription { | |||
| 66 | struct list_head nameseq_list; | 65 | struct list_head nameseq_list; |
| 67 | struct list_head subscription_list; | 66 | struct list_head subscription_list; |
| 68 | u32 server_ref; | 67 | u32 server_ref; |
| 69 | int swap; | ||
| 70 | struct tipc_event evt; | 68 | struct tipc_event evt; |
| 71 | }; | 69 | }; |
| 72 | 70 | ||
diff --git a/net/unix/garbage.c b/net/unix/garbage.c index 19c17e4a0c8b..14c22c3768da 100644 --- a/net/unix/garbage.c +++ b/net/unix/garbage.c | |||
| @@ -74,7 +74,6 @@ | |||
| 74 | #include <linux/un.h> | 74 | #include <linux/un.h> |
| 75 | #include <linux/net.h> | 75 | #include <linux/net.h> |
| 76 | #include <linux/fs.h> | 76 | #include <linux/fs.h> |
| 77 | #include <linux/slab.h> | ||
| 78 | #include <linux/skbuff.h> | 77 | #include <linux/skbuff.h> |
| 79 | #include <linux/netdevice.h> | 78 | #include <linux/netdevice.h> |
| 80 | #include <linux/file.h> | 79 | #include <linux/file.h> |
diff --git a/net/unix/sysctl_net_unix.c b/net/unix/sysctl_net_unix.c index d095c7be10d0..397cffebb3b6 100644 --- a/net/unix/sysctl_net_unix.c +++ b/net/unix/sysctl_net_unix.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <linux/sysctl.h> | 14 | #include <linux/sysctl.h> |
| 14 | 15 | ||
| 15 | #include <net/af_unix.h> | 16 | #include <net/af_unix.h> |
diff --git a/net/wimax/op-msg.c b/net/wimax/op-msg.c index 7718657e93dc..d5b7c3779c43 100644 --- a/net/wimax/op-msg.c +++ b/net/wimax/op-msg.c | |||
| @@ -72,6 +72,7 @@ | |||
| 72 | * wimax_msg_send() | 72 | * wimax_msg_send() |
| 73 | */ | 73 | */ |
| 74 | #include <linux/device.h> | 74 | #include <linux/device.h> |
| 75 | #include <linux/slab.h> | ||
| 75 | #include <net/genetlink.h> | 76 | #include <net/genetlink.h> |
| 76 | #include <linux/netdevice.h> | 77 | #include <linux/netdevice.h> |
| 77 | #include <linux/wimax.h> | 78 | #include <linux/wimax.h> |
diff --git a/net/wimax/stack.c b/net/wimax/stack.c index 813e1eaea29b..1ed65dbdab03 100644 --- a/net/wimax/stack.c +++ b/net/wimax/stack.c | |||
| @@ -51,6 +51,7 @@ | |||
| 51 | * wimax_rfkill_rm() | 51 | * wimax_rfkill_rm() |
| 52 | */ | 52 | */ |
| 53 | #include <linux/device.h> | 53 | #include <linux/device.h> |
| 54 | #include <linux/gfp.h> | ||
| 54 | #include <net/genetlink.h> | 55 | #include <net/genetlink.h> |
| 55 | #include <linux/netdevice.h> | 56 | #include <linux/netdevice.h> |
| 56 | #include <linux/wimax.h> | 57 | #include <linux/wimax.h> |
diff --git a/net/wireless/core.c b/net/wireless/core.c index 7fdb9409ad2a..6ac70c101523 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <linux/module.h> | 8 | #include <linux/module.h> |
| 9 | #include <linux/err.h> | 9 | #include <linux/err.h> |
| 10 | #include <linux/list.h> | 10 | #include <linux/list.h> |
| 11 | #include <linux/slab.h> | ||
| 11 | #include <linux/nl80211.h> | 12 | #include <linux/nl80211.h> |
| 12 | #include <linux/debugfs.h> | 13 | #include <linux/debugfs.h> |
| 13 | #include <linux/notifier.h> | 14 | #include <linux/notifier.h> |
diff --git a/net/wireless/debugfs.c b/net/wireless/debugfs.c index 2e4895615037..a4991a3efec0 100644 --- a/net/wireless/debugfs.c +++ b/net/wireless/debugfs.c | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/slab.h> | ||
| 12 | #include "core.h" | 13 | #include "core.h" |
| 13 | #include "debugfs.h" | 14 | #include "debugfs.h" |
| 14 | 15 | ||
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c index 6ef5a491fb4b..6a5acf750174 100644 --- a/net/wireless/ibss.c +++ b/net/wireless/ibss.c | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <linux/etherdevice.h> | 7 | #include <linux/etherdevice.h> |
| 8 | #include <linux/if_arp.h> | 8 | #include <linux/if_arp.h> |
| 9 | #include <linux/slab.h> | ||
| 9 | #include <net/cfg80211.h> | 10 | #include <net/cfg80211.h> |
| 10 | #include "wext-compat.h" | 11 | #include "wext-compat.h" |
| 11 | #include "nl80211.h" | 12 | #include "nl80211.h" |
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c index 62bc8855e123..22139fa46115 100644 --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <linux/module.h> | 8 | #include <linux/module.h> |
| 9 | #include <linux/netdevice.h> | 9 | #include <linux/netdevice.h> |
| 10 | #include <linux/nl80211.h> | 10 | #include <linux/nl80211.h> |
| 11 | #include <linux/slab.h> | ||
| 11 | #include <linux/wireless.h> | 12 | #include <linux/wireless.h> |
| 12 | #include <net/cfg80211.h> | 13 | #include <net/cfg80211.h> |
| 13 | #include <net/iw_handler.h> | 14 | #include <net/iw_handler.h> |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index e447db04cf76..030cf153bea2 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <linux/if.h> | 7 | #include <linux/if.h> |
| 8 | #include <linux/module.h> | 8 | #include <linux/module.h> |
| 9 | #include <linux/err.h> | 9 | #include <linux/err.h> |
| 10 | #include <linux/slab.h> | ||
| 10 | #include <linux/list.h> | 11 | #include <linux/list.h> |
| 11 | #include <linux/if_ether.h> | 12 | #include <linux/if_ether.h> |
| 12 | #include <linux/ieee80211.h> | 13 | #include <linux/ieee80211.h> |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index ed89c59bb431..422da20d1e5b 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | * | 33 | * |
| 34 | */ | 34 | */ |
| 35 | #include <linux/kernel.h> | 35 | #include <linux/kernel.h> |
| 36 | #include <linux/slab.h> | ||
| 36 | #include <linux/list.h> | 37 | #include <linux/list.h> |
| 37 | #include <linux/random.h> | 38 | #include <linux/random.h> |
| 38 | #include <linux/nl80211.h> | 39 | #include <linux/nl80211.h> |
| @@ -324,7 +325,7 @@ struct reg_regdb_search_request { | |||
| 324 | }; | 325 | }; |
| 325 | 326 | ||
| 326 | static LIST_HEAD(reg_regdb_search_list); | 327 | static LIST_HEAD(reg_regdb_search_list); |
| 327 | static DEFINE_SPINLOCK(reg_regdb_search_lock); | 328 | static DEFINE_MUTEX(reg_regdb_search_mutex); |
| 328 | 329 | ||
| 329 | static void reg_regdb_search(struct work_struct *work) | 330 | static void reg_regdb_search(struct work_struct *work) |
| 330 | { | 331 | { |
| @@ -332,7 +333,7 @@ static void reg_regdb_search(struct work_struct *work) | |||
| 332 | const struct ieee80211_regdomain *curdom, *regdom; | 333 | const struct ieee80211_regdomain *curdom, *regdom; |
| 333 | int i, r; | 334 | int i, r; |
| 334 | 335 | ||
| 335 | spin_lock(®_regdb_search_lock); | 336 | mutex_lock(®_regdb_search_mutex); |
| 336 | while (!list_empty(®_regdb_search_list)) { | 337 | while (!list_empty(®_regdb_search_list)) { |
| 337 | request = list_first_entry(®_regdb_search_list, | 338 | request = list_first_entry(®_regdb_search_list, |
| 338 | struct reg_regdb_search_request, | 339 | struct reg_regdb_search_request, |
| @@ -346,18 +347,16 @@ static void reg_regdb_search(struct work_struct *work) | |||
| 346 | r = reg_copy_regd(®dom, curdom); | 347 | r = reg_copy_regd(®dom, curdom); |
| 347 | if (r) | 348 | if (r) |
| 348 | break; | 349 | break; |
| 349 | spin_unlock(®_regdb_search_lock); | ||
| 350 | mutex_lock(&cfg80211_mutex); | 350 | mutex_lock(&cfg80211_mutex); |
| 351 | set_regdom(regdom); | 351 | set_regdom(regdom); |
| 352 | mutex_unlock(&cfg80211_mutex); | 352 | mutex_unlock(&cfg80211_mutex); |
| 353 | spin_lock(®_regdb_search_lock); | ||
| 354 | break; | 353 | break; |
| 355 | } | 354 | } |
| 356 | } | 355 | } |
| 357 | 356 | ||
| 358 | kfree(request); | 357 | kfree(request); |
| 359 | } | 358 | } |
| 360 | spin_unlock(®_regdb_search_lock); | 359 | mutex_unlock(®_regdb_search_mutex); |
| 361 | } | 360 | } |
| 362 | 361 | ||
| 363 | static DECLARE_WORK(reg_regdb_work, reg_regdb_search); | 362 | static DECLARE_WORK(reg_regdb_work, reg_regdb_search); |
| @@ -375,9 +374,9 @@ static void reg_regdb_query(const char *alpha2) | |||
| 375 | 374 | ||
| 376 | memcpy(request->alpha2, alpha2, 2); | 375 | memcpy(request->alpha2, alpha2, 2); |
| 377 | 376 | ||
| 378 | spin_lock(®_regdb_search_lock); | 377 | mutex_lock(®_regdb_search_mutex); |
| 379 | list_add_tail(&request->list, ®_regdb_search_list); | 378 | list_add_tail(&request->list, ®_regdb_search_list); |
| 380 | spin_unlock(®_regdb_search_lock); | 379 | mutex_unlock(®_regdb_search_mutex); |
| 381 | 380 | ||
| 382 | schedule_work(®_regdb_work); | 381 | schedule_work(®_regdb_work); |
| 383 | } | 382 | } |
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 978cac3414b5..a026c6d56bd3 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | * Copyright 2008 Johannes Berg <johannes@sipsolutions.net> | 4 | * Copyright 2008 Johannes Berg <johannes@sipsolutions.net> |
| 5 | */ | 5 | */ |
| 6 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
| 7 | #include <linux/slab.h> | ||
| 7 | #include <linux/module.h> | 8 | #include <linux/module.h> |
| 8 | #include <linux/netdevice.h> | 9 | #include <linux/netdevice.h> |
| 9 | #include <linux/wireless.h> | 10 | #include <linux/wireless.h> |
diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 17fde0da1b08..f4dfd5f5f2ea 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | #include <linux/etherdevice.h> | 8 | #include <linux/etherdevice.h> |
| 9 | #include <linux/if_arp.h> | 9 | #include <linux/if_arp.h> |
| 10 | #include <linux/slab.h> | ||
| 10 | #include <linux/workqueue.h> | 11 | #include <linux/workqueue.h> |
| 11 | #include <linux/wireless.h> | 12 | #include <linux/wireless.h> |
| 12 | #include <net/iw_handler.h> | 13 | #include <net/iw_handler.h> |
diff --git a/net/wireless/util.c b/net/wireless/util.c index be2ab8c59e3a..d3574a4eb3ba 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | */ | 5 | */ |
| 6 | #include <linux/bitops.h> | 6 | #include <linux/bitops.h> |
| 7 | #include <linux/etherdevice.h> | 7 | #include <linux/etherdevice.h> |
| 8 | #include <linux/slab.h> | ||
| 8 | #include <net/cfg80211.h> | 9 | #include <net/cfg80211.h> |
| 9 | #include <net/ip.h> | 10 | #include <net/ip.h> |
| 10 | #include "core.h" | 11 | #include "core.h" |
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 9ab51838849e..a60a2773b497 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/nl80211.h> | 12 | #include <linux/nl80211.h> |
| 13 | #include <linux/if_arp.h> | 13 | #include <linux/if_arp.h> |
| 14 | #include <linux/etherdevice.h> | 14 | #include <linux/etherdevice.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | #include <net/iw_handler.h> | 16 | #include <net/iw_handler.h> |
| 16 | #include <net/cfg80211.h> | 17 | #include <net/cfg80211.h> |
| 17 | #include "wext-compat.h" | 18 | #include "wext-compat.h" |
diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c index 5e1656bdf23b..4f5a47091fde 100644 --- a/net/wireless/wext-core.c +++ b/net/wireless/wext-core.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
| 11 | #include <linux/netdevice.h> | 11 | #include <linux/netdevice.h> |
| 12 | #include <linux/rtnetlink.h> | 12 | #include <linux/rtnetlink.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <linux/wireless.h> | 14 | #include <linux/wireless.h> |
| 14 | #include <linux/uaccess.h> | 15 | #include <linux/uaccess.h> |
| 15 | #include <net/cfg80211.h> | 16 | #include <net/cfg80211.h> |
diff --git a/net/wireless/wext-priv.c b/net/wireless/wext-priv.c index a3c2277de9e5..3feb28e41c53 100644 --- a/net/wireless/wext-priv.c +++ b/net/wireless/wext-priv.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | * | 7 | * |
| 8 | * (As all part of the Linux kernel, this file is GPL) | 8 | * (As all part of the Linux kernel, this file is GPL) |
| 9 | */ | 9 | */ |
| 10 | #include <linux/slab.h> | ||
| 10 | #include <linux/wireless.h> | 11 | #include <linux/wireless.h> |
| 11 | #include <linux/netdevice.h> | 12 | #include <linux/netdevice.h> |
| 12 | #include <net/iw_handler.h> | 13 | #include <net/iw_handler.h> |
diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c index 5615a8802536..d5c6140f4cb8 100644 --- a/net/wireless/wext-sme.c +++ b/net/wireless/wext-sme.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | #include <linux/etherdevice.h> | 8 | #include <linux/etherdevice.h> |
| 9 | #include <linux/if_arp.h> | 9 | #include <linux/if_arp.h> |
| 10 | #include <linux/slab.h> | ||
| 10 | #include <net/cfg80211.h> | 11 | #include <net/cfg80211.h> |
| 11 | #include "wext-compat.h" | 12 | #include "wext-compat.h" |
| 12 | #include "nl80211.h" | 13 | #include "nl80211.h" |
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 9796f3ed1edb..36e84e13c6aa 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c | |||
| @@ -47,6 +47,7 @@ | |||
| 47 | #include <linux/netdevice.h> | 47 | #include <linux/netdevice.h> |
| 48 | #include <linux/if_arp.h> | 48 | #include <linux/if_arp.h> |
| 49 | #include <linux/skbuff.h> | 49 | #include <linux/skbuff.h> |
| 50 | #include <linux/slab.h> | ||
| 50 | #include <net/sock.h> | 51 | #include <net/sock.h> |
| 51 | #include <net/tcp_states.h> | 52 | #include <net/tcp_states.h> |
| 52 | #include <asm/uaccess.h> | 53 | #include <asm/uaccess.h> |
| @@ -82,6 +83,41 @@ struct compat_x25_subscrip_struct { | |||
| 82 | }; | 83 | }; |
| 83 | #endif | 84 | #endif |
| 84 | 85 | ||
| 86 | |||
| 87 | int x25_parse_address_block(struct sk_buff *skb, | ||
| 88 | struct x25_address *called_addr, | ||
| 89 | struct x25_address *calling_addr) | ||
| 90 | { | ||
| 91 | unsigned char len; | ||
| 92 | int needed; | ||
| 93 | int rc; | ||
| 94 | |||
| 95 | if (skb->len < 1) { | ||
| 96 | /* packet has no address block */ | ||
| 97 | rc = 0; | ||
| 98 | goto empty; | ||
| 99 | } | ||
| 100 | |||
| 101 | len = *skb->data; | ||
| 102 | needed = 1 + (len >> 4) + (len & 0x0f); | ||
| 103 | |||
| 104 | if (skb->len < needed) { | ||
| 105 | /* packet is too short to hold the addresses it claims | ||
| 106 | to hold */ | ||
| 107 | rc = -1; | ||
| 108 | goto empty; | ||
| 109 | } | ||
| 110 | |||
| 111 | return x25_addr_ntoa(skb->data, called_addr, calling_addr); | ||
| 112 | |||
| 113 | empty: | ||
| 114 | *called_addr->x25_addr = 0; | ||
| 115 | *calling_addr->x25_addr = 0; | ||
| 116 | |||
| 117 | return rc; | ||
| 118 | } | ||
| 119 | |||
| 120 | |||
| 85 | int x25_addr_ntoa(unsigned char *p, struct x25_address *called_addr, | 121 | int x25_addr_ntoa(unsigned char *p, struct x25_address *called_addr, |
| 86 | struct x25_address *calling_addr) | 122 | struct x25_address *calling_addr) |
| 87 | { | 123 | { |
| @@ -366,6 +402,7 @@ static void __x25_destroy_socket(struct sock *sk) | |||
| 366 | /* | 402 | /* |
| 367 | * Queue the unaccepted socket for death | 403 | * Queue the unaccepted socket for death |
| 368 | */ | 404 | */ |
| 405 | skb->sk->sk_state = TCP_LISTEN; | ||
| 369 | sock_set_flag(skb->sk, SOCK_DEAD); | 406 | sock_set_flag(skb->sk, SOCK_DEAD); |
| 370 | x25_start_heartbeat(skb->sk); | 407 | x25_start_heartbeat(skb->sk); |
| 371 | x25_sk(skb->sk)->state = X25_STATE_0; | 408 | x25_sk(skb->sk)->state = X25_STATE_0; |
| @@ -553,7 +590,8 @@ static int x25_create(struct net *net, struct socket *sock, int protocol, | |||
| 553 | x25->facilities.winsize_out = X25_DEFAULT_WINDOW_SIZE; | 590 | x25->facilities.winsize_out = X25_DEFAULT_WINDOW_SIZE; |
| 554 | x25->facilities.pacsize_in = X25_DEFAULT_PACKET_SIZE; | 591 | x25->facilities.pacsize_in = X25_DEFAULT_PACKET_SIZE; |
| 555 | x25->facilities.pacsize_out = X25_DEFAULT_PACKET_SIZE; | 592 | x25->facilities.pacsize_out = X25_DEFAULT_PACKET_SIZE; |
| 556 | x25->facilities.throughput = X25_DEFAULT_THROUGHPUT; | 593 | x25->facilities.throughput = 0; /* by default don't negotiate |
| 594 | throughput */ | ||
| 557 | x25->facilities.reverse = X25_DEFAULT_REVERSE; | 595 | x25->facilities.reverse = X25_DEFAULT_REVERSE; |
| 558 | x25->dte_facilities.calling_len = 0; | 596 | x25->dte_facilities.calling_len = 0; |
| 559 | x25->dte_facilities.called_len = 0; | 597 | x25->dte_facilities.called_len = 0; |
| @@ -921,16 +959,26 @@ int x25_rx_call_request(struct sk_buff *skb, struct x25_neigh *nb, | |||
| 921 | /* | 959 | /* |
| 922 | * Extract the X.25 addresses and convert them to ASCII strings, | 960 | * Extract the X.25 addresses and convert them to ASCII strings, |
| 923 | * and remove them. | 961 | * and remove them. |
| 962 | * | ||
| 963 | * Address block is mandatory in call request packets | ||
| 924 | */ | 964 | */ |
| 925 | addr_len = x25_addr_ntoa(skb->data, &source_addr, &dest_addr); | 965 | addr_len = x25_parse_address_block(skb, &source_addr, &dest_addr); |
| 966 | if (addr_len <= 0) | ||
| 967 | goto out_clear_request; | ||
| 926 | skb_pull(skb, addr_len); | 968 | skb_pull(skb, addr_len); |
| 927 | 969 | ||
| 928 | /* | 970 | /* |
| 929 | * Get the length of the facilities, skip past them for the moment | 971 | * Get the length of the facilities, skip past them for the moment |
| 930 | * get the call user data because this is needed to determine | 972 | * get the call user data because this is needed to determine |
| 931 | * the correct listener | 973 | * the correct listener |
| 974 | * | ||
| 975 | * Facilities length is mandatory in call request packets | ||
| 932 | */ | 976 | */ |
| 977 | if (skb->len < 1) | ||
| 978 | goto out_clear_request; | ||
| 933 | len = skb->data[0] + 1; | 979 | len = skb->data[0] + 1; |
| 980 | if (skb->len < len) | ||
| 981 | goto out_clear_request; | ||
| 934 | skb_pull(skb,len); | 982 | skb_pull(skb,len); |
| 935 | 983 | ||
| 936 | /* | 984 | /* |
| @@ -1414,9 +1462,20 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
| 1414 | if (facilities.winsize_in < 1 || | 1462 | if (facilities.winsize_in < 1 || |
| 1415 | facilities.winsize_in > 127) | 1463 | facilities.winsize_in > 127) |
| 1416 | break; | 1464 | break; |
| 1417 | if (facilities.throughput < 0x03 || | 1465 | if (facilities.throughput) { |
| 1418 | facilities.throughput > 0xDD) | 1466 | int out = facilities.throughput & 0xf0; |
| 1419 | break; | 1467 | int in = facilities.throughput & 0x0f; |
| 1468 | if (!out) | ||
| 1469 | facilities.throughput |= | ||
| 1470 | X25_DEFAULT_THROUGHPUT << 4; | ||
| 1471 | else if (out < 0x30 || out > 0xD0) | ||
| 1472 | break; | ||
| 1473 | if (!in) | ||
| 1474 | facilities.throughput |= | ||
| 1475 | X25_DEFAULT_THROUGHPUT; | ||
| 1476 | else if (in < 0x03 || in > 0x0D) | ||
| 1477 | break; | ||
| 1478 | } | ||
| 1420 | if (facilities.reverse && | 1479 | if (facilities.reverse && |
| 1421 | (facilities.reverse & 0x81) != 0x81) | 1480 | (facilities.reverse & 0x81) != 0x81) |
| 1422 | break; | 1481 | break; |
diff --git a/net/x25/x25_dev.c b/net/x25/x25_dev.c index 3e1efe534645..b9ef682230a0 100644 --- a/net/x25/x25_dev.c +++ b/net/x25/x25_dev.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
| 21 | #include <linux/netdevice.h> | 21 | #include <linux/netdevice.h> |
| 22 | #include <linux/skbuff.h> | 22 | #include <linux/skbuff.h> |
| 23 | #include <linux/slab.h> | ||
| 23 | #include <net/sock.h> | 24 | #include <net/sock.h> |
| 24 | #include <linux/if_arp.h> | 25 | #include <linux/if_arp.h> |
| 25 | #include <net/x25.h> | 26 | #include <net/x25.h> |
| @@ -53,7 +54,7 @@ static int x25_receive_data(struct sk_buff *skb, struct x25_neigh *nb) | |||
| 53 | if (!sock_owned_by_user(sk)) { | 54 | if (!sock_owned_by_user(sk)) { |
| 54 | queued = x25_process_rx_frame(sk, skb); | 55 | queued = x25_process_rx_frame(sk, skb); |
| 55 | } else { | 56 | } else { |
| 56 | sk_add_backlog(sk, skb); | 57 | queued = !sk_add_backlog(sk, skb); |
| 57 | } | 58 | } |
| 58 | bh_unlock_sock(sk); | 59 | bh_unlock_sock(sk); |
| 59 | sock_put(sk); | 60 | sock_put(sk); |
diff --git a/net/x25/x25_facilities.c b/net/x25/x25_facilities.c index a21f6646eb3a..771bab00754b 100644 --- a/net/x25/x25_facilities.c +++ b/net/x25/x25_facilities.c | |||
| @@ -35,7 +35,7 @@ int x25_parse_facilities(struct sk_buff *skb, struct x25_facilities *facilities, | |||
| 35 | struct x25_dte_facilities *dte_facs, unsigned long *vc_fac_mask) | 35 | struct x25_dte_facilities *dte_facs, unsigned long *vc_fac_mask) |
| 36 | { | 36 | { |
| 37 | unsigned char *p = skb->data; | 37 | unsigned char *p = skb->data; |
| 38 | unsigned int len = *p++; | 38 | unsigned int len; |
| 39 | 39 | ||
| 40 | *vc_fac_mask = 0; | 40 | *vc_fac_mask = 0; |
| 41 | 41 | ||
| @@ -50,6 +50,14 @@ int x25_parse_facilities(struct sk_buff *skb, struct x25_facilities *facilities, | |||
| 50 | memset(dte_facs->called_ae, '\0', sizeof(dte_facs->called_ae)); | 50 | memset(dte_facs->called_ae, '\0', sizeof(dte_facs->called_ae)); |
| 51 | memset(dte_facs->calling_ae, '\0', sizeof(dte_facs->calling_ae)); | 51 | memset(dte_facs->calling_ae, '\0', sizeof(dte_facs->calling_ae)); |
| 52 | 52 | ||
| 53 | if (skb->len < 1) | ||
| 54 | return 0; | ||
| 55 | |||
| 56 | len = *p++; | ||
| 57 | |||
| 58 | if (len >= skb->len) | ||
| 59 | return -1; | ||
| 60 | |||
| 53 | while (len > 0) { | 61 | while (len > 0) { |
| 54 | switch (*p & X25_FAC_CLASS_MASK) { | 62 | switch (*p & X25_FAC_CLASS_MASK) { |
| 55 | case X25_FAC_CLASS_A: | 63 | case X25_FAC_CLASS_A: |
| @@ -247,6 +255,8 @@ int x25_negotiate_facilities(struct sk_buff *skb, struct sock *sk, | |||
| 247 | memcpy(new, ours, sizeof(*new)); | 255 | memcpy(new, ours, sizeof(*new)); |
| 248 | 256 | ||
| 249 | len = x25_parse_facilities(skb, &theirs, dte, &x25->vc_facil_mask); | 257 | len = x25_parse_facilities(skb, &theirs, dte, &x25->vc_facil_mask); |
| 258 | if (len < 0) | ||
| 259 | return len; | ||
| 250 | 260 | ||
| 251 | /* | 261 | /* |
| 252 | * They want reverse charging, we won't accept it. | 262 | * They want reverse charging, we won't accept it. |
| @@ -259,9 +269,18 @@ int x25_negotiate_facilities(struct sk_buff *skb, struct sock *sk, | |||
| 259 | new->reverse = theirs.reverse; | 269 | new->reverse = theirs.reverse; |
| 260 | 270 | ||
| 261 | if (theirs.throughput) { | 271 | if (theirs.throughput) { |
| 262 | if (theirs.throughput < ours->throughput) { | 272 | int theirs_in = theirs.throughput & 0x0f; |
| 263 | SOCK_DEBUG(sk, "X.25: throughput negotiated down\n"); | 273 | int theirs_out = theirs.throughput & 0xf0; |
| 264 | new->throughput = theirs.throughput; | 274 | int ours_in = ours->throughput & 0x0f; |
| 275 | int ours_out = ours->throughput & 0xf0; | ||
| 276 | if (!ours_in || theirs_in < ours_in) { | ||
| 277 | SOCK_DEBUG(sk, "X.25: inbound throughput negotiated\n"); | ||
| 278 | new->throughput = (new->throughput & 0xf0) | theirs_in; | ||
| 279 | } | ||
| 280 | if (!ours_out || theirs_out < ours_out) { | ||
| 281 | SOCK_DEBUG(sk, | ||
| 282 | "X.25: outbound throughput negotiated\n"); | ||
| 283 | new->throughput = (new->throughput & 0x0f) | theirs_out; | ||
| 265 | } | 284 | } |
| 266 | } | 285 | } |
| 267 | 286 | ||
diff --git a/net/x25/x25_forward.c b/net/x25/x25_forward.c index 056a55f3a871..25a810793968 100644 --- a/net/x25/x25_forward.c +++ b/net/x25/x25_forward.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | #include <linux/if_arp.h> | 11 | #include <linux/if_arp.h> |
| 12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <net/x25.h> | 14 | #include <net/x25.h> |
| 14 | 15 | ||
| 15 | LIST_HEAD(x25_forward_list); | 16 | LIST_HEAD(x25_forward_list); |
diff --git a/net/x25/x25_in.c b/net/x25/x25_in.c index 96d922783547..372ac226e648 100644 --- a/net/x25/x25_in.c +++ b/net/x25/x25_in.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | * i-frames. | 23 | * i-frames. |
| 24 | */ | 24 | */ |
| 25 | 25 | ||
| 26 | #include <linux/slab.h> | ||
| 26 | #include <linux/errno.h> | 27 | #include <linux/errno.h> |
| 27 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
| 28 | #include <linux/string.h> | 29 | #include <linux/string.h> |
| @@ -89,6 +90,7 @@ static int x25_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more) | |||
| 89 | static int x25_state1_machine(struct sock *sk, struct sk_buff *skb, int frametype) | 90 | static int x25_state1_machine(struct sock *sk, struct sk_buff *skb, int frametype) |
| 90 | { | 91 | { |
| 91 | struct x25_address source_addr, dest_addr; | 92 | struct x25_address source_addr, dest_addr; |
| 93 | int len; | ||
| 92 | 94 | ||
| 93 | switch (frametype) { | 95 | switch (frametype) { |
| 94 | case X25_CALL_ACCEPTED: { | 96 | case X25_CALL_ACCEPTED: { |
| @@ -106,11 +108,17 @@ static int x25_state1_machine(struct sock *sk, struct sk_buff *skb, int frametyp | |||
| 106 | * Parse the data in the frame. | 108 | * Parse the data in the frame. |
| 107 | */ | 109 | */ |
| 108 | skb_pull(skb, X25_STD_MIN_LEN); | 110 | skb_pull(skb, X25_STD_MIN_LEN); |
| 109 | skb_pull(skb, x25_addr_ntoa(skb->data, &source_addr, &dest_addr)); | 111 | |
| 110 | skb_pull(skb, | 112 | len = x25_parse_address_block(skb, &source_addr, |
| 111 | x25_parse_facilities(skb, &x25->facilities, | 113 | &dest_addr); |
| 114 | if (len > 0) | ||
| 115 | skb_pull(skb, len); | ||
| 116 | |||
| 117 | len = x25_parse_facilities(skb, &x25->facilities, | ||
| 112 | &x25->dte_facilities, | 118 | &x25->dte_facilities, |
| 113 | &x25->vc_facil_mask)); | 119 | &x25->vc_facil_mask); |
| 120 | if (len > 0) | ||
| 121 | skb_pull(skb, len); | ||
| 114 | /* | 122 | /* |
| 115 | * Copy any Call User Data. | 123 | * Copy any Call User Data. |
| 116 | */ | 124 | */ |
diff --git a/net/x25/x25_link.c b/net/x25/x25_link.c index e4e1b6e49538..73e7b954ad28 100644 --- a/net/x25/x25_link.c +++ b/net/x25/x25_link.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
| 25 | #include <linux/jiffies.h> | 25 | #include <linux/jiffies.h> |
| 26 | #include <linux/timer.h> | 26 | #include <linux/timer.h> |
| 27 | #include <linux/slab.h> | ||
| 27 | #include <linux/netdevice.h> | 28 | #include <linux/netdevice.h> |
| 28 | #include <linux/skbuff.h> | 29 | #include <linux/skbuff.h> |
| 29 | #include <asm/uaccess.h> | 30 | #include <asm/uaccess.h> |
diff --git a/net/x25/x25_out.c b/net/x25/x25_out.c index 2b96b52114d6..52351a26b6fc 100644 --- a/net/x25/x25_out.c +++ b/net/x25/x25_out.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | * needed cleaned seq-number fields. | 22 | * needed cleaned seq-number fields. |
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | #include <linux/slab.h> | ||
| 25 | #include <linux/socket.h> | 26 | #include <linux/socket.h> |
| 26 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
| 27 | #include <linux/string.h> | 28 | #include <linux/string.h> |
diff --git a/net/x25/x25_route.c b/net/x25/x25_route.c index b95fae9ab393..97d77c532d8c 100644 --- a/net/x25/x25_route.c +++ b/net/x25/x25_route.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | #include <linux/if_arp.h> | 20 | #include <linux/if_arp.h> |
| 21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | #include <net/x25.h> | 23 | #include <net/x25.h> |
| 23 | 24 | ||
| 24 | LIST_HEAD(x25_route_list); | 25 | LIST_HEAD(x25_route_list); |
diff --git a/net/x25/x25_subr.c b/net/x25/x25_subr.c index 352b32d216fc..dc20cf12f39b 100644 --- a/net/x25/x25_subr.c +++ b/net/x25/x25_subr.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | * restriction on response. | 23 | * restriction on response. |
| 24 | */ | 24 | */ |
| 25 | 25 | ||
| 26 | #include <linux/slab.h> | ||
| 26 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
| 27 | #include <linux/string.h> | 28 | #include <linux/string.h> |
| 28 | #include <linux/skbuff.h> | 29 | #include <linux/skbuff.h> |
diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c index 0fc5ff66d1fa..fc91ad7ee26e 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ipcomp.c | |||
| @@ -17,11 +17,11 @@ | |||
| 17 | 17 | ||
| 18 | #include <linux/crypto.h> | 18 | #include <linux/crypto.h> |
| 19 | #include <linux/err.h> | 19 | #include <linux/err.h> |
| 20 | #include <linux/gfp.h> | ||
| 21 | #include <linux/list.h> | 20 | #include <linux/list.h> |
| 22 | #include <linux/module.h> | 21 | #include <linux/module.h> |
| 23 | #include <linux/mutex.h> | 22 | #include <linux/mutex.h> |
| 24 | #include <linux/percpu.h> | 23 | #include <linux/percpu.h> |
| 24 | #include <linux/slab.h> | ||
| 25 | #include <linux/smp.h> | 25 | #include <linux/smp.h> |
| 26 | #include <linux/vmalloc.h> | 26 | #include <linux/vmalloc.h> |
| 27 | #include <net/ip.h> | 27 | #include <net/ip.h> |
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c index b9fe13138c07..6a329158bdfa 100644 --- a/net/xfrm/xfrm_output.c +++ b/net/xfrm/xfrm_output.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/netdevice.h> | 14 | #include <linux/netdevice.h> |
| 15 | #include <linux/netfilter.h> | 15 | #include <linux/netfilter.h> |
| 16 | #include <linux/skbuff.h> | 16 | #include <linux/skbuff.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | #include <linux/spinlock.h> | 18 | #include <linux/spinlock.h> |
| 18 | #include <net/dst.h> | 19 | #include <net/dst.h> |
| 19 | #include <net/xfrm.h> | 20 | #include <net/xfrm.h> |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 34a5ef8316e7..843e066649cb 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
| @@ -1372,7 +1372,8 @@ static inline int xfrm_init_path(struct xfrm_dst *path, struct dst_entry *dst, | |||
| 1372 | return err; | 1372 | return err; |
| 1373 | } | 1373 | } |
| 1374 | 1374 | ||
| 1375 | static inline int xfrm_fill_dst(struct xfrm_dst *xdst, struct net_device *dev) | 1375 | static inline int xfrm_fill_dst(struct xfrm_dst *xdst, struct net_device *dev, |
| 1376 | struct flowi *fl) | ||
| 1376 | { | 1377 | { |
| 1377 | struct xfrm_policy_afinfo *afinfo = | 1378 | struct xfrm_policy_afinfo *afinfo = |
| 1378 | xfrm_policy_get_afinfo(xdst->u.dst.ops->family); | 1379 | xfrm_policy_get_afinfo(xdst->u.dst.ops->family); |
| @@ -1381,7 +1382,7 @@ static inline int xfrm_fill_dst(struct xfrm_dst *xdst, struct net_device *dev) | |||
| 1381 | if (!afinfo) | 1382 | if (!afinfo) |
| 1382 | return -EINVAL; | 1383 | return -EINVAL; |
| 1383 | 1384 | ||
| 1384 | err = afinfo->fill_dst(xdst, dev); | 1385 | err = afinfo->fill_dst(xdst, dev, fl); |
| 1385 | 1386 | ||
| 1386 | xfrm_policy_put_afinfo(afinfo); | 1387 | xfrm_policy_put_afinfo(afinfo); |
| 1387 | 1388 | ||
| @@ -1486,7 +1487,7 @@ static struct dst_entry *xfrm_bundle_create(struct xfrm_policy *policy, | |||
| 1486 | for (dst_prev = dst0; dst_prev != dst; dst_prev = dst_prev->child) { | 1487 | for (dst_prev = dst0; dst_prev != dst; dst_prev = dst_prev->child) { |
| 1487 | struct xfrm_dst *xdst = (struct xfrm_dst *)dst_prev; | 1488 | struct xfrm_dst *xdst = (struct xfrm_dst *)dst_prev; |
| 1488 | 1489 | ||
| 1489 | err = xfrm_fill_dst(xdst, dev); | 1490 | err = xfrm_fill_dst(xdst, dev, fl); |
| 1490 | if (err) | 1491 | if (err) |
| 1491 | goto free_dst; | 1492 | goto free_dst; |
| 1492 | 1493 | ||
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 17d5b96f2fc8..add77ecb8ac4 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/audit.h> | 22 | #include <linux/audit.h> |
| 23 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
| 24 | #include <linux/ktime.h> | 24 | #include <linux/ktime.h> |
| 25 | #include <linux/slab.h> | ||
| 25 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
| 26 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
| 27 | 28 | ||
diff --git a/net/xfrm/xfrm_sysctl.c b/net/xfrm/xfrm_sysctl.c index 2c4d6cdcba49..05640bc9594b 100644 --- a/net/xfrm/xfrm_sysctl.c +++ b/net/xfrm/xfrm_sysctl.c | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | #include <linux/sysctl.h> | 1 | #include <linux/sysctl.h> |
| 2 | #include <linux/slab.h> | ||
| 2 | #include <net/net_namespace.h> | 3 | #include <net/net_namespace.h> |
| 3 | #include <net/xfrm.h> | 4 | #include <net/xfrm.h> |
| 4 | 5 | ||
