27 Oct, 2007

5 commits

  • This patch fixes the errors made in the users of the crypto layer during
    the sg_init_table conversion. It also adds a few conversions that were
    missing altogether.

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

    Herbert Xu
     
  • The pid namespace patches changed the semantics of
    find_task_by_pid without breaking the compile resulting
    in get_net_ns_by_pid doing the wrong thing.

    So switch to using the intended find_task_by_vpid.

    Combined with Denis' earlier patch to make netlink traffic
    fully synchronous the inadvertent race I introduced with
    accessing current is actually removed.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     
  • It is not safe to to place struct pernet_operations in a special section.
    We need struct pernet_operations to last until we call unregister_pernet_subsys.
    Which doesn't happen until module unload.

    So marking struct pernet_operations is a disaster for modules in two ways.
    - We discard it before we call the exit method it points to.
    - Because I keep struct pernet_operations on a linked list discarding
    it for compiled in code removes elements in the middle of a linked
    list and does horrible things for linked insert.

    So this looks safe assuming __exit_refok is not discarded
    for modules.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     
  • This patch fixes the following compile errors in some configurations:

    ...
    CC net/ipv4/esp4.o
    /home/bunk/linux/kernel-2.6/git/linux-2.6/net/ipv4/esp4.c: In function 'esp_output':
    /home/bunk/linux/kernel-2.6/git/linux-2.6/net/ipv4/esp4.c:113: error: implicit declaration of function 'sg_init_table'
    make[3]: *** [net/ipv4/esp4.o] Error 1
    ...
    /home/bunk/linux/kernel-2.6/git/linux-2.6/net/ipv6/esp6.c: In function 'esp6_output':
    /home/bunk/linux/kernel-2.6/git/linux-2.6/net/ipv6/esp6.c:112: error: implicit declaration of function 'sg_init_table'
    make[3]: *** [net/ipv6/esp6.o] Error 1

    Signed-off-by: Adrian Bunk
    Signed-off-by: David S. Miller

    Adrian Bunk
     
  • net/ipv6/tcp_ipv6.c: In function 'tcp_v6_rcv':
    net/ipv6/tcp_ipv6.c:1736: error: implicit declaration of function
    'get_softnet_dma'
    net/ipv6/tcp_ipv6.c:1736: warning: assignment makes pointer from integer
    without a cast

    Signed-off-by: Jeff Garzik
    Signed-off-by: David S. Miller

    Jeff Garzik
     

26 Oct, 2007

22 commits


24 Oct, 2007

13 commits

  • Assigning initial values of `0' is redundant when loading a new CCID structure,
    since in net/dccp/ccid.c the entire CCID structure is zeroed out prior to
    initialisation in ccid_new():

    struct ccid {
    struct ccid_operations *ccid_ops;
    char ccid_priv[0];
    };

    // ...
    if (rx) {
    memset(ccid + 1, 0, ccid_ops->ccid_hc_rx_obj_size);
    if (ccid->ccid_ops->ccid_hc_rx_init != NULL &&
    ccid->ccid_ops->ccid_hc_rx_init(ccid, sk) != 0)
    goto out_free_ccid;
    } else {
    memset(ccid + 1, 0, ccid_ops->ccid_hc_tx_obj_size);
    /* analogous to the rx case */
    }

    This patch therefore removes the redundant assignments. Thanks to Arnaldo for
    the inspiration.

    Signed-off-by: Gerrit Renker
    Signed-off-by: Ian McDonald
    Signed-off-by: Arnaldo Carvalho de Melo

    Gerrit Renker
     
  • This fixes `unaligned (read) access' errors of the type

    Kernel unaligned access at TPC[100f970c] dccp_parse_options+0x4f4/0x7e0 [dccp]
    Kernel unaligned access at TPC[1011f2e4] ccid3_hc_tx_parse_options+0x1ac/0x380 [dccp_ccid3]
    Kernel unaligned access at TPC[100f9898] dccp_parse_options+0x680/0x880 [dccp]

    by using the get_unaligned macro for parsing options.

    Commiter note: Preserved the sparse __be{16,32} annotations.

    Signed-off-by: Gerrit Renker
    Signed-off-by: Ian McDonald
    Signed-off-by: Arnaldo Carvalho de Melo

    Gerrit Renker
     
  • This adds support for converting the 11 currently defined Reset codes into system
    error numbers, which are stored in sk_err for further interpretation.

    This makes the externally visible API behaviour similar to TCP, since a client
    connecting to a non-existing port will experience ECONNREFUSED.

    * Code 0, Unspecified, is interpreted as non-error (0);
    * Code 1, Closed (normal termination), also maps into 0;
    * Code 2, Aborted, maps into "Connection reset by peer" (ECONNRESET);
    * Code 3, No Connection and
    Code 7, Connection Refused, map into "Connection refused" (ECONNREFUSED);
    * Code 4, Packet Error, maps into "No message of desired type" (ENOMSG);
    * Code 5, Option Error, maps into "Illegal byte sequence" (EILSEQ);
    * Code 6, Mandatory Error, maps into "Operation not supported on transport endpoint" (EOPNOTSUPP);
    * Code 8, Bad Service Code, maps into "Invalid request code" (EBADRQC);
    * Code 9, Too Busy, maps into "Too many users" (EUSERS);
    * Code 10, Bad Init Cookie, maps into "Invalid request descriptor" (EBADR);
    * Code 11, Aggression Penalty, maps into "Quota exceeded" (EDQUOT)
    which makes sense in terms of using more than the `fair share' of bandwidth.

    Signed-off-by: Gerrit Renker
    Acked-by: Ian McDonald
    Signed-off-by: Arnaldo Carvalho de Melo

    Gerrit Renker
     
  • This fixes the following problem: client connects to peer which has no DCCP
    enabled or loaded; ICMP error messages ("Protocol Unavailable") can be seen
    on the wire, but the application hangs. Reason: ICMP packets don't get through
    to dccp_v4_err.

    When reporting errors, a sequence number check is made for the DCCP packet
    that had caused an ICMP error to arrive.
    Such checks can not be made if the socket is in state LISTEN, RESPOND (which
    in the implementation is the same as LISTEN), or REQUEST, since update_gsr()
    has not been called in these states, hence the sequence window is 0..0.

    This patch fixes the problem by adding the REQUEST state as another exemption
    to the window check. The error reporting now works as expected on connecting.

    Signed-off-by: Gerrit Renker
    Acked-by: Ian McDonald
    Signed-off-by: Arnaldo Carvalho de Melo

    Gerrit Renker
     
  • This fixes a problem when analysing erroneous packets in dccp_v{4,6}_err:
    * dccp_hdr_seq currently takes an skb
    * however, the transport headers in the skb are shifted, due to the
    preceding IPv4/v6 header.
    Fixed for v4 and v6 by changing dccp_hdr_seq to take a struct dccp_hdr as
    argument. Verified that the correct sequence number is now reported in the
    error handler.

    Signed-off-by: Gerrit Renker
    Acked-by: Ian McDonald
    Signed-off-by: Arnaldo Carvalho de Melo

    Gerrit Renker
     
  • Most drivers need to set length and offset as well, so may as well fold
    those three lines into one.

    Add sg_assign_page() for those two locations that only needed to set
    the page, where the offset/length is set outside of the function context.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Jens Axboe

    Geert Uytterhoeven
     
  • In case the "multiple tables" config option is y, the ip_fib_local_table
    is not a variable, but a macro, that calls fib_get_table(RT_TABLE_LOCAL).

    Some code uses this "variable" *3* times in one place, thus implicitly
    making 3 calls. Fix it.

    Signed-off-by: Pavel Emelyanov
    Signed-off-by: David S. Miller

    Pavel Emelyanov
     
  • Instead of ugly extern not-existing function.

    Signed-off-by: Pavel Emelyanov
    Signed-off-by: David S. Miller

    Pavel Emelyanov
     
  • Inconsistent prototype and real type for functions may have worse
    consequences, than those for variables, so move them into a header.

    Since they are used privately in net/core, make this file reside in
    the same place.

    Signed-off-by: Pavel Emelyanov
    Signed-off-by: David S. Miller

    Pavel Emelyanov
     
  • Some are already declared in include/linux/netdevice.h, while
    some others (xfrm ones) need to be declared.

    The driver/net/rrunner.c just uses same extern as well, so
    cleanup it also.

    Signed-off-by: Pavel Emelyanov
    Signed-off-by: David S. Miller

    Pavel Emelyanov
     
  • In some places, the result of skb_headroom() is compared to an unsigned
    integer, and in others, the result is compared to a signed integer. Make
    the comparisons consistent and correct.

    Signed-off-by: Chuck Lever
    Signed-off-by: David S. Miller

    Chuck Lever
     
  • Signed-off-by: Roel Kluin
    Signed-off-by: David S. Miller

    Roel Kluin