Skip to content
Snippets Groups Projects
  1. Jan 25, 2021
    • Markus Carlstedt's avatar
      net: checksum: Skip fragmented IP packets · 0dcf0c0a
      Markus Carlstedt authored
      
      To calculate the TCP/UDP checksum we need the whole datagram. Unless
      the hardware has some logic to collect all fragments before sending
      the whole datagram first, it can only be done by the network stack,
      which is normally the case for the NICs we have seen so far.
      
      Skip these fragmented IP packets to avoid checksum corruption.
      
      Signed-off-by: default avatarMarkus Carlstedt <markus.carlstedt@windriver.com>
      Signed-off-by: default avatarBin Meng <bin.meng@windriver.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      0dcf0c0a
    • Markus Armbruster's avatar
      net: Fix handling of id in netdev_add and netdev_del · 831734cc
      Markus Armbruster authored
      
      CLI -netdev accumulates in option group "netdev".
      
      Before commit 08712fcb "net: Track netdevs in NetClientState rather
      than QemuOpt", netdev_add added to the option group, and netdev_del
      removed from it, both HMP and QMP.  Thus, every netdev had a
      corresponding QemuOpts in this option group.
      
      Commit 08712fcb dropped this for QMP netdev_add and both netdev_del.
      Now a netdev has a corresponding QemuOpts only when it was created
      with CLI or HMP.  Two issues:
      
      * QMP and HMP netdev_del can leave QemuOpts behind, breaking HMP
        netdev_add.  Reproducer:
      
          $ qemu-system-x86_64 -S -display none -nodefaults -monitor stdio
          QEMU 5.1.92 monitor - type 'help' for more information
          (qemu) netdev_add user,id=net0
          (qemu) info network
          net0: index=0,type=user,net=10.0.2.0,restrict=off
          (qemu) netdev_del net0
          (qemu) info network
          (qemu) netdev_add user,id=net0
          upstream-qemu: Duplicate ID 'net0' for netdev
          Try "help netdev_add" for more information
      
        Fix by restoring the QemuOpts deletion in qmp_netdev_del(), but with
        a guard, because the QemuOpts need not exist.
      
      * QMP netdev_add loses its "no duplicate ID" check.  Reproducer:
      
          $ qemu-system-x86_64 -S -display none -qmp stdio
          {"QMP": {"version": {"qemu": {"micro": 92, "minor": 1, "major": 5}, "package": "v5.2.0-rc2-1-g02c1f0142c"}, "capabilities": ["oob"]}}
          {"execute": "qmp_capabilities"}
          {"return": {}}
          {"execute": "netdev_add", "arguments": {"type": "user", "id":"net0"}}
          {"return": {}}
          {"execute": "netdev_add", "arguments": {"type": "user", "id":"net0"}}
          {"return": {}}
      
        Fix by adding a duplicate ID check to net_client_init1() to replace
        the lost one.  The check is redundant for callers where QemuOpts
        still checks, i.e. for CLI and HMP.
      
      Reported-by: default avatarAndrew Melnichenko <andrew@daynix.com>
      Fixes: 08712fcb
      Cc: qemu-stable@nongnu.org
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      831734cc
  2. Jan 23, 2021
  3. Jan 22, 2021
  4. Jan 21, 2021
Loading