13 Jan, 2012

1 commit

  • commit a9b3cd7f32 (rcu: convert uses of rcu_assign_pointer(x, NULL) to
    RCU_INIT_POINTER) did a lot of incorrect changes, since it did a
    complete conversion of rcu_assign_pointer(x, y) to RCU_INIT_POINTER(x,
    y).

    We miss needed barriers, even on x86, when y is not NULL.

    Signed-off-by: Eric Dumazet
    CC: Stephen Hemminger
    CC: Paul E. McKenney
    Signed-off-by: David S. Miller

    Eric Dumazet
     

05 Jan, 2012

2 commits

  • This ensures a linear behaviour when filling /proc/net/if_inet6 thus making
    ifconfig run really fast on IPv6 only addresses. In fact, with this patch and
    the IPv4 one sent a while ago, ifconfig will run in linear time regardless of
    address type.

    IPv4 related patch: f04565ddf52e401880f8ba51de0dff8ba51c99fd
    dev: use name hash for dev_seq_ops
    ...

    Some statistics (running ifconfig > /dev/null on a different setup):

    iface count / IPv6 no-patch time / IPv6 patched time / IPv4 time
    ----------------------------------------------------------------
    6250 | 0.23 s | 0.13 s | 0.11 s
    12500 | 0.62 s | 0.28 s | 0.22 s
    25000 | 2.91 s | 0.57 s | 0.46 s
    50000 | 11.37 s | 1.21 s | 0.94 s
    128000 | 86.78 s | 3.05 s | 2.54 s

    Signed-off-by: Mihai Maruseac
    Cc: Daniel Baluta
    Signed-off-by: David S. Miller

    Mihai Maruseac
     
  • Recently Dave noticed that a test we did in ipv6_add_addr to see if we next hop
    route for the interface we're adding an addres to was wrong (see commit
    7ffbcecbeed91e5874e9a1cfc4c0cbb07dac3069). for one, it never triggers, and two,
    it was completely wrong to begin with. This test was meant to cover this
    section of RFC 4429:

    3.3 Modifications to RFC 2462 Stateless Address Autoconfiguration

    * (modifies section 5.5) A host MAY choose to configure a new address
    as an Optimistic Address. A host that does not know the SLLAO
    of its router SHOULD NOT configure a new address as Optimistic.
    A router SHOULD NOT configure an Optimistic Address.

    This patch should bring us into proper compliance with the above clause. Since
    we only add a SLAAC address after we've received a RA which may or may not
    contain a source link layer address option, we can pass a pointer to that option
    to addrconf_prefix_rcv (which may be null if the option is not present), and
    only set the optimistic flag if the option was found in the RA.

    Change notes:
    (v2) modified the new parameter to addrconf_prefix_rcv to be a bool rather than
    a pointer to make its use more clear as per request from davem.

    Signed-off-by: Neil Horman
    CC: "David S. Miller"
    CC: Hideaki YOSHIFUJI
    Signed-off-by: David S. Miller

    Neil Horman
     

29 Dec, 2011

2 commits


16 Dec, 2011

1 commit


13 Dec, 2011

1 commit

  • There is no obvious reason to add a default multicast route for loopback
    devices, otherwise there would be a route entry whose dst.error set to
    -ENETUNREACH that would blocking all multicast packets.

    ====================

    [ more detailed explanation ]

    The problem is that the resulting routing table depends on the sequence
    of interface's initialization and in some situation, that would block all
    muticast packets. Suppose there are two interfaces on my computer
    (lo and eth0), if we initailize 'lo' before 'eth0', the resuting routing
    table(for multicast) would be

    # ip -6 route show | grep ff00::
    unreachable ff00::/8 dev lo metric 256 error -101
    ff00::/8 dev eth0 metric 256

    When sending multicasting packets, routing subsystem will return the first
    route entry which with a error set to -101(ENETUNREACH).

    I know the kernel will set the default ipv6 address for 'lo' when it is up
    and won't set the default multicast route for it, but there is no reason to
    stop 'init' program from setting address for 'lo', and that is exactly what
    systemd did.

    I am sure there is something wrong with kernel or systemd, currently I preferred
    kernel caused this problem.

    ====================

    Signed-off-by: Li Wei
    Signed-off-by: David S. Miller

    Li Wei
     

07 Dec, 2011

1 commit


06 Dec, 2011

1 commit


23 Nov, 2011

1 commit


07 Nov, 2011

1 commit

  • * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
    Revert "tracing: Include module.h in define_trace.h"
    irq: don't put module.h into irq.h for tracking irqgen modules.
    bluetooth: macroize two small inlines to avoid module.h
    ip_vs.h: fix implicit use of module_get/module_put from module.h
    nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
    include: replace linux/module.h with "struct module" wherever possible
    include: convert various register fcns to macros to avoid include chaining
    crypto.h: remove unused crypto_tfm_alg_modname() inline
    uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
    pm_runtime.h: explicitly requires notifier.h
    linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
    miscdevice.h: fix up implicit use of lists and types
    stop_machine.h: fix implicit use of smp.h for smp_processor_id
    of: fix implicit use of errno.h in include/linux/of.h
    of_platform.h: delete needless include
    acpi: remove module.h include from platform/aclinux.h
    miscdevice.h: delete unnecessary inclusion of module.h
    device_cgroup.h: delete needless include
    net: sch_generic remove redundant use of
    net: inet_timewait_sock doesnt need
    ...

    Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in
    - drivers/media/dvb/frontends/dibx000_common.c
    - drivers/media/video/{mt9m111.c,ov6650.c}
    - drivers/mfd/ab3550-core.c
    - include/linux/dmaengine.h

    Linus Torvalds
     

01 Nov, 2011

1 commit


30 Oct, 2011

1 commit

  • The route lookup to find a previously auto-configured route for a prefixes used
    to use rt6_lookup(), with the prefix from the RA used as an address. However,
    that kind of lookup ignores routing tables, the prefix length and route flags,
    so when there were other matching routes, even in different tables and/or with
    a different prefix length, the wrong route would be manipulated.

    Now, a new function "addrconf_get_prefix_route()" is used for the route lookup,
    which searches in RT6_TABLE_PREFIX and takes the prefix-length and route flags
    into account.

    Signed-off-by: Andreas Hofmeister
    Signed-off-by: David S. Miller

    Andreas Hofmeister
     

22 Sep, 2011

1 commit

  • Conflicts:
    MAINTAINERS
    drivers/net/Kconfig
    drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
    drivers/net/ethernet/broadcom/tg3.c
    drivers/net/wireless/iwlwifi/iwl-pci.c
    drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c
    drivers/net/wireless/rt2x00/rt2800usb.c
    drivers/net/wireless/wl12xx/main.c

    David S. Miller
     

21 Sep, 2011

1 commit

  • When calling snmp6_alloc_dev fails, the snmp6 relevant memory
    are freed by snmp6_alloc_dev. Calling in6_dev_finish_destroy
    will free these memory twice.

    Double free will lead that undefined behavior occurs.

    Signed-off-by: Roy Li
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Roy Li
     

17 Sep, 2011

1 commit

  • This patch improves the logic determining when to send ICMPv6 Router
    Solicitations, so that they are 1) always sent when the kernel is
    accepting Router Advertisements, and 2) never sent when the kernel is
    not accepting RAs. In other words, the operational setting of the
    "accept_ra" sysctl is used.

    The change also makes the special "Hybrid Router" forwarding mode
    ("forwarding" sysctl set to 2) operate exactly the same as the standard
    Router mode (forwarding=1). The only difference between the two was
    that RSes was being sent in the Hybrid Router mode only. The sysctl
    documentation describing the special Hybrid Router mode has therefore
    been removed.

    Rationale for the change:

    Currently, the value of forwarding sysctl is the only thing determining
    whether or not to send RSes. If it has the value 0 or 2, they are sent,
    otherwise they are not. This leads to inconsistent behaviour in the
    following cases:

    * accept_ra=0, forwarding=0
    * accept_ra=0, forwarding=2
    * accept_ra=1, forwarding=2
    * accept_ra=2, forwarding=1

    In the first three cases, the kernel will send RSes, even though it will
    not accept any RAs received in reply. In the last case, it will not send
    any RSes, even though it will accept and process any RAs received. (Most
    routers will send unsolicited RAs periodically, so suppressing RSes in
    the last case will merely delay auto-configuration, not prevent it.)

    Also, it is my opinion that having the forwarding sysctl control RS
    sending behaviour (completely independent of whether RAs are being
    accepted or not) is simply not what most users would intuitively expect
    to be the case.

    Signed-off-by: Tore Anderson
    Signed-off-by: David S. Miller

    Tore Anderson
     

08 Aug, 2011

1 commit


03 Aug, 2011

1 commit

  • Gergely Kalman reported crashes in check_peer_redir().

    It appears commit f39925dbde778 (ipv4: Cache learned redirect
    information in inetpeer.) added a race, leading to possible NULL ptr
    dereference.

    Since we can now change dst neighbour, we should make sure a reader can
    safely use a neighbour.

    Add RCU protection to dst neighbour, and make sure check_peer_redir()
    can be called safely by different cpus in parallel.

    As neighbours are already freed after one RCU grace period, this patch
    should not add typical RCU penalty (cache cold effects)

    Many thanks to Gergely for providing a pretty report pointing to the
    bug.

    Reported-by: Gergely Kalman
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

02 Aug, 2011

2 commits

  • When assigning a NULL value to an RCU protected pointer, no barrier
    is needed. The rcu_assign_pointer, used to handle that but will soon
    change to not handle the special case.

    Convert all rcu_assign_pointer of NULL value.

    //smpl
    @@ expression P; @@

    - rcu_assign_pointer(P, NULL)
    + RCU_INIT_POINTER(P, NULL)

    //

    Signed-off-by: Stephen Hemminger
    Acked-by: Paul E. McKenney
    Signed-off-by: David S. Miller

    Stephen Hemminger
     
  • Update the code to handle some of the differences between
    RFC 3041 and RFC 4941, which obsoletes it. Also a couple
    of janitorial fixes.

    - Allow router advertisements to increase the lifetime of
    temporary addresses. This was not allowed by RFC 3041,
    but is specified by RFC 4941. It is useful when RA
    lifetimes are lower than TEMP_{VALID,PREFERRED}_LIFETIME:
    in this case, the previous code would delete or deprecate
    addresses prematurely.

    - Change the default of MAX_RETRY to 3 per RFC 4941.

    - Add a comment to clarify that the preferred and valid
    lifetimes in inet6_ifaddr are relative to the timestamp.

    - Shorten lines to 80 characters in a couple of places.

    Signed-off-by: Lorenzo Colitti
    Signed-off-by: David S. Miller

    Lorenzo Colitti
     

26 Jul, 2011

1 commit

  • Original commit 2bda8a0c8af... "Disable router anycast
    address for /127 prefixes" says:

    | No need for matching code in addrconf_leave_anycast() as it
    | will silently ignore any attempt to leave an unknown anycast
    | address.

    After analysis, because 1) we may add two or more prefixes on the
    same interface, or 2)user may have manually joined that anycast,
    we may hit chances to have anycast address which as if we had
    generated one by /127 prefix and we should not leave from subnet-
    router anycast address unconditionally.

    CC: Bjørn Mork
    CC: Brian Haley
    Signed-off-by: YOSHIFUJI Hideaki
    Signed-off-by: David S. Miller

    YOSHIFUJI Hideaki
     

18 Jul, 2011

2 commits


07 Jul, 2011

1 commit

  • RFC 6164 requires that routers MUST disable Subnet-Router anycast
    for the prefix when /127 prefixes are used.

    No need for matching code in addrconf_leave_anycast() as it
    will silently ignore any attempt to leave an unknown anycast
    address.

    Signed-off-by: Bjørn Mork
    Signed-off-by: David S. Miller

    Bjørn Mork
     

10 Jun, 2011

1 commit

  • The message size allocated for rtnl ifinfo dumps was limited to
    a single page. This is not enough for additional interface info
    available with devices that support SR-IOV and caused a bug in
    which VF info would not be displayed if more than approximately
    40 VFs were created per interface.

    Implement a new function pointer for the rtnl_register service that will
    calculate the amount of data required for the ifinfo dump and allocate
    enough data to satisfy the request.

    Signed-off-by: Greg Rose
    Signed-off-by: Jeff Kirsher

    Greg Rose
     

09 Jun, 2011

1 commit


21 May, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1446 commits)
    macvlan: fix panic if lowerdev in a bond
    tg3: Add braces around 5906 workaround.
    tg3: Fix NETIF_F_LOOPBACK error
    macvlan: remove one synchronize_rcu() call
    networking: NET_CLS_ROUTE4 depends on INET
    irda: Fix error propagation in ircomm_lmp_connect_response()
    irda: Kill set but unused variable 'bytes' in irlan_check_command_param()
    irda: Kill set but unused variable 'clen' in ircomm_connect_indication()
    rxrpc: Fix set but unused variable 'usage' in rxrpc_get_transport()
    be2net: Kill set but unused variable 'req' in lancer_fw_download()
    irda: Kill set but unused vars 'saddr' and 'daddr' in irlan_provider_connect_indication()
    atl1c: atl1c_resume() is only used when CONFIG_PM_SLEEP is defined.
    rxrpc: Fix set but unused variable 'usage' in rxrpc_get_peer().
    rxrpc: Kill set but unused variable 'local' in rxrpc_UDP_error_handler()
    rxrpc: Kill set but unused variable 'sp' in rxrpc_process_connection()
    rxrpc: Kill set but unused variable 'sp' in rxrpc_rotate_tx_window()
    pkt_sched: Kill set but unused variable 'protocol' in tc_classify()
    isdn: capi: Use pr_debug() instead of ifdefs.
    tg3: Update version to 3.119
    tg3: Apply rx_discards fix to 5719/5720
    ...

    Fix up trivial conflicts in arch/x86/Kconfig and net/mac80211/agg-tx.c
    as per Davem.

    Linus Torvalds
     

20 May, 2011

1 commit

  • ipv6 has per device ICMP SNMP counters, taking too much space because
    they use percpu storage.

    needed size per device is :
    (512+4)*sizeof(long)*number_of_possible_cpus*2

    On a 32bit kernel, 16 possible cpus, this wastes more than 64kbytes of
    memory per ipv6 enabled network device, taken in vmalloc pool.

    Since ICMP messages are rare, just use shared counters (atomic_long_t)

    Per network space ICMP counters are still using percpu memory, we might
    also convert them to shared counters in a future patch.

    Signed-off-by: Eric Dumazet
    CC: Denys Fedoryshchenko
    Signed-off-by: David S. Miller

    Eric Dumazet
     

08 May, 2011

2 commits


06 May, 2011

1 commit


03 May, 2011

1 commit


23 Apr, 2011

1 commit


16 Apr, 2011

1 commit


31 Mar, 2011

1 commit


26 Feb, 2011

1 commit


26 Jan, 2011

1 commit

  • This reverts the following set of commits:

    d1ed113f1669390da9898da3beddcc058d938587 ("ipv6: remove duplicate neigh_ifdown")
    29ba5fed1bbd09c2cba890798c8f9eaab251401d ("ipv6: don't flush routes when setting loopback down")
    9d82ca98f71fd686ef2f3017c5e3e6a4871b6e46 ("ipv6: fix missing in6_ifa_put in addrconf")
    2de795707294972f6c34bae9de713e502c431296 ("ipv6: addrconf: don't remove address state on ifdown if the address is being kept")
    8595805aafc8b077e01804c9a3668e9aa3510e89 ("IPv6: only notify protocols if address is compeletely gone")
    27bdb2abcc5edb3526e25407b74bf17d1872c329 ("IPv6: keep tentative addresses in hash table")
    93fa159abe50d3c55c7f83622d3f5c09b6e06f4b ("IPv6: keep route for tentative address")
    8f37ada5b5f6bfb4d251a7f510f249cb855b77b3 ("IPv6: fix race between cleanup and add/delete address")
    84e8b803f1e16f3a2b8b80f80a63fa2f2f8a9be6 ("IPv6: addrconf notify when address is unavailable")
    dc2b99f71ef477a31020511876ab4403fb7c4420 ("IPv6: keep permanent addresses on admin down")

    because the core semantic change to ipv6 address handling on ifdown
    has broken some things, in particular "disable_ipv6" sysctl handling.

    Stephen has made several attempts to get things back in working order,
    but nothing has restored disable_ipv6 fully yet.

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

    David S. Miller
     

19 Jan, 2011

1 commit

  • When a network namespace is created (via CLONE_NEWNET), the loopback
    interface is automatically added to the new namespace, triggering a
    printk in ipv6_add_dev() if CONFIG_IPV6_PRIVACY is set.

    This is problematic for applications which use CLONE_NEWNET as
    part of a sandbox, like Chromium's suid sandbox or recent versions of
    vsftpd. On a busy machine, it can lead to thousands of useless
    "lo: Disabled Privacy Extensions" messages appearing in dmesg.

    It's easy enough to check the status of privacy extensions via the
    use_tempaddr sysctl, so just removing the printk seems like the most
    sensible solution.

    Signed-off-by: Romain Francoise
    Signed-off-by: David S. Miller

    Romain Francoise
     

19 Dec, 2010

1 commit


18 Dec, 2010

1 commit