30 Mar, 2013

1 commit

  • Erik Hugne's errata proposal (Errata ID: 3480) to RFC4291 has been
    verified: http://www.rfc-editor.org/errata_search.php?eid=3480

    We have to check for pkt_type and loopback flag because either the
    packets are allowed to travel over the loopback interface (in which case
    pkt_type is PACKET_HOST and IFF_LOOPBACK flag is set) or they travel
    over a non-loopback interface back to us (in which case PACKET_TYPE is
    PACKET_LOOPBACK and IFF_LOOPBACK flag is not set).

    Cc: Erik Hugne
    Cc: YOSHIFUJI Hideaki
    Signed-off-by: Hannes Frederic Sowa
    Signed-off-by: David S. Miller

    Hannes Frederic Sowa
     

09 Mar, 2013

1 commit


02 Mar, 2013

1 commit

  • I had a report recently of a user trying to use dropwatch to localise some frame
    loss, and they were getting false positives. Turned out they were using a user
    space SCTP stack that used raw sockets to grab frames. When we don't have a
    registered protocol for a given packet, we record it as a drop, even if a raw
    socket receieves the frame. We should only record the drop in the event a raw
    socket doesnt exist to receive the frames

    Tested by the reported successfully

    Signed-off-by: Neil Horman
    Reported-by: William Reich
    Tested-by: William Reich
    CC: "David S. Miller"
    CC: William Reich
    CC: eric.dumazet@gmail.com
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Neil Horman
     

12 Feb, 2013

1 commit


14 Jan, 2013

2 commits


31 Jul, 2012

1 commit

  • early_demux() handlers should be called in RCU context, and as we
    use skb_dst_set_noref(skb, dst), caller must not exit from RCU context
    before dst use (skb_dst(skb)) or release (skb_drop(dst))

    Therefore, rcu_read_lock()/rcu_read_unlock() pairs around
    ->early_demux() are confusing and not needed :

    Protocol handlers are already in an RCU read lock section.
    (__netif_receive_skb() does the rcu_read_lock() )

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

    Eric Dumazet
     

27 Jul, 2012

1 commit


20 Jun, 2012

1 commit

  • Don't pretend that inet_protos[] and inet6_protos[] are hashes, thay
    are just a straight arrays. Remove all unnecessary hash masking.

    Document MAX_INET_PROTOS.

    Use RAW_HTABLE_SIZE when appropriate.

    Reported-by: Ben Hutchings
    Signed-off-by: David S. Miller

    David S. Miller
     

19 May, 2012

1 commit


04 Dec, 2011

1 commit

  • While parsing through IPv6 extension headers, fragment headers are
    skipped making them invisible to the caller. This reports the
    fragment offset of the last header in order to make it possible to
    determine whether the packet is fragmented and, if so whether it is
    a first or last fragment.

    Signed-off-by: Jesse Gross

    Jesse Gross
     

09 Nov, 2011

1 commit


23 Apr, 2011

1 commit


20 Apr, 2010

1 commit


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

25 Mar, 2010

1 commit


19 Feb, 2010

1 commit


15 Sep, 2009

1 commit


07 Jul, 2009

1 commit

  • The routine ipv6_rcv() uses magic number 0 for a return when it drops a
    packet. This corresponds to NET_RX_SUCCESS, which is obviously
    incorrect. Correct this by using NET_RX_DROP instead.

    ps. It isn't exactly clear who the IPv6 maintainers are, apologies if
    I've missed any.

    Signed-off-by: Mark Smith
    Signed-off-by: David S. Miller

    Mark Smith
     

27 Jun, 2009

1 commit

  • As transparent proxying looks up the socket early and assigns
    it to the skb for later processing, we must drop any existing
    socket ownership prior to that in order to distinguish between
    the case where tproxy is active and where it is not.

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

    Herbert Xu
     

03 Jun, 2009

1 commit

  • Define three accessors to get/set dst attached to a skb

    struct dst_entry *skb_dst(const struct sk_buff *skb)

    void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)

    void skb_dst_drop(struct sk_buff *skb)
    This one should replace occurrences of :
    dst_release(skb->dst)
    skb->dst = NULL;

    Delete skb->dst field

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

    Eric Dumazet
     

27 Apr, 2009

1 commit

  • The IP MIB (RFC 4293) defines stats for InOctets, OutOctets, InMcastOctets and
    OutMcastOctets:
    http://tools.ietf.org/html/rfc4293
    But it seems we don't track those in any way that easy to separate from other
    protocols. This patch adds those missing counters to the stats file. Tested
    successfully by me

    With help from Eric Dumazet.

    Signed-off-by: Neil Horman
    Signed-off-by: David S. Miller

    Neil Horman
     

27 Mar, 2009

1 commit

  • Commit 778d80be52699596bf70e0eb0761cf5e1e46088d
    (ipv6: Add disable_ipv6 sysctl to disable IPv6 operaion on specific interface)
    seems to have introduced a leak of sk_buff's for ipv6 traffic,
    at least in some configurations where idev is NULL, or when ipv6
    is disabled via sysctl.

    The problem is that if the first condition of the if-statement
    returns non-NULL, it returns an skb with only one reference,
    and when the other conditions apply, execution jumps to the "out"
    label, which does not call kfree_skb for it.

    To plug this leak, change to use the "drop" label instead.
    (this relies on it being ok to call kfree_skb on NULL)
    This also allows us to avoid calling rcu_read_unlock here,
    and removes the only user of the "out" label.

    Signed-off-by: Jesper Nilsson
    Signed-off-by: David S. Miller

    Jesper Nilsson
     

28 Jan, 2009

1 commit

  • This patch addresses the IPv6 multicast routing issues described
    below. It was tested with XORP 1.4/1.5 as the IPv6 PIM-SM routing
    daemon against FreeBSD peers.

    net/ipv6/ip6_input.c:

    - Don't try to forward link-local multicast packets.

    - Don't reset skb2->dev before calling ip6_mr_input() so packets can
    be identified as coming from the PIM register vif properly.

    net/ipv6/ip6mr.c:

    - Fix incoming PIM register messages processing:

    * The IPv6 pseudo-header should be included when checksumming PIM
    messages (RFC 4601 section 4.9; RFC 3973 section 4.7.1).

    * Packets decapsulated from PIM register messages should have
    skb->protocol ETH_P_IPV6.

    - Enable/disable IPv6 multicast forwarding on the corresponding
    interface when a routing daemon adds/removes a multicast virtual
    interface.

    - Remove incorrect skb_pull() to fix userspace signaling.

    - Enable/disable global IPv6 multicast forwarding when an IPv6
    multicast routing socket is opened/closed.

    net/ipv6/route.c:

    - Don't use strict routing logic for packets decapsulated from PIM
    register messages (similar to disabling rp_filter for the IPv4
    case).

    Signed-off-by: Thomas Goff
    Reviewed-by: Fred Templin
    Signed-off-by: David S. Miller

    Thomas Goff
     

09 Oct, 2008

1 commit


20 Jul, 2008

1 commit


03 Jul, 2008

1 commit


28 Jun, 2008

1 commit


20 Jun, 2008

1 commit


12 Jun, 2008

1 commit


11 Apr, 2008

1 commit


05 Apr, 2008

1 commit


03 Apr, 2008

1 commit


01 Apr, 2008

1 commit

  • In ip6_mc_input(), we need to check whether we have listener(s) for
    the packet.

    After commit ae7bf20a6316272acfcaef5d265b18aaa54b41e4, all packets
    for multicast destinations are delivered to upper layer if
    IFF_PROMISC or IFF_ALLMULTI is set.

    In fact, bug was rather ancient; the original (before the commit)
    intent of the dev->flags check was to skip the ipv6_chk_mcast_addr()
    call, assuming L2 filters packets appropriately, but it was even not
    true.

    Let's explicitly check our multicast list.

    Signed-off-by: YOSHIFUJI Hideaki
    Acked-by: David L Stevens
    Signed-off-by: David S. Miller

    YOSHIFUJI Hideaki
     

06 Mar, 2008

1 commit


29 Jan, 2008

2 commits

  • Same as in the previous patch for ipv4, compact the
    API and hide hash table and rwlock inside the raw.c
    file.

    Plus fix some "bad" places from checkpatch.pl point
    of view (assignments inside if()).

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

    Pavel Emelyanov
     
  • The IPv4 and IPv6 hook values are identical, yet some code tries to figure
    out the "correct" value by looking at the address family. Introduce NF_INET_*
    values for both IPv4 and IPv6. The old values are kept in a #ifndef __KERNEL__
    section for userspace compatibility.

    Signed-off-by: Patrick McHardy
    Acked-by: Herbert Xu
    Signed-off-by: David S. Miller

    Patrick McHardy
     

16 Oct, 2007

2 commits

  • With all the users of the double pointers removed from the IPv6 input path,
    this patch converts all occurances of sk_buff ** to sk_buff * in IPv6 input
    handlers.

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

    Herbert Xu
     
  • Uninline netfilter okfns for those cases where gcc can generate tail-calls.

    Before:
    text data bss dec hex filename
    8994153 1016524 524652 10535329 a0c1a1 vmlinux

    After:
    text data bss dec hex filename
    8992761 1016524 524652 10533937 a0bc31 vmlinux
    -------------------------------------------------------
    -1392

    All cases have been verified to generate tail-calls with and without netfilter.

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

    Patrick McHardy
     

11 Oct, 2007

1 commit

  • This patch replaces all occurences to the static variable
    loopback_dev to a pointer loopback_dev. That provides the
    mindless, trivial, uninteressting change part for the dynamic
    allocation for the loopback.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: Daniel Lezcano
    Acked-By: Kirill Korotaev
    Acked-by: Benjamin Thery
    Signed-off-by: David S. Miller

    Daniel Lezcano