1. 27 1月, 2019 4 次提交
  2. 26 1月, 2019 5 次提交
  3. 25 1月, 2019 4 次提交
  4. 24 1月, 2019 1 次提交
    • G
      tipc: mark expected switch fall-throughs · f79e3365
      Gustavo A. R. Silva 提交于
      In preparation to enabling -Wimplicit-fallthrough, mark switch cases
      where we are expecting to fall through.
      
      This patch fixes the following warnings:
      
      net/tipc/link.c:1125:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
      net/tipc/socket.c:736:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
      net/tipc/socket.c:2418:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
      
      Warning level 3 was used: -Wimplicit-fallthrough=3
      
      This patch is part of the ongoing efforts to enabling
      -Wimplicit-fallthrough.
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f79e3365
  5. 23 1月, 2019 9 次提交
    • N
      devlink: Use DIV_ROUND_UP_ULL in DEVLINK_HEALTH_SIZE_TO_BUFFERS · 33a0efa4
      Nathan Chancellor 提交于
      When building this code on a 32-bit platform such as ARM, there is a
      link time error (lld error shown, happpens with ld.bfd too):
      
      ld.lld: error: undefined symbol: __aeabi_uldivmod
      >>> referenced by devlink.c
      >>>               net/core/devlink.o:(devlink_health_buffers_create) in archive built-in.a
      
      This happens when using a regular division symbol with a u64 dividend.
      Use DIV_ROUND_UP_ULL, which wraps do_div, to avoid this situation.
      
      Fixes: cb5ccfbe ("devlink: Add health buffer support")
      Signed-off-by: NNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      33a0efa4
    • Y
      devlink: Add missing check of nlmsg_put · ed175d9c
      YueHaibing 提交于
      nlmsg_put may fail, this fix add a check of its return value.
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ed175d9c
    • L
      bridge: Snoop Multicast Router Advertisements · 4b3087c7
      Linus Lüssing 提交于
      When multiple multicast routers are present in a broadcast domain then
      only one of them will be detectable via IGMP/MLD query snooping. The
      multicast router with the lowest IP address will become the selected and
      active querier while all other multicast routers will then refrain from
      sending queries.
      
      To detect such rather silent multicast routers, too, RFC4286
      ("Multicast Router Discovery") provides a standardized protocol to
      detect multicast routers for multicast snooping switches.
      
      This patch implements the necessary MRD Advertisement message parsing
      and after successful processing adds such routers to the internal
      multicast router list.
      Signed-off-by: NLinus Lüssing <linus.luessing@c0d3.blue>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4b3087c7
    • L
      bridge: join all-snoopers multicast address · 4effd28c
      Linus Lüssing 提交于
      Next to snooping IGMP/MLD queries RFC4541, section 2.1.1.a) recommends
      to snoop multicast router advertisements to detect multicast routers.
      
      Multicast router advertisements are sent to an "all-snoopers"
      multicast address. To be able to receive them reliably, we need to
      join this group.
      
      Otherwise other snooping switches might refrain from forwarding these
      advertisements to us.
      Signed-off-by: NLinus Lüssing <linus.luessing@c0d3.blue>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4effd28c
    • L
      bridge: simplify ip_mc_check_igmp() and ipv6_mc_check_mld() internals · a2e2ca3b
      Linus Lüssing 提交于
      With this patch the internal use of the skb_trimmed is reduced to
      the ICMPv6/IGMP checksum verification. And for the length checks
      the newly introduced helper functions are used instead of calculating
      and checking with skb->len directly.
      
      These changes should hopefully make it easier to verify that length
      checks are performed properly.
      Signed-off-by: NLinus Lüssing <linus.luessing@c0d3.blue>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a2e2ca3b
    • L
      bridge: simplify ip_mc_check_igmp() and ipv6_mc_check_mld() calls · ba5ea614
      Linus Lüssing 提交于
      This patch refactors ip_mc_check_igmp(), ipv6_mc_check_mld() and
      their callers (more precisely, the Linux bridge) to not rely on
      the skb_trimmed parameter anymore.
      
      An skb with its tail trimmed to the IP packet length was initially
      introduced for the following three reasons:
      
      1) To be able to verify the ICMPv6 checksum.
      2) To be able to distinguish the version of an IGMP or MLD query.
         They are distinguishable only by their size.
      3) To avoid parsing data for an IGMPv3 or MLDv2 report that is
         beyond the IP packet but still within the skb.
      
      The first case still uses a cloned and potentially trimmed skb to
      verfiy. However, there is no need to propagate it to the caller.
      For the second and third case explicit IP packet length checks were
      added.
      
      This hopefully makes ip_mc_check_igmp() and ipv6_mc_check_mld() easier
      to read and verfiy, as well as easier to use.
      Signed-off-by: NLinus Lüssing <linus.luessing@c0d3.blue>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ba5ea614
    • A
      net/tls: free ctx in sock destruct · 76f7164d
      Atul Gupta 提交于
      free tls context in sock destruct. close may not be the last
      call to free sock but force releasing the ctx in close
      will result in GPF when ctx referred again in tcp_done
      
      [  515.330477] general protection fault: 0000 [#1] SMP PTI
      [  515.330539] CPU: 5 PID: 0 Comm: swapper/5 Not tainted 4.20.0-rc7+ #10
      [  515.330657] Hardware name: Supermicro X8ST3/X8ST3, BIOS 2.0b
      11/07/2013
      [  515.330844] RIP: 0010:tls_hw_unhash+0xbf/0xd0
      [
      [  515.332220] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  515.332340] CR2: 00007fab32c55000 CR3: 000000009261e000 CR4:
      00000000000006e0
      [  515.332519] Call Trace:
      [  515.332632]  <IRQ>
      [  515.332793]  tcp_set_state+0x5a/0x190
      [  515.332907]  ? tcp_update_metrics+0xe3/0x350
      [  515.333023]  tcp_done+0x31/0xd0
      [  515.333130]  tcp_rcv_state_process+0xc27/0x111a
      [  515.333242]  ? __lock_is_held+0x4f/0x90
      [  515.333350]  ? tcp_v4_do_rcv+0xaf/0x1e0
      [  515.333456]  tcp_v4_do_rcv+0xaf/0x1e0
      Signed-off-by: NAtul Gupta <atul.gupta@chelsio.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      76f7164d
    • A
      net/tls: build_protos moved to common routine · 63a6b3fe
      Atul Gupta 提交于
      build protos is required for tls_hw_prot also hence moved to
      'tls_build_proto' and called as required from tls_init
      and tls_hw_proto. This is required since build_protos
      for v4 is moved from tls_register to tls_init in
      commit <28cb6f1e>
      Signed-off-by: NAtul Gupta <atul.gupta@chelsio.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      63a6b3fe
    • C
      net: introduce a knob to control whether to inherit devconf config · 856c395c
      Cong Wang 提交于
      There have been many people complaining about the inconsistent
      behaviors of IPv4 and IPv6 devconf when creating new network
      namespaces.  Currently, for IPv4, we inherit all current settings
      from init_net, but for IPv6 we reset all setting to default.
      
      This patch introduces a new /proc file
      /proc/sys/net/core/devconf_inherit_init_net to control the
      behavior of whether to inhert sysctl current settings from init_net.
      This file itself is only available in init_net.
      
      As demonstrated below:
      
      Initial setup in init_net:
       # cat /proc/sys/net/ipv4/conf/all/rp_filter
       2
       # cat /proc/sys/net/ipv6/conf/all/accept_dad
       1
      
      Default value 0 (current behavior):
       # ip netns del test
       # ip netns add test
       # ip netns exec test cat /proc/sys/net/ipv4/conf/all/rp_filter
       2
       # ip netns exec test cat /proc/sys/net/ipv6/conf/all/accept_dad
       0
      
      Set to 1 (inherit from init_net):
       # echo 1 > /proc/sys/net/core/devconf_inherit_init_net
       # ip netns del test
       # ip netns add test
       # ip netns exec test cat /proc/sys/net/ipv4/conf/all/rp_filter
       2
       # ip netns exec test cat /proc/sys/net/ipv6/conf/all/accept_dad
       1
      
      Set to 2 (reset to default):
       # echo 2 > /proc/sys/net/core/devconf_inherit_init_net
       # ip netns del test
       # ip netns add test
       # ip netns exec test cat /proc/sys/net/ipv4/conf/all/rp_filter
       0
       # ip netns exec test cat /proc/sys/net/ipv6/conf/all/accept_dad
       0
      
      Set to a value out of range (invalid):
       # echo 3 > /proc/sys/net/core/devconf_inherit_init_net
       -bash: echo: write error: Invalid argument
       # echo -1 > /proc/sys/net/core/devconf_inherit_init_net
       -bash: echo: write error: Invalid argument
      Reported-by: NZhu Yanjun <Yanjun.Zhu@windriver.com>
      Reported-by: NTonghao Zhang <xiangxia.m.yue@gmail.com>
      Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Acked-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
      Acked-by: NTonghao Zhang <xiangxia.m.yue@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      856c395c
  6. 22 1月, 2019 1 次提交
  7. 20 1月, 2019 16 次提交