From patchwork Mon Oct 12 17:10:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 529252 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (li376-54.members.linode.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 1C50B140DAA for ; Tue, 13 Oct 2015 04:10:40 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 3EB1C10547; Mon, 12 Oct 2015 10:10:39 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v1.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id E23CE10539 for ; Mon, 12 Oct 2015 10:10:37 -0700 (PDT) Received: from bar3.cudamail.com (bar1 [192.168.15.1]) by mx3v1.cudamail.com (Postfix) with ESMTP id A28E6618260 for ; Mon, 12 Oct 2015 11:10:36 -0600 (MDT) X-ASG-Debug-ID: 1444669835-03dd7b7d40168650001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar3.cudamail.com with ESMTP id LBzy7y2uFd9qiEiR (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 12 Oct 2015 11:10:35 -0600 (MDT) X-Barracuda-Envelope-From: blp@nicira.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO mail-pa0-f49.google.com) (209.85.220.49) by mx3-pf2.cudamail.com with ESMTPS (RC4-SHA encrypted); 12 Oct 2015 17:10:33 -0000 Received-SPF: unknown (mx3-pf2.cudamail.com: Multiple SPF records returned) X-Barracuda-RBL-Trusted-Forwarder: 209.85.220.49 Received: by padhy16 with SMTP id hy16so158723886pad.1 for ; Mon, 12 Oct 2015 10:10:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=B0jrrZLXSpcamcO6ubtIRQ21EdAgJHgW/joh3p0t1s4=; b=DOIuOHjSPWU8XwiszljNPGO/Oci0UPiu7L5V0FBnmkqAIdvvcfBkpPuOMYgm3tP5jx Z90I9GzBxMoZqavDpucq33YL1R40dokr4k5qs38jyOFfMdDQfeQrW4lAxftz3sQ9G6go M2EFWjl6ZnuHgDmiStr0lNqrfl/RsQNFGU2F13Cqw9YVAz4C8BFzSmeUAV1KBu7RkgBe dNs0IkLznd6+C10chtDnVQ9yeiARPCO7IYMoOnfzYxCdS1EbAHEeS6idZ1g0okzNrqSA WWjlexB8T+jJwZsQ895079zF5DbCeXBs88N6L+Ji/RS62I/HmxyvOp2fAPripONnst1F jgpw== X-Gm-Message-State: ALoCoQk2ZRxVV3i1F1T9dH1rSRl2vLml2+HNQ+Qg7+6a1sBSkf3nIXAUC0SrF6LpOx20gUQ5lZ81 X-Received: by 10.66.121.137 with SMTP id lk9mr21071724pab.87.1444669833682; Mon, 12 Oct 2015 10:10:33 -0700 (PDT) Received: from sigabrt.benpfaff.org ([208.91.2.4]) by smtp.gmail.com with ESMTPSA id qy5sm19408970pbb.16.2015.10.12.10.10.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Oct 2015 10:10:32 -0700 (PDT) X-CudaMail-Envelope-Sender: blp@nicira.com X-Barracuda-Apparent-Source-IP: 208.91.2.4 From: Ben Pfaff To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V2-1011035087 X-CudaMail-DTE: 101215 X-CudaMail-Originating-IP: 209.85.220.49 Date: Mon, 12 Oct 2015 10:10:27 -0700 X-ASG-Orig-Subj: [##CM-V2-1011035087##][PATCH] ofp-util: Reject bad group type and command with error instead of abort. Message-Id: <1444669827-5198-1-git-send-email-blp@nicira.com> X-Mailer: git-send-email 2.1.3 X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1444669835 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Cc: Ben Pfaff , Manpreet Singh Subject: [ovs-dev] [PATCH] ofp-util: Reject bad group type and command with error instead of abort. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Signed-off-by: Ben Pfaff Reported-by: Manpreet Singh Reported-at: http://openvswitch.org/pipermail/discuss/2015-October/019048.html Reviewed-by: Simon Horman --- AUTHORS | 1 + lib/ofp-util.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 99bcf60..8123f43 100644 --- a/AUTHORS +++ b/AUTHORS @@ -310,6 +310,7 @@ Len Gao leng@vmware.com Logan Rosen logatronico@gmail.com Luca Falavigna dktrkranz@debian.org Luiz Henrique Ozaki luiz.ozaki@gmail.com +Manpreet Singh er.manpreet25@gmail.com Marco d'Itri md@Linux.IT Martin Vizvary vizvary@ics.muni.cz Marvin Pascual marvin@pascual.com.ph diff --git a/lib/ofp-util.c b/lib/ofp-util.c index b9dbcda..f0f6319 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -8679,7 +8679,7 @@ ofputil_decode_group_mod(const struct ofp_header *oh, case OFPGT11_FF: break; default: - OVS_NOT_REACHED(); + return OFPERR_OFPGMFC_BAD_TYPE; } switch (gm->command) { @@ -8694,7 +8694,7 @@ ofputil_decode_group_mod(const struct ofp_header *oh, } break; default: - OVS_NOT_REACHED(); + return OFPERR_OFPGMFC_BAD_COMMAND; } LIST_FOR_EACH (bucket, list_node, &gm->buckets) {