1. 13 11月, 2018 5 次提交
    • C
      net: phy: check if advertising is zero using linkmode_empty · 3e536cff
      Colin Ian King 提交于
      A recent change modified variable advertising from a u32 to a link mode
      array and left the u32 zero comparison, so essential we now have an array
      being compared to null which is not the intention. Fix this by using the
      call to linkmode_empty to check if advertising is all zero.
      
      Detected by CoverityScan, CID#1475424 ("Array compared against 0")
      
      Fixes: 3c1bcc86 ("net: ethernet: Convert phydev advertize and supported from u32 to link mode")
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3e536cff
    • D
      Merge branch 'sctp-add-support-for-sk_reuseport' · 261501d9
      David S. Miller 提交于
      Xin Long says:
      
      ====================
      sctp: add support for sk_reuseport
      
      sctp sk_reuseport allows multiple socks to listen on the same port and
      addresses, as long as these socks have the same uid. This works pretty
      much as TCP/UDP does, the only difference is that sctp is multi-homing
      and all the bind_addrs in these socks will have to completely matched,
      otherwise listen() will return err.
      
      The below is when 5 sockets are listening on 172.16.254.254:6400 on a
      server, 26 sockets on a client connect to 172.16.254.254:6400 and each
      may be processed by a different socket on the server which is selected
      by hash(lport, pport, paddr) in reuseport_select_sock():
      
       # ss --sctp -nn
         State      Recv-Q Send-Q        Local Address:Port     Peer Address:Port
         LISTEN     0      10           172.16.254.254:6400                *:*
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.2.1:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.2.4:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.3.3:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.3.4:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.5.2:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.5.3:1234
         LISTEN     0      10           172.16.254.254:6400                *:*
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.1.3:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.1.4:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.3.2:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.4.1:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.4.2:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.4.3:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.4.4:1234
         LISTEN     0      10           172.16.254.254:6400                *:*
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.1.2:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.3.5:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.4.5:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400   172.16.253.253:1234
         LISTEN     0      10           172.16.254.254:6400                *:*
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.2.2:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.2.3:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.5.4:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.5.5:1234
         LISTEN     0      10           172.16.254.254:6400                *:*
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.1.1:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.1.5:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.2.5:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.3.1:1234
         `- ESTAB   0      0       172.16.254.254%eth1:6400       172.16.5.1:1234
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      261501d9
    • X
      sctp: process sk_reuseport in sctp_get_port_local · 6ba84574
      Xin Long 提交于
      When socks' sk_reuseport is set, the same port and address are allowed
      to be bound into these socks who have the same uid.
      
      Note that the difference from sk_reuse is that it allows multiple socks
      to listen on the same port and address.
      Acked-by: NNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6ba84574
    • X
      sctp: add sock_reuseport for the sock in __sctp_hash_endpoint · 76c6d988
      Xin Long 提交于
      This is a part of sk_reuseport support for sctp. It defines a helper
      sctp_bind_addrs_check() to check if the bind_addrs in two socks are
      matched. It will add sock_reuseport if they are completely matched,
      and return err if they are partly matched, and alloc sock_reuseport
      if all socks are not matched at all.
      
      It will work until sk_reuseport support is added in
      sctp_get_port_local() in the next patch.
      
      v1->v2:
        - use 'laddr->valid && laddr2->valid' check instead as Marcelo
          pointed in sctp_bind_addrs_check().
      Acked-by: NNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      76c6d988
    • X
      sctp: do reuseport_select_sock in __sctp_rcv_lookup_endpoint · 532ae2f1
      Xin Long 提交于
      This is a part of sk_reuseport support for sctp, and it selects a
      sock by the hashkey of lport, paddr and dport by default. It will
      work until sk_reuseport support is added in sctp_get_port_local()
      in the next patch.
      
      v1->v2:
        - define lport as __be16 instead of __be32 as Marcelo pointed in
          __sctp_rcv_lookup_endpoint().
      Acked-by: NNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      532ae2f1
  2. 12 11月, 2018 35 次提交