summaryrefslogtreecommitdiffstats
path: root/include/linux
Commit message (Collapse)AuthorAgeFilesLines
* [XFRM]: alg_key_len should be unsigned to avoid integer dividesEric Dumazet2008-01-291-1/+1
| | | | | | | | | | alg_key_len is currently defined as 'signed int'. This unfortunatly leads to integer divides in several paths. Converting it to unsigned is safe and saves 208 bytes of text on i386. Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [ATM]: Oops reading net/atm/arpDenis V. Lunev2008-01-291-0/+2
| | | | | | | | | | | | | | cat /proc/net/atm/arp causes the NULL pointer dereference in the get_proc_net+0xc/0x3a. This happens as proc_get_net believes that the parent proc dir entry contains struct net. Fix this assumption for "net/atm" case. The problem is introduced by the commit c0097b07abf5f92ab135d024dd41bd2aada1512f from Eric W. Biederman/Daniel Lezcano. Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETFILTER]: Use the ctl paths instead of hand-made analoguePavel Emelyanov2008-01-291-6/+2Star
| | | | | | | | | | | | | | | | | | The conntracks subsystem has a similar infrastructure to maintain ctl_paths, but since we already have it on the generic level, I think it's OK to switch to using it. So, basically, this patch just replaces the ctl_table-s with ctl_path-s, nf_register_sysctl_table with register_sysctl_paths() and removes no longer needed code. After this the net/netfilter/nf_sysctl.c file contains the paths only. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* [VLAN]: Avoid expensive dividesEric Dumazet2008-01-291-2/+4
| | | | | | | | | We can avoid divides (as seen with CONFIG_CC_OPTIMIZE_FOR_SIZE=y on x86) changing vlan_group_get_device()/vlan_group_set_device() id parameter from signed to unsigned. Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* mac80211: A-MPDU Rx adding basic functionalityRon Rindjunsky2008-01-291-0/+7
| | | | | | | | | | | | | | | | This patch adds the basic needed abilities and functions for A-MPDU Rx session changed functions: - ieee80211_sta_process_addba_request - Rx A-MPDU initialization enabled - ieee80211_stop - stops all A-MPDU Rx in case interface goes down added functions: - ieee80211_send_delba - used for sending out Del BA in A-MPDU sessions - ieee80211_sta_stop_rx_BA_session - stopping Rx A-MPDU session - sta_rx_agg_session_timer_expired - stops A-MPDU Rx use if load is too low Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [CONNECTOR]: Cleanup struct cn_callback_entryLi Zefan2008-01-291-3/+1Star
| | | | | | | | | | | | | | | - 'cb' is a fake struct member. In a previous patch struct cn_callback was renamed to cn_callback_id, so 'cb' should have been deleted at that time. - 'nls' isn't used and is redundant, we can retrieve this data through cn_callback_entry.pdev->nls. - 'seq' and 'group' should be u32, as they are declared to be u32 in other places. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [CONNECTOR]: Cleanup struct cn_queue_devLi Zefan2008-01-291-1/+0Star
| | | | | | | | Struct member netlink_groups is never used, and I don't see how it can be useful. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [LIB] pcounter : unline too big functionsEric Dumazet2008-01-291-54/+26Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | Before pushing pcounter to Linus tree, I would like to make some adjustments. Goal is to reduce kernel text size, by unlining too big functions. When a pcounter is bound to a statically defined per_cpu variable, we define two small helpers functions. (No more folding function using the fat for_each_possible_cpu(cpu) ... ) static DEFINE_PER_CPU(int, NAME##_pcounter_values); static void NAME##_pcounter_add(struct pcounter *self, int val) { __get_cpu_var(NAME##_pcounter_values) += val; } static int NAME##_pcounter_getval(const struct pcounter *self, int cpu) { return per_cpu(NAME##_pcounter_values, cpu); } Fast path is therefore unchanged, while folding/alloc/free is now unlined. This saves 228 bytes on i386 Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [SHAPER]: The scheduled shaper removal.Adrian Bunk2008-01-292-52/+0Star
| | | | | | | | This patch contains the scheduled removal of the shaper driver. Signed-off-by: Adrian Bunk <bunk@kernel.org> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [ATM]: [br2864] whitespace cleanupChas Williams2008-01-291-22/+21Star
| | | | | Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil> Signed-off-by: David S. Miller <davem@davemloft.net>
* [ATM]: [br2864] routed supportEric Kinzie2008-01-291-1/+17
| | | | | Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil> Signed-off-by: David S. Miller <davem@davemloft.net>
* [ATM]: Convert struct class_device to struct deviceKay Sievers2008-01-291-2/+2
| | | | | | Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>
* [ETH]: Combine format_addr() with print_mac().Michael Chan2008-01-291-3/+5
| | | | | | | | | | | | | | | | | | | print_mac() used many most net drivers and format_addr() used by net-sysfs.c are very similar and they can be intergrated. format_addr() is also identically redefined in the qla4xxx iscsi driver. Export a new function sysfs_format_mac() to be used by net-sysfs, qla4xxx and others in the future. Both print_mac() and sysfs_format_mac() call _format_mac_addr() to do the formatting. Changed print_mac() to use unsigned char * to be consistent with net_device struct's dev_addr. Added buffer length overrun checking as suggested by Joe Perches. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cfg80211/nl80211: implement station attribute retrievalJohannes Berg2008-01-281-0/+28
| | | | | | | | | | | After a station is added to the kernel's structures, userspace has to be able to retrieve statistics about that station, especially whether the station was idle and how much bytes were transferred to and from it. This adds the necessary code to nl80211. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cfg80211/nl80211: station handlingJohannes Berg2008-01-281-0/+68
| | | | | | | | This patch adds station handling to cfg80211/nl80211. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cfg80211/nl80211: add beacon settingsJohannes Berg2008-01-281-0/+24
| | | | | | | | | This adds the necessary API to cfg80211/nl80211 to allow changing beaconing settings. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cfg80211/nl80211: introduce key handlingJohannes Berg2008-01-281-0/+34
| | | | | | | | | | This introduces key handling to cfg80211/nl80211. Default and group keys can be added, changed and removed; sequence counters for each key can be retrieved. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [XFRM]: Define packet dropping statistics.Masahide NAKAMURA2008-01-281-0/+31
| | | | | | | | | | | | This statistics is shown factor dropped by transformation at /proc/net/xfrm_stat for developer. It is a counter designed from current transformation source code and defined as linux private MIB. See Documentation/networking/xfrm_proc.txt for the detail. Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETFILTER]: xt_connlimit: use the new union nf_inet_addrJan Engelhardt2008-01-281-2/+7
| | | | | | Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETFILTER]: Introduce nf_inet_addressJan Engelhardt2008-01-282-3/+9
| | | | | | | | | | | | A few netfilter modules provide their own union of IPv4 and IPv6 address storage. Will unify that in this patch series. (1/4): Rename union nf_conntrack_address to union nf_inet_addr and move it to x_tables.h. Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETFILTER]: nf_nat: properly use RCU for ip_nat_decode_sessionPatrick McHardy2008-01-281-3/+8
| | | | | | | | We need to use rcu_assign_pointer/rcu_dereference to avoid races. Also remove an obsolete CONFIG_IP_NAT_NEEDED ifdef. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETFILTER]: constify nf_afinfoPatrick McHardy2008-01-281-5/+5
| | | | | Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETFILTER]: Kill function prototype for non-existing functionPatrick McHardy2008-01-281-3/+0Star
| | | | | Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETFILTER]: nfnetlink_log: include GID in netlink messagePatrick McHardy2008-01-281-0/+1
| | | | | | | | Similar to Maciej Soltysiak's ipt_LOG patch, include GID in addition to UID in netlink message. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETFILTER]: nf_log: move logging stuff to seperate headerPatrick McHardy2008-01-281-55/+0Star
| | | | | Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETFILTER]: ctnetlink: add support for secmarkPablo Neira Ayuso2008-01-282-0/+5
| | | | | | | | This patch adds support for James Morris' connsecmark. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETFILTER]: ctnetlink: add support for NAT sequence adjustmentsPablo Neira Ayuso2008-01-282-0/+14
| | | | | | | | | | | | | The combination of NAT and helpers may produce TCP sequence adjustments. In failover setups, this information needs to be replicated in order to achieve a successful recovery of mangled, related connections. This patch is particularly useful for conntrackd, see: http://people.netfilter.org/pablo/conntrack-tools/ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETFILTER]: arp_tables: add compat supportPatrick McHardy2008-01-281-0/+31
| | | | | Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETFILTER]: arp_tables: use XT_ALIGNPatrick McHardy2008-01-281-1/+1
| | | | | Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETFILTER]: ip6_tables: use XT_ALIGNPatrick McHardy2008-01-281-1/+1
| | | | | Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETFILTER]: ip6_tables: add compat supportPatrick McHardy2008-01-281-0/+35
| | | | | Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETFILTER]: ip_tables: move compat offset calculation to x_tablesPatrick McHardy2008-01-281-0/+4
| | | | | | | Its needed by ip6_tables and arp_tables as well. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETFILTER]: ip_tables: fix compat typesPatrick McHardy2008-01-281-5/+20
| | | | | | | | | Use compat types and compat iterators when dealing with compat entries for clarity. This doesn't actually make a difference for ip_tables, but is needed for ip6_tables and arp_tables. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETFILTER]: {ip,ip6,arp}_tables: consolidate iterator macrosPatrick McHardy2008-01-284-96/+55Star
| | | | | Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETFILTER]: x_tables: make xt_compat_match_from_user usable in iterator macrosPatrick McHardy2008-01-281-2/+2
| | | | | | | | Make xt_compat_match_from_user return an int to make it usable in the *tables iterator macros and kill a now unnecessary wrapper function. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* introduce WEXT scan capabilitiesDan Williams2008-01-281-0/+13
| | | | | | | | | | | | | | | | Introduce scan capabilities to WEXT so that userspace can do intelligent things with scan behavior such as handling hidden SSIDs more gracefully. If the driver reports a specific scan capability, the driver must respect the options specified in the iw_scan_req structure when handling the SIOCSIWSCAN call, unless it's mode or state does not allow it to do so, in which case it must return an error. This version switches to Dave Kilroy's suggestion of claiming unused padding space for the scan_capa field. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [IPV4]: Remove unused IPV4TYPE macrosJoe Perches2008-01-281-14/+0Star
| | | | | Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [IPV4]: Create ipv4_is_<type>(__be32 addr) functionsJoe Perches2008-01-281-13/+74
| | | | | | | | | | | | | | | | Change IPV4 specific macros LOOPBACK MULTICAST LOCAL_MCAST BADCLASS and ZERONET macros to inline functions ipv4_is_<type>(__be32 addr) Adds type safety and arguably some readability. Changes since last submission: Removed ipv4_addr_octets function Used hex constants Converted recently added rfc3330 macros Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [IPV4]: Switch users of ipv4_devconf(_all) to use the pernet onePavel Emelyanov2008-01-281-4/+8
| | | | | | | | | | These are scattered over the code, but almost all the "critical" places already have the proper struct net at hand except for snmp proc showing function and routing rtnl handler. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* [DCCP]: Handle timestamps on Request/Response exchange separatelyGerrit Renker2008-01-281-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In DCCP, timestamps can occur on packets anytime, CCID3 uses a timestamp(/echo) on the Request/Response exchange. This patch addresses the following situation: * timestamps are recorded on the listening socket; * Responses are sent from dccp_request_sockets; * suppose two connections reach the listening socket with very small time in between: * the first timestamp value gets overwritten by the second connection request. This is not really good, so this patch separates timestamps into * those which are received by the server during the initial handshake (on dccp_request_sock); * those which are received by the client or the client after connection establishment. As before, a timestamp of 0 is regarded as indicating that no (meaningful) timestamp has been received (in addition, a warning message is printed if hosts send 0-valued timestamps). The timestamp-echoing now works as follows: * when a timestamp is present on the initial Request, it is placed into dreq, due to the call to dccp_parse_options in dccp_v{4,6}_conn_request; * when a timestamp is present on the Ack leading from RESPOND => OPEN, it is copied over from the request_sock into the child cocket in dccp_create_openreq_child; * timestamps received on an (established) dccp_sock are treated as before. Since Elapsed Time is measured in hundredths of milliseconds (13.2), the new dccp_timestamp() function is used, as it is expected that the time between receiving the timestamp and sending the timestamp echo will be very small against the wrap-around time. As a byproduct, this allows smaller timestamping-time fields. Furthermore, inserting the Timestamp Echo option has been taken out of the block starting with '!dccp_packet_without_ack()', since Timestamp Echo can be carried on any packet (5.8 and 13.3). Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [DCCP]: Allow to parse options on Request SocketsGerrit Renker2008-01-281-2/+3
| | | | | | | | | | | | | | | | The option parsing code currently only parses on full sk's. This causes a problem for options sent during the initial handshake (in particular timestamps and feature-negotiation options). Therefore, this patch extends the option parsing code with an additional argument for request_socks: if it is non-NULL, options are parsed on the request socket, otherwise the normal path (parsing on the sk) is used. Subsequent patches, which implement feature negotiation during connection setup, make use of this facility. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [DCCP]: Support for server holding timewait stateGerrit Renker2008-01-281-0/+3
| | | | | | | | | | | | | | | | This adds a socket option and signalling support for the case where the server holds timewait state on closing the connection, as described in RFC 4340, 8.3. Since holding timewait state at the server is the non-usual case, it is enabled via a socket option. Documentation for this socket option has been added. The setsockopt statement has been made resilient against different possible cases of expressing boolean `true' values using a suggestion by Ian McDonald. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [IPSEC]: Add ICMP host relookup supportHerbert Xu2008-01-281-0/+3
| | | | | | | | | | | | | | | RFC 4301 requires us to relookup ICMP traffic that does not match any policies using the reverse of its payload. This patch implements this for ICMP traffic that originates from or terminates on localhost. This is activated on outbound with the new policy flag XFRM_POLICY_ICMP, and on inbound by the new state flag XFRM_STATE_ICMP. On inbound the policy check is now performed by the ICMP protocol so that it can repeat the policy check where necessary. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
* [IPSEC]: Added xfrm_decode_session_reverse and xfrmX_policy_check_reverseHerbert Xu2008-01-281-0/+1
| | | | | | | | | | RFC 4301 requires us to relookup ICMP traffic that does not match any policies using the reverse of its payload. This patch adds the functions xfrm_decode_session_reverse and xfrmX_policy_check_reverse so we can get the reverse flow to perform such a lookup. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
* [IPV4]: Cleanup IN_DEV_MFORWARD macroPavel Emelyanov2008-01-281-3/+1Star
| | | | | | | This is essentially IN_DEV_ANDCONF with proper arguments. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NET] sysctl: make sysctl_somaxconn per-namespacePavel Emelyanov2008-01-281-1/+0Star
| | | | | | | | | | | | Just move the variable on the struct net and adjust its usage. Others sysctls from sys.net.core table are more difficult to virtualize (i.e. make them per-namespace), but I'll look at them as well a bit later. Signed-off-by: Pavel Emelyanov <xemul@oenvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NETLINK]: Mark attribute construction exception unlikelyPatrick McHardy2008-01-281-1/+1
| | | | | Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* [UDP]: Only increment counter on first peek/recvHerbert Xu2008-01-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | The previous move of the the UDP inDatagrams counter caused each peek of the same packet to be counted separately. This may be undesirable. This patch fixes this by adding a bit to sk_buff to record whether this packet has already been seen through skb_recv_datagram. We then only increment the counter when the packet is seen for the first time. The only dodgy part is the fact that skb_recv_datagram doesn't have a good way of returning this new bit of information. So I've added a new function __skb_recv_datagram that does return this and made skb_recv_datagram a wrapper around it. The plan is to eventually replace all uses of skb_recv_datagram with this new function at which time it can be renamed its proper name. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
* [UDP]: Avoid repeated counting of checksum errors due to peekingHerbert Xu2008-01-281-1/+1
| | | | | | | | | | | | Currently it is possible for two processes to peek on the same socket and end up incrementing the error counter twice for the same packet. This patch fixes it by making skb_kill_datagram return whether it succeeded in unlinking the packet and only incrementing the counter if it did. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
* [INET]: Merge sys.net.ipv4.ip_forward and sys.net.ipv4.conf.all.forwardingPavel Emelyanov2008-01-281-1/+0Star
| | | | | | | | | | | | | | | AFAIS these two entries should do the same thing - change the forwarding state on ipv4_devconf and on all the devices. I propose to merge the handlers together using ctl paths. The inet_forward_change() is static after this and I move it higher to be closer to other "propagation" helpers and to avoid diff making patches based on { and } matching :) i.e. - make them easier to read. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>