11 Jul, 2007

3 commits

  • Rémi Denis-Courmont wrote:
    > Right. By the way, shouldn't "len" rather be signed in there?
    >
    > unsigned int len;
    >
    > /* if we're overly short, let UDP handle it */
    > len = skb->len - sizeof(struct udphdr);
    > if (len goto udp;

    It should, but the < 0 case can't happen since __udp4_lib_rcv
    already makes sure that we have at least a complete UDP header.

    Anyways, this patch fixes it.

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     
  • This cleanup fell out after adding L2TP support where a new encap_rcv
    funcptr was added to struct udp_sock. Have XFRM use the new encap_rcv
    funcptr, which allows us to move the XFRM encap code from udp.c into
    xfrm4_input.c.

    Make xfrm4_rcv_encap() static since it is no longer called externally.

    Signed-off-by: James Chapman
    Acked-by: Patrick McHardy
    Signed-off-by: David S. Miller

    James Chapman
     
  • This patch adds a new UDP_ENCAP_L2TPINUDP encapsulation type for UDP
    sockets. When a UDP socket's encap_type is UDP_ENCAP_L2TPINUDP, the
    skb is delivered to a function pointed to by the udp_sock's
    encap_rcv funcptr. If the skb isn't wanted by L2TP, it returns >0, which
    causes it to be passed through to UDP.

    Include padding to put the new encap_rcv field on a 4-byte boundary.

    Previously, the only user of UDP encap sockets was ESP, so when
    CONFIG_XFRM was not defined, some of the encap code was compiled
    out. This patch changes that. As a result, udp_encap_rcv() will
    now do a little more work when CONFIG_XFRM is not defined.

    Signed-off-by: James Chapman
    Signed-off-by: David S. Miller

    James Chapman
     

08 Jun, 2007

1 commit

  • This reverts changesets:

    6aaf47fa48d3c44280810b1b470261d340e4ed87
    b7b5f487ab39bc10ed0694af35651a03d9cb97ff
    de34ed91c4ffa4727964a832c46e624dd1495cf5
    fc038410b4b1643766f8033f4940bcdb1dace633

    There are still some correctness issues recently
    discovered which do not have a known fix that doesn't
    involve doing a full hash table scan on port bind.

    So revert for now.

    Signed-off-by: David S. Miller

    David S. Miller
     

04 Jun, 2007

1 commit


11 May, 2007

1 commit


09 May, 2007

1 commit


01 May, 2007

2 commits


30 Apr, 2007

1 commit

  • Some people want to have many UDP sockets, binded to a single port but
    many different addresses. We currently hash all those sockets into a
    single chain. Processing of incoming packets is very expensive,
    because the whole chain must be examined to find the best match.

    I chose in this patch to hash UDP sockets with a hash function that
    take into account both their port number and address : This has a
    drawback because we need two lookups : one with a given address, one
    with a wildcard (null) address.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

26 Apr, 2007

11 commits


08 Mar, 2007

1 commit


11 Feb, 2007

2 commits

  • In a prior patch, I introduced a sk_hash field (__sk_common.skc_hash) to let
    tcp lookups use one cache line per unmatched entry instead of two.

    We can also use sk_hash to speedup UDP part as well. We store in sk_hash the
    hnum value, and use sk->sk_hash (same cache line than 'next' pointer),
    instead of inet->num (different cache line)

    Note : We still have a false sharing problem for SMP machines, because
    sock_hold(sock) dirties the cache line containing the 'next' pointer. Not
    counting the udp_hash_lock rwlock. (did someone mentioned RCU ? :) )

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • Signed-off-by: YOSHIFUJI Hideaki
    Signed-off-by: David S. Miller

    YOSHIFUJI Hideaki
     

09 Feb, 2007

1 commit


23 Dec, 2006

1 commit

  • When this code was converted to use sk_for_each() the
    logic for the "best hash chain length" code was reversed,
    breaking everything.

    The original code was of the form:

    size = 0;
    do {
    if (++size >= best_size_so_far)
    goto next;
    } while ((sk = sk->next) != NULL);
    best_size_so_far = size;
    best = result;
    next:;

    and this got converted into:

    sk_for_each(sk2, node, head)
    if (++size < best_size_so_far) {
    best_size_so_far = size;
    best = result;
    }

    Which does something very very different from the original.

    Signed-off-by: David S. Miller

    David S. Miller
     

03 Dec, 2006

7 commits

  • This patch consolidates set/getsockopt code between UDP(-Lite) v4 and 6. The
    justification is that UDP(-Lite) is a transport-layer protocol and therefore
    the socket option code (at least in theory) should be AF-independent.

    Furthermore, there is the following code reduplication:
    * do_udp{,v6}_getsockopt is 100% identical between v4 and v6
    * do_udp{,v6}_setsockopt is identical up to the following differerence
    --v4 in contrast to v4 additionally allows the experimental encapsulation
    types UDP_ENCAP_ESPINUDP and UDP_ENCAP_ESPINUDP_NON_IKE
    --the remainder is identical between v4 and v6
    I believe that this difference is of little relevance.

    The advantages in not duplicating twice almost completely identical code.

    The patch further simplifies the interface of udp{,v6}_push_pending_frames,
    since for the second argument (struct udp_sock *up) it always holds that
    up = udp_sk(sk); where sk is the first function argument.

    Signed-off-by: Gerrit Renker
    Signed-off-by: David S. Miller

    Gerrit Renker
     
  • ... into anonymous union of __wsum and __u32 (csum and csum_offset resp.)

    Signed-off-by: Al Viro
    Signed-off-by: David S. Miller

    Al Viro
     
  • Signed-off-by: Al Viro
    Signed-off-by: David S. Miller

    Al Viro
     
  • udp_push_pending_frames is only referenced within
    net/ipv4/udp.c and hence can remain static.

    Signed-off-by: Gerrit Renker
    Signed-off-by: David S. Miller

    Gerrit Renker
     
  • Signed-off-by: Al Viro
    Signed-off-by: David S. Miller

    Al Viro
     
  • Signed-off-by: Al Viro
    Signed-off-by: David S. Miller

    Al Viro
     
  • This is a revision of the previously submitted patch, which alters
    the way files are organized and compiled in the following manner:

    * UDP and UDP-Lite now use separate object files
    * source file dependencies resolved via header files
    net/ipv{4,6}/udp_impl.h
    * order of inclusion files in udp.c/udplite.c adapted
    accordingly

    [NET/IPv4]: Support for the UDP-Lite protocol (RFC 3828)

    This patch adds support for UDP-Lite to the IPv4 stack, provided as an
    extension to the existing UDPv4 code:
    * generic routines are all located in net/ipv4/udp.c
    * UDP-Lite specific routines are in net/ipv4/udplite.c
    * MIB/statistics support in /proc/net/snmp and /proc/net/udplite
    * shared API with extensions for partial checksum coverage

    [NET/IPv6]: Extension for UDP-Lite over IPv6

    It extends the existing UDPv6 code base with support for UDP-Lite
    in the same manner as per UDPv4. In particular,
    * UDPv6 generic and shared code is in net/ipv6/udp.c
    * UDP-Litev6 specific extensions are in net/ipv6/udplite.c
    * MIB/statistics support in /proc/net/snmp6 and /proc/net/udplite6
    * support for IPV6_ADDRFORM
    * aligned the coding style of protocol initialisation with af_inet6.c
    * made the error handling in udpv6_queue_rcv_skb consistent;
    to return `-1' on error on all error cases
    * consolidation of shared code

    [NET]: UDP-Lite Documentation and basic XFRM/Netfilter support

    The UDP-Lite patch further provides
    * API documentation for UDP-Lite
    * basic xfrm support
    * basic netfilter support for IPv4 and IPv6 (LOG target)

    Signed-off-by: Gerrit Renker
    Signed-off-by: David S. Miller

    Gerrit Renker
     

26 Nov, 2006

1 commit

  • Make udp_encap_rcv use pskb_may_pull

    IPsec with NAT-T breaks on some notebooks using the latest e1000 chipset,
    when header split is enabled. When receiving sufficiently large packets, the
    driver puts everything up to and including the UDP header into the header
    portion of the skb, and the rest goes into the paged part. udp_encap_rcv
    forgets to use pskb_may_pull, and fails to decapsulate it. Instead, it
    passes it up it to the IKE daemon.

    Signed-off-by: Olaf Kirch
    Signed-off-by: Jean Delvare
    Signed-off-by: David S. Miller

    Olaf Kirch
     

04 Oct, 2006

1 commit

  • UDP tracks corking status through the pending variable. The
    IP layer also tracks it through the socket write queue. It
    is possible for the two to get out of sync when MSG_PROBE is
    used.

    This patch changes UDP to check the write queue to ensure
    that the two stay in sync.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

29 Sep, 2006

2 commits


23 Sep, 2006

3 commits

  • This also kills a warning while building ipv6:

    net/ipv6/udp.c: In function ‘udp_v6_get_port’:
    net/ipv6/udp.c:66: warning: passing argument 3 of ‘udp_get_port’ from incompatible pointer type

    Signed-off-by: David S. Miller

    David S. Miller
     
  • It is not referenced outside of net/ipv4/udp.c any longer.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • This patch creates one common function which is called by
    udp_v4_get_port() and udp_v6_get_port(). As a result,
    * duplicated code is removed
    * udp_port_rover and local port lookup can now be removed from udp.h
    * further savings follow since the same function will be used by UDP-Litev4
    and UDP-Litev6

    In contrast to the patch sent in response to Yoshifujis comments
    (fixed by this variant), the code below also removes the
    EXPORT_SYMBOL(udp_port_rover), since udp_port_rover can now remain
    local to net/ipv4/udp.c.

    Signed-off-by: Gerrit Renker
    Signed-off-by: David S. Miller

    Gerrit Renker