1. 22 6月, 2011 2 次提交
    • X
      ipv6/udp: Use the correct variable to determine non-blocking condition · 32c90254
      Xufeng Zhang 提交于
      udpv6_recvmsg() function is not using the correct variable to determine
      whether or not the socket is in non-blocking operation, this will lead
      to unexpected behavior when a UDP checksum error occurs.
      
      Consider a non-blocking udp receive scenario: when udpv6_recvmsg() is
      called by sock_common_recvmsg(), MSG_DONTWAIT bit of flags variable in
      udpv6_recvmsg() is cleared by "flags & ~MSG_DONTWAIT" in this call:
      
          err = sk->sk_prot->recvmsg(iocb, sk, msg, size, flags & MSG_DONTWAIT,
                         flags & ~MSG_DONTWAIT, &addr_len);
      
      i.e. with udpv6_recvmsg() getting these values:
      
      	int noblock = flags & MSG_DONTWAIT
      	int flags = flags & ~MSG_DONTWAIT
      
      So, when udp checksum error occurs, the execution will go to
      csum_copy_err, and then the problem happens:
      
          csum_copy_err:
                  ...............
                  if (flags & MSG_DONTWAIT)
                          return -EAGAIN;
                  goto try_again;
                  ...............
      
      But it will always go to try_again as MSG_DONTWAIT has been cleared
      from flags at call time -- only noblock contains the original value
      of MSG_DONTWAIT, so the test should be:
      
                  if (noblock)
                          return -EAGAIN;
      
      This is also consistent with what the ipv4/udp code does.
      Signed-off-by: NXufeng Zhang <xufeng.zhang@windriver.com>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      32c90254
    • R
      netconsole: fix build when CONFIG_NETCONSOLE_DYNAMIC is turned on · 58fa4597
      Randy Dunlap 提交于
      When NETCONSOLE_DYNAMIC=y and CONFIGFS_FS=m, there are build errors
      in netconsole:
      
      drivers/built-in.o: In function `drop_netconsole_target':
      netconsole.c:(.text+0x1a100f): undefined reference to `config_item_put'
      drivers/built-in.o: In function `make_netconsole_target':
      netconsole.c:(.text+0x1a10b9): undefined reference to `config_item_init_type_name'
      drivers/built-in.o: In function `write_msg':
      netconsole.c:(.text+0x1a11a4): undefined reference to `config_item_get'
      netconsole.c:(.text+0x1a1211): undefined reference to `config_item_put'
      drivers/built-in.o: In function `netconsole_netdev_event':
      netconsole.c:(.text+0x1a12cc): undefined reference to `config_item_put'
      netconsole.c:(.text+0x1a12ec): undefined reference to `config_item_get'
      netconsole.c:(.text+0x1a1366): undefined reference to `config_item_put'
      drivers/built-in.o: In function `init_netconsole':
      netconsole.c:(.init.text+0x953a): undefined reference to `config_group_init'
      netconsole.c:(.init.text+0x9560): undefined reference to `configfs_register_subsystem'
      drivers/built-in.o: In function `dynamic_netconsole_exit':
      netconsole.c:(.exit.text+0x809): undefined reference to `configfs_unregister_subsystem'
      
      so fix the NETCONSOLE_DYNAMIC depends clause to prevent this.
      Based on email suggestion from Ben Hutchings.  Thanks.
      
      Fixes https://bugzilla.kernel.org/show_bug.cgi?id=37992Reported-by: NDavid Hill <hilld@binarystorm.net>
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Cc: Ben Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      58fa4597
  2. 21 6月, 2011 13 次提交
  3. 20 6月, 2011 25 次提交