14 May, 2011
3 commits
-
-Wunused-but-set-variable generates compile warnings. The affected
variables are removed.Signed-off-by: Ursula Braun
Signed-off-by: Frank Blaschka
Signed-off-by: David S. Miller -
-Wunused-but-set-variable generates a compile warning. The affected
variable is removed.Signed-off-by: Ursula Braun
Signed-off-by: Frank Blaschka
Signed-off-by: David S. Miller -
Added code to take FW dump via ethtool. Dump level can be controlled via setting the
dump flag. A get function is provided to query the current setting of the dump flag.
Dump data is obtained from the driver via a separate get function.Changes from v3:
Fixed buffer length issue in ethtool_get_dump_data function.
Updated kernel doc for ethtool_dump struct and get_dump_flag function.Changes from v2:
Provided separate commands for get flag and data.
Check for minimum of the two buffer length obtained via ethtool and driver and
use that for dump buffer
Pass up the driver return error codes up to the caller.
Added kernel doc comments.Signed-off-by: Anirban Chakraborty
Reviewed-by: Ben Hutchings
Signed-off-by: David S. Miller
13 May, 2011
15 commits
-
I swear none of my compilers warned about this, yet it is so
obvious.> net/ipv4/ip_forward.c: In function 'ip_forward':
> net/ipv4/ip_forward.c:87: warning: 'iph' may be used uninitialized in this functionReported-by: Stephen Rothwell
Signed-off-by: David S. Miller -
No matter what kind of header mangling occurs due to IP options
processing, rt->rt_dst will always equal iph->daddr in the packet.So we can safely use iph->daddr instead of rt->rt_dst here.
Signed-off-by: David S. Miller
-
We already copy the 4-byte nexthop from the options block into
local variable "nexthop" for the route lookup.Re-use that variable instead of memcpy()'ing again when assigning
to iph->daddr after the route lookup succeeds.Signed-off-by: David S. Miller
-
All call sites conditionalize the call to ip_options_rcv_srr()
with a check of opt->srr, so no need to check it again there.Signed-off-by: David S. Miller
-
It will be needed by bonding and other drivers changing vlan_features
after ndo_init callback.As a bonus, this includes kernel-doc for netdev_update_features().
Signed-off-by: Michał Mirosław
Signed-off-by: David S. Miller -
Remove all remaining references to rt->rt_{src,dst}
by using dest->dst_saddr to cache saddr (used for TUN mode).
For ICMP in FORWARD hook just restrict the rt_mode for NAT
to disable LOCALNODE. All other modes do not allow
IP_VS_RT_MODE_RDR, so we should be safe with the ICMP
forwarding. Using cp->daddr as replacement for rt_dst
is safe for all modes except BYPASS, even when cp->dest is
NULL because it is cp->daddr that is used to assign cp->dest
for sync-ed connections.Signed-off-by: Julian Anastasov
Signed-off-by: David S. Miller -
We can simply track what destination address is used based upon which
code block is taken at the top of the function.Signed-off-by: David S. Miller
-
[ Add some cases I missed, from Julian Anastasov ]
Signed-off-by: David S. Miller
-
use tty_insert_flip_string and tty_flip_buffer_push to deliver incoming data
packets from the IrDA device instead of delivering the packets directly to the
line discipline. Following later approach resulted in warning "Sleeping function
called from invalid context".Signed-off-by: Amit Virdi
Acked-by: Alan Cox
Signed-off-by: David S. Miller -
Fix VLAN features propagation for devices which change vlan_features.
For this to work, driver needs to make sure netdev_features_changed()
gets called after the change (it is e.g. after ndo_set_features()).Side effect is that a user might request features that will never
be enabled on a VLAN device.Signed-off-by: Michał Mirosław
Signed-off-by: David S. Miller -
The issue was introduced in commit eed2a12f1ed9aabf.
Signed-off-by: Franco Fichtner
Acked-by: Michał Mirosław
Acked-by: Ben Hutchings
Signed-off-by: David S. Miller -
When removing last vlan from a device, garp_uninit_applicant() calls
synchronize_rcu() to make sure no user can still manipulate struct
garp_applicant before we free it.Use call_rcu() instead, as a step to further net_device dismantle
optimizations.Add the temporary garp_cleanup_module() function to make sure no pending
call_rcu() are left at module unload time [ this will be removed when
kfree_rcu() is available ]Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller -
It's already known non-null above.
Signed-off-by: Joe Perches
Signed-off-by: David S. Miller -
This variable only needs initialization when cmsgs.info
is NULL.Use memset to ensure padding is also zeroed so
kernel doesn't leak any data.Signed-off-by: Joe Perches
Signed-off-by: David S. Miller -
While trying to remove useless synchronize_rcu() calls, I found l2tp is
indeed incorrectly using two of such calls, but also bumps tunnel
refcount after list insertion.tunnel refcount must be incremented before being made publically visible
by rcu readers.This fix can be applied to 2.6.35+ and might need a backport for older
kernels, since things were shuffled in commit fd558d186df2c
(l2tp: Split pppol2tp patch into separate l2tp and ppp parts)Signed-off-by: Eric Dumazet
CC: Paul E. McKenney
CC: James Chapman
Reviewed-by: Paul E. McKenney
Signed-off-by: David S. Miller
12 May, 2011
2 commits
-
Conflicts:
drivers/net/benet/be_main.c
11 May, 2011
20 commits
-
Unlike the standard case, disabled anti replay detection needs some
nontrivial extra treatment on ESN. RFC 4303 states:Note: If a receiver chooses to not enable anti-replay for an SA, then
the receiver SHOULD NOT negotiate ESN in an SA management protocol.
Use of ESN creates a need for the receiver to manage the anti-replay
window (in order to determine the correct value for the high-order
bits of the ESN, which are employed in the ICV computation), which is
generally contrary to the notion of disabling anti-replay for an SA.So return an error if an ESN state with disabled anti replay detection
is inserted for now and add the extra treatment later if we need it.Signed-off-by: Steffen Klassert
Signed-off-by: David S. Miller -
As it is, we assign the outer modes output function to the dst entry
when we create the xfrm bundle. This leads to two problems on interfamily
scenarios. We might insert ipv4 packets into ip6_fragment when called
from xfrm6_output. The system crashes if we try to fragment an ipv4
packet with ip6_fragment. This issue was introduced with git commit
ad0081e4 (ipv6: Fragment locally generated tunnel-mode IPSec6 packets
as needed). The second issue is, that we might insert ipv4 packets in
netfilter6 and vice versa on interfamily scenarios.With this patch we assign the inner mode output function to the dst entry
when we create the xfrm bundle. So xfrm4_output/xfrm6_output from the inner
mode is used and the right fragmentation and netfilter functions are called.
We switch then to outer mode with the output_finish functions.Signed-off-by: Steffen Klassert
Signed-off-by: David S. Miller -
Commit 443457242beb (factorize sync-rcu call in
unregister_netdevice_many) mistakenly removed one test from dev_close()Following actions trigger a BUG :
modprobe bonding
modprobe dummy
ifconfig bond0 up
ifenslave bond0 dummy0
rmmod dummydev_close() must not close a non IFF_UP device.
With help from Frank Blaschka and Einar EL Lueck
Reported-by: Frank Blaschka
Reported-by: Einar EL Lueck
Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller -
ip link add link eth2 eth2.103 type vlan id 103 gvrp on loose_binding on
ip link set eth2.103 up
rmmod tg3 # driver providing eth2BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [] garp_request_leave+0x3e/0xc0 [garp]
PGD 11d251067 PUD 11b9e0067 PMD 0
Oops: 0000 [#1] SMP
last sysfs file: /sys/devices/virtual/net/eth2.104/ifindex
CPU 0
Modules linked in: tg3(-) 8021q garp nfsd lockd auth_rpcgss sunrpc libphy sg [last unloaded: x_tables]Pid: 11494, comm: rmmod Tainted: G W 2.6.39-rc6-00261-gfd71257-dirty #580 HP ProLiant BL460c G6
RIP: 0010:[] [] garp_request_leave+0x3e/0xc0 [garp]
RSP: 0018:ffff88007a19bae8 EFLAGS: 00010286
RAX: 0000000000000000 RBX: ffff88011b5e2000 RCX: 0000000000000002
RDX: 0000000000000000 RSI: 0000000000000175 RDI: ffffffffa0030d5b
RBP: ffff88007a19bb18 R08: 0000000000000001 R09: ffff88011bd64a00
R10: ffff88011d34ec00 R11: 0000000000000000 R12: 0000000000000002
R13: ffff88007a19bc48 R14: ffff88007a19bb88 R15: 0000000000000001
FS: 0000000000000000(0000) GS:ffff88011fc00000(0063) knlGS:00000000f77d76c0
CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b
CR2: 0000000000000000 CR3: 000000011a675000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process rmmod (pid: 11494, threadinfo ffff88007a19a000, task ffff8800798595c0)
Stack:
ffff88007a19bb36 ffff88011c84b800 ffff88011b5e2000 ffff88007a19bc48
ffff88007a19bb88 0000000000000006 ffff88007a19bb38 ffffffffa003a5f6
ffff88007a19bb38 670088007a19bba8 ffff88007a19bb58 ffffffffa00397e7
Call Trace:
[] vlan_gvrp_request_leave+0x46/0x50 [8021q]
[] vlan_dev_stop+0xb7/0xc0 [8021q]
[] __dev_close_many+0x87/0xe0
[] dev_close_many+0x87/0x110
[] rollback_registered_many+0xa0/0x240
[] unregister_netdevice_many+0x19/0x60
[] vlan_device_event+0x53b/0x550 [8021q]
[] ? ip6mr_device_event+0xa8/0xd0
[] notifier_call_chain+0x53/0x80
[] __raw_notifier_call_chain+0x9/0x10
[] raw_notifier_call_chain+0x11/0x20
[] call_netdevice_notifiers+0x32/0x60
[] rollback_registered_many+0x10f/0x240
[] rollback_registered+0x2f/0x40
[] unregister_netdevice_queue+0x58/0x90
[] unregister_netdev+0x1b/0x30
[] tg3_remove_one+0x6f/0x10b [tg3]We should call vlan_gvrp_request_leave() from unregister_vlan_dev(),
not from vlan_dev_stop(), because vlan_gvrp_uninit_applicant()
is called right after unregister_netdevice_queue(). In batch mode,
unregister_netdevice_queue() doesn’t immediately call vlan_dev_stop().Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller -
Commit e67f88dd12f6 (net: dont hold rtnl mutex during netlink dump
callbacks) switched rtnl protection to RCU, but we forgot to adjust two
rcu_dereference() lockdep annotations :inet_get_link_af_size() or inet_fill_link_af() might be called with
rcu_read_lock or rtnl held, so use rcu_dereference_rtnl()
instead of rtnl_dereference()Reported-by: Valdis Kletnieks
Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller -
Rearrange xfrm4_dst_lookup() so that it works by calling a helper
function __xfrm_dst_lookup() that takes an explicit flow key storage
area as an argument.Use this new helper in xfrm4_get_saddr() so we can fetch the selected
source address from the flow instead of from rt->rt_srcSigned-off-by: David S. Miller
-
Flow key is available, so fetch it from there.
Signed-off-by: David S. Miller
-
We already track and pass around the correct flow key,
so simply use it in udp_send_skb().Signed-off-by: David S. Miller
-
On input packets, rt->rt_src always equals ip_hdr(skb)->saddr
Anything that mangles or otherwise changes the IP header must
relookup the route found at skb_rtable(). Therefore this
invariant must always hold true.Signed-off-by: David S. Miller
-
This eliminates an access to rt->rt_src.
Signed-off-by: David S. Miller
-
Revises the algorithm governing the sending of link request messages
to take into account the number of nodes each bearer is currently in
contact with, and to ensure more rapid rediscovery of neighboring nodes
if a bearer fails and then recovers.The discovery object now sends requests at least once a second if it
is not in contact with any other nodes, and at least once a minute if
it has at least one neighbor; if contact with the only neighbor is
lost, the object immediately reverts to its initial rapid-fire search
timing to accelerate the rediscovery process.In addition, the discovery object now stops issuing link request
messages if it is in contact with the only neighboring node it is
configured to communicate with, since further searching is unnecessary.Signed-off-by: Allan Stephens
Signed-off-by: Paul Gortmaker -
Augments TIPC's discovery object to track the number of neighboring nodes
having an active link to the associated bearer.This means tipc_disc_update_link_req() becomes either one of:
tipc_disc_add_dest()
or:
tipc_disc_remove_dest()depending on the code flow direction of things.
Signed-off-by: Allan Stephens
Signed-off-by: Paul Gortmaker -
Augments TIPC's discovery object to send its initial neighbor discovery
request message as soon as the associated bearer is created, rather than
waiting for its first periodic timeout to occur, thereby speeding up the
discovery process. Also adds a check to suppress the initial request or
subsequent requests if the bearer is blocked at the time the request is
scheduled for transmission.Signed-off-by: Allan Stephens
Signed-off-by: Paul Gortmaker -
Modifies bearer creation and deletion code to improve handling of
scenarios when a neighbor discovery object cannot be created. The
creation routine now aborts the creation of a bearer if its discovery
object cannot be created, and deletes the newly created bearer, rather
than failing quietly and leaving an unusable bearer hanging around.Since the exit via the goto label really isn't a definitive failure
in all cases, relabel it appropriately.Signed-off-by: Allan Stephens
Signed-off-by: Paul Gortmaker -
Create a helper routine to enqueue a chain of sk_buffs to a link's
transmit queue. It improves readability and the new function is
anticipated to be used more than just once in the future as well.Signed-off-by: Allan Stephens
Signed-off-by: Paul Gortmaker -
Rework TIPC's message sending routines to take advantage of the total
amount of data value passed to it by the kernel socket infrastructure.
This change eliminates the need for TIPC to compute the size of outgoing
messages itself, as well as the check for an oversize message in
tipc_msg_build(). In addition, this change warrants an explanation:- res = send_packet(NULL, sock, &my_msg, 0);
+ res = send_packet(NULL, sock, &my_msg, bytes_to_send);Previously, the final argument to send_packet() was ignored (since the
amount of data being sent was recalculated by a lower-level routine)
and we could just pass in a dummy value (0). Now that the
recalculation is being eliminated, the argument value being passed to
send_packet() is significant and we have to supply the actual amount
of data we want to send.Signed-off-by: Allan Stephens
Signed-off-by: Paul Gortmaker -
Adds checks to TIPC's socket send routines to promptly detect and
abort attempts to send more than 66,000 bytes in a single TIPC
message or more than 2**31-1 bytes in a single TIPC byte stream request.
In addition, this ensures that the number of iovecs in a send request
does not exceed the limits of a standard integer variable.Signed-off-by: Allan Stephens
Signed-off-by: Paul Gortmaker -
Enhances existing checks on the discovery domain associated with a TIPC
bearer. A bearer can no longer be configured to accept links from itself
only (which would be pointless), or to nodes outside its own cluster
(since multi-cluster support has now been removed from TIPC). Also, the
neighbor discovery routine now validates link setup requests against the
configured discovery domain for the bearer, rather than simply ensuring
the requesting node belongs to the node's own cluster.Signed-off-by: Allan Stephens
Signed-off-by: Paul Gortmaker -
This allows them to be available for easy re-use in other places
and avoids trivial mistakes caused by "count the f's and 0's".Signed-off-by: Paul Gortmaker