27 Oct, 2009

1 commit


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

    John Dykstra
     
  • 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

    Eric Dumazet
     

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

    Eric Dumazet
     

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

    Brian Haley
     

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

    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

    Gerrit Renker
     
  • 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

    Gerrit Renker
     

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

    Yang Hongyang
     

25 Feb, 2009

1 commit


05 Jan, 2009

1 commit


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

    Yang Hongyang
     
  • 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 Selection

    This 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

    Yang Hongyang
     

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

    Brian Haley
     

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

    Yang Hongyang
     

04 Aug, 2008

1 commit


20 Jul, 2008

1 commit


19 Jul, 2008

1 commit


28 Jun, 2008

1 commit


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

    Shan Wei
     

14 Jun, 2008

1 commit


12 Jun, 2008

4 commits


05 Jun, 2008

5 commits


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

    Pavel Emelyanov
     

29 Apr, 2008

1 commit


28 Apr, 2008

1 commit


14 Apr, 2008

1 commit


12 Apr, 2008

2 commits


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 here

    Signed-off-by: YOSHIFUJI Hideaki

    YOSHIFUJI Hideaki
     

05 Apr, 2008

1 commit


01 Apr, 2008

1 commit


26 Mar, 2008

1 commit