From patchwork Sun Jul 17 08:56:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 982992 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6H8xePS023907 for ; Sun, 17 Jul 2011 08:59:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754149Ab1GQI7h (ORCPT ); Sun, 17 Jul 2011 04:59:37 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:63499 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754101Ab1GQI7g (ORCPT ); Sun, 17 Jul 2011 04:59:36 -0400 Received: by mail-iw0-f174.google.com with SMTP id 6so2294615iwn.19 for ; Sun, 17 Jul 2011 01:59:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=6Dq47zfHRoAAAt6hNNbFf4xG0DI3vv3sYfj4TtOYaZw=; b=CfFH9BxmjDHN11OwSAUw35aGAL+Xtuy1Ji6wlt2XvCLeKz1koYGfznzmZdntFzfSFG eUe/zht5KHwtLhN4fSomcj9LEx4JmBEGGI1gTBm5qS36jmzKfl19hNLIp9c0TRId4iLF 5UmkPxvuNqrztdyMHBdhZ3B6hW4JS1DM3VnhE= Received: by 10.42.73.4 with SMTP id q4mr5769542icj.156.1310893176524; Sun, 17 Jul 2011 01:59:36 -0700 (PDT) Received: from localhost.localdomain ([219.224.169.130]) by mx.google.com with ESMTPS id us2sm3593680icb.19.2011.07.17.01.59.33 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 17 Jul 2011 01:59:35 -0700 (PDT) From: Asias He To: Pekka Enberg Cc: Cyrill Gorcunov , Ingo Molnar , Sasha Levin , Prasad Joshi , kvm@vger.kernel.org, Asias He Subject: [PATCH 11/16] kvm tools: Handle DHCP package in gernal UDP processing path Date: Sun, 17 Jul 2011 16:56:59 +0800 Message-Id: <1310893024-21615-12-git-send-email-asias.hejun@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1310893024-21615-1-git-send-email-asias.hejun@gmail.com> References: <1310893024-21615-1-git-send-email-asias.hejun@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 17 Jul 2011 08:59:40 +0000 (UTC) DHCP packages are handled by the hypervisor, they are not sent to remote servers. In contrast, all other non-DHCP UDP packages are sent to remote servers. Signed-off-by: Asias He --- tools/kvm/net/uip/udp.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/tools/kvm/net/uip/udp.c b/tools/kvm/net/uip/udp.c index fcd5018..39c2b57 100644 --- a/tools/kvm/net/uip/udp.c +++ b/tools/kvm/net/uip/udp.c @@ -210,6 +210,11 @@ int uip_tx_do_ipv4_udp(struct uip_tx_arg *arg) ip = (struct uip_ip *)(arg->eth); info = arg->info; + if (uip_udp_is_dhcp(udp)) { + uip_tx_do_ipv4_udp_dhcp(arg); + return 0; + } + /* * Find socket we have allocated before, otherwise allocate one */