27 Oct, 2009
1 commit
-
Conflicts:
drivers/net/sh_eth.c
20 Oct, 2009
2 commits
-
Use symbols instead of magic constants while checking PMTU discovery
setsockopt.Remove redundant test in ip_rt_frag_needed() (done by caller).
Signed-off-by: John Dykstra
Signed-off-by: David S. Miller -
ipv4/ipv6 setsockopt(IP_MULTICAST_IF) have dubious __dev_get_by_index() calls.
This function should be called only with RTNL or dev_base_lock held, or reader
could see a corrupt hash chain and eventually enter an endless loop.Fix is to call dev_get_by_index()/dev_put().
If this happens to be performance critical, we could define a new dev_exist_by_index()
function to avoid touching dev refcount.Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller
19 Oct, 2009
1 commit
-
In order to have better cache layouts of struct sock (separate zones
for rx/tx paths), we need this preliminary patch.Goal is to transfert fields used at lookup time in the first
read-mostly cache line (inside struct sock_common) and move sk_refcnt
to a separate cache line (only written by rx path)This patch adds inet_ prefix to daddr, rcv_saddr, dport, num, saddr,
sport and id fields. This allows a future patch to define these
fields as macros, like sk_refcnt, without name clashes.Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller
07 Oct, 2009
1 commit
-
Atis Elsts wrote:
> Not sure if there is need to fill the mark from skb in tunnel xmit functions. In any case, it's not done for GRE or IPIP tunnels at the moment.Ok, I'll just drop that part, I'm not sure what should be done in this case.
> Also, in this patch you are doing that for SIT (v6-in-v4) tunnels only, and not doing it for v4-in-v6 or v6-in-v6 tunnels. Any reason for that?
I just sent that patch out too quickly, here's a better one with the updates.
Add support for IPv6 route lookups using sk_mark.
Signed-off-by: Brian Haley
Signed-off-by: David S. Miller
01 Oct, 2009
1 commit
-
This provides safety against negative optlen at the type
level instead of depending upon (sometimes non-trivial)
checks against this sprinkled all over the the place, in
each and every implementation.Based upon work done by Arjan van de Ven and feedback
from Linus Torvalds.Signed-off-by: David S. Miller
14 Aug, 2009
2 commits
-
This patch addresses:
* assigning -1 to np->tclass as it is currently done is not very meaningful,
since it turns into 0xff;
* RFC 3542, 6.5 allows -1 for clearing the sticky IPV6_TCLASS option
and specifies -1 to mean "use kernel default":
- RFC 2460, 7. requires that the default traffic class must be zero for
all 8 bits,
- this is consistent with RFC 2474, 4.1 which recommends a default PHB of 0,
in combination with a value of the ECN field of "non-ECT" (RFC 3168, 5.).This patch changes the meaning of -1 from assigning 255 to mean the RFC 2460
default, which at the same time allows to satisfy clearing the sticky TCLASS
option as per RFC 3542, 6.5.(When passing -1 as ancillary data, the fallback remains np->tclass, which
has either been set via socket options, or contains the default value.)Signed-off-by: Gerrit Renker
Signed-off-by: David S. Miller -
This replaces assignments of the type "int on LHS" = "u8 on RHS" with
simpler code. The LHS can express all of the unsigned right hand side
values, hence the assigned value can not be negative.Signed-off-by: Gerrit Renker
Signed-off-by: David S. Miller
14 Apr, 2009
1 commit
-
After switch (rthdr->type) {...},the check below is completely useless.Because:
if the type is 2,then hdrlen must be 2 and segments_left must be 1,clearly the
check is redundant;if the type is not 2,then goto sticky_done,the check is useless
too.Signed-off-by: Yang Hongyang
Reviewed-by: Shan Wei
Signed-off-by: David S. Miller
25 Feb, 2009
1 commit
-
Remove some pointless conditionals before kfree_skb().
The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)//
@@
expression E;
@@
- if (E)
- kfree_skb(E);
+ kfree_skb(E);
//Signed-off-by: Wei Yongjun
Signed-off-by: David S. Miller
05 Jan, 2009
1 commit
-
Signed-off-by: Ilpo Järvinen
Reported-by: Eric Sesterhenn
Signed-off-by: David S. Miller
16 Dec, 2008
2 commits
-
When get receiving interface index while no message is received,
the the value seted with setsockopt() should be returned.RFC 3542:
Issuing getsockopt() for the above options will return the sticky
option value i.e., the value set with setsockopt(). If no sticky
option value has been set getsockopt() will return the following
values:- For the IPV6_PKTINFO option, it will return an in6_pktinfo
structure with ipi6_addr being in6addr_any and ipi6_ifindex being
zero.Signed-off-by: Yang Hongyang
Signed-off-by: David S. Miller -
There are three reasons for me to add this support:
1.When no interface is specified in an IPV6_PKTINFO ancillary data
item, the interface specified in an IPV6_PKTINFO sticky optionis
is used.RFC3542:
6.7. Summary of Outgoing Interface SelectionThis document and [RFC-3493] specify various methods that affect the
selection of the packet's outgoing interface. This subsection
summarizes the ordering among those in order to ensure deterministic
behavior.For a given outgoing packet on a given socket, the outgoing interface
is determined in the following order:1. if an interface is specified in an IPV6_PKTINFO ancillary data
item, the interface is used.2. otherwise, if an interface is specified in an IPV6_PKTINFO sticky
option, the interface is used.2.When no IPV6_PKTINFO ancillary data is received,getsockopt() should
return the sticky option value which set with setsockopt().RFC 3542:
Issuing getsockopt() for the above options will return the sticky
option value i.e., the value set with setsockopt(). If no sticky
option value has been set getsockopt() will return the following
values:3.Make the setsockopt implementation POSIX compliant.
Signed-off-by: Yang Hongyang
Signed-off-by: David S. Miller
13 Nov, 2008
1 commit
-
This patch fixes two bugs:
1. setsockopt() of anything but a Type 2 routing header should return
EINVAL instead of EPERM. Noticed by Shan Wei
(shanwei@cn.fujitsu.com).2. setsockopt()/sendmsg() of a Type 2 routing header with invalid
length or segments should return EINVAL. These values are statically
fixed in RFC 3775, unlike the variable Type 0 was.Signed-off-by: Brian Haley
Signed-off-by: David S. Miller
18 Aug, 2008
1 commit
-
When get receiving interface index while no message is received,
the bounded device's index of the socket should be returned.RFC 3542:
Issuing getsockopt() for the above options will return the sticky
option value i.e., the value set with setsockopt(). If no sticky
option value has been set getsockopt() will return the following
values:- For the IPV6_PKTINFO option, it will return an in6_pktinfo
structure with ipi6_addr being in6addr_any and ipi6_ifindex being
zero.Signed-off-by: Yang Hongyang
Signed-off-by: David S. Miller
04 Aug, 2008
1 commit
-
When Set Hop-by-Hop options header with NULL data
pointer and optlen is not zero use setsockopt(),
the kernel successfully return 0 instead of
return error EINVAL or EFAULT.This patch fix the problem.
Signed-off-by: Yang Hongyang
Signed-off-by: David S. Miller
20 Jul, 2008
1 commit
-
Signed-off-by: YOSHIFUJI Hideaki
Signed-off-by: David S. Miller
19 Jul, 2008
1 commit
-
Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller
28 Jun, 2008
1 commit
-
Conflicts:
drivers/net/wireless/iwlwifi/iwl4965-base.c
20 Jun, 2008
1 commit
-
Remove the sticky Hop-by-Hop options header by calling setsockopt()
for IPV6_HOPOPTS with a zero option length, per RFC3542.Routing header and Destination options header does the same as
Hop-by-Hop options header.Signed-off-by: Shan Wei
Acked-by: YOSHIFUJI Hideaki
Signed-off-by: David S. Miller
14 Jun, 2008
1 commit
-
Conflicts:
drivers/net/smc911x.c
12 Jun, 2008
4 commits
-
This patch removes CVS keywords that weren't updated for a long time
from comments.Signed-off-by: Adrian Bunk
Signed-off-by: David S. Miller -
IPV6_MULTICAST_HOPS, for example, is not valid for stream sockets.
Since they are virtually unavailable for stream sockets,
we should return ENOPROTOOPT instead of EINVAL.Signed-off-by: YOSHIFUJI Hideaki
-
Only 0 and 1 are valid for IPV6_MULTICAST_LOOP socket option,
and we should return an error of EINVAL otherwise, per RFC3493.Based on patch from Shan Wei .
Signed-off-by: YOSHIFUJI Hideaki
-
Signed-off-by: YOSHIFUJI Hideaki
05 Jun, 2008
5 commits
-
Signed-off-by: Denis V. Lunev
Signed-off-by: YOSHIFUJI Hideaki -
It is not allowed to change underlying protocol for
int fd = socket(PF_INET6, SOCK_RAW, IPPROTO_UDP);Signed-off-by: Denis V. Lunev
Signed-off-by: YOSHIFUJI Hideaki -
Signed-off-by: YOSHIFUJI Hideaki
-
If get destination options with length which is not enough for that
option,getsockopt() will still return the real length of the option,
which is larger then the buffer space.
This is because ipv6_getsockopt_sticky() returns the real length of
the option.This patch fix this problem.
Signed-off-by: Yang Hongyang
Signed-off-by: YOSHIFUJI Hideaki -
If we pass NULL data buffer to getsockopt(), it will return 0,
and the option length is set to -EFAULT:
getsockopt(sk, IPPROTO_IPV6, IPV6_DSTOPTS, NULL, &len);This is because ipv6_getsockopt_sticky() will return -EFAULT or
-EINVAL if some error occur.This patch fix this problem.
Signed-off-by: Yang Hongyang
Signed-off-by: YOSHIFUJI Hideaki
01 May, 2008
1 commit
-
The last hunk from the commit dae50295 (ipv4/ipv6 compat: Fix SSM
applications on 64bit kernels.) escaped from the compat_ipv6_setsockopt
to the ipv6_getsockopt (I guess due to patch smartness wrt searching
for context) thus breaking 32-bit and 64-bit-without-compat compilation.Signed-off-by: Pavel Emelyanov
Acked-by: David L Stevens
Signed-off-by: David S. Miller
29 Apr, 2008
1 commit
-
This patch adds support for getsockopt for MCAST_MSFILTER for
both IPv4 and IPv6. It depends on the previous setsockopt patch,
and uses the same method.Signed-off-by: David L Stevens
Signed-off-by: YOSHIFUJI Hideaki
Signed-off-by: David S. Miller
28 Apr, 2008
1 commit
-
Add support on 64-bit kernels for seting 32-bit compatible MCAST*
socket options.Signed-off-by: David L Stevens
Signed-off-by: David S. Miller
14 Apr, 2008
1 commit
-
Signed-off-by: YOSHIFUJI Hideaki
Signed-off-by: David S. Miller
12 Apr, 2008
2 commits
-
Signed-off-by: YOSHIFUJI Hideaki
-
Check length of setsockopt's optval, which provided by user, before copy it
from user space.
For POSIX compliant, return -EINVAL for setsockopt of short lengths.Signed-off-by: Wang Chen
Signed-off-by: YOSHIFUJI Hideaki
11 Apr, 2008
1 commit
-
| net/ipv6/ipv6_sockglue.c:162:16: warning: symbol 'net' shadows an earlier one
| net/ipv6/ipv6_sockglue.c:111:13: originally declared here
| net/ipv6/ipv6_sockglue.c:175:16: warning: symbol 'net' shadows an earlier one
| net/ipv6/ipv6_sockglue.c:111:13: originally declared here
| net/ipv6/ip6mr.c:1241:10: warning: symbol 'ret' shadows an earlier one
| net/ipv6/ip6mr.c:1163:6: originally declared hereSigned-off-by: YOSHIFUJI Hideaki
05 Apr, 2008
1 commit
-
Based on ancient patch by Mickael Hoerdt
, which is available at
.Signed-off-by: YOSHIFUJI Hideaki
01 Apr, 2008
1 commit
-
This counter is about to become per-proto-and-per-net, so we'll need
two arguments to determine which cell in this "table" to work with.All the places, but proc already pass proper net to it - proc will be
tuned a bit later.Some indentation with spaces in proc files is done to keep the file
coding style consistent.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller
26 Mar, 2008
1 commit
-
Introduce per-sock inlines: sock_net(), sock_net_set()
and per-inet_timewait_sock inlines: twsk_net(), twsk_net_set().
Without CONFIG_NET_NS, no namespace other than &init_net exists.
Let's explicitly define them to help compiler optimizations.Signed-off-by: YOSHIFUJI Hideaki