From patchwork Thu May 14 21:23:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 48541 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A2E4F2121F for ; Thu, 14 May 2015 21:23:20 +0000 (UTC) Received: by labgx2 with SMTP id gx2sf24258026lab.1 for ; Thu, 14 May 2015 14:23:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=xER/MGKvUSAzaAgOVe7isH8/t/rlMaf23L4hV7Mmah4=; b=VVOyK82CEUFauo7uMr18pENM8byMHFveOqbZF3089tEmBMyCiKRY7HLksSBgzG+IYq el9K5BuXREyPcnrxQdpYHwP+v6XHg6GaS7zYH5a5LQ4ZCWh+dyHrVUg2wc0QKTftLueS hihnKz2S1/vvOXGr4xPaTs8n3jdDY5ANwBh7lwBWlDT0SCulzeyR/DDcfgnI0xemTn8O 4tLMEI3u+agemrgc2MHTCDk3XuJFFnwvAl7MkcQmqnGxRSWmHQdYrcBJblP6C9VPyWMx 3gremzMsO5YnPn2cB7fsMUa1U+qwPvNq6ErlOk7TvwI1M62rsx+9ZfUxiqvRNNERNYdt jX+w== X-Gm-Message-State: ALoCoQkvdEEvOVw6Wj+F3S6Gm+B9YZcDDggVVDUoLbLDbEGaIho6OzESs3XIGG2t2ZMZ00D2YYPj X-Received: by 10.152.4.194 with SMTP id m2mr4397788lam.1.1431638599652; Thu, 14 May 2015 14:23:19 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.73 with SMTP id i9ls462827lai.100.gmail; Thu, 14 May 2015 14:23:19 -0700 (PDT) X-Received: by 10.153.7.104 with SMTP id db8mr4764696lad.124.1431638599503; Thu, 14 May 2015 14:23:19 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id zl2si15326005lbb.55.2015.05.14.14.23.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 May 2015 14:23:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by lagr1 with SMTP id r1so6074123lag.0 for ; Thu, 14 May 2015 14:23:19 -0700 (PDT) X-Received: by 10.152.36.161 with SMTP id r1mr1262028laj.88.1431638599328; Thu, 14 May 2015 14:23:19 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1537682lbb; Thu, 14 May 2015 14:23:18 -0700 (PDT) X-Received: by 10.55.49.147 with SMTP id x141mr13671119qkx.23.1431638598138; Thu, 14 May 2015 14:23:18 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h63si3286063qhc.5.2015.05.14.14.23.16; Thu, 14 May 2015 14:23:18 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 8576761D31; Thu, 14 May 2015 21:23:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 1BBC761D0D; Thu, 14 May 2015 21:23:15 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 668A861D19; Thu, 14 May 2015 21:23:13 +0000 (UTC) Received: from mail-qc0-f173.google.com (mail-qc0-f173.google.com [209.85.216.173]) by lists.linaro.org (Postfix) with ESMTPS id 7450261D0D for ; Thu, 14 May 2015 21:23:12 +0000 (UTC) Received: by qcvo8 with SMTP id o8so47223380qcv.0 for ; Thu, 14 May 2015 14:23:12 -0700 (PDT) X-Received: by 10.140.195.14 with SMTP id q14mr8616381qha.78.1431638592189; Thu, 14 May 2015 14:23:12 -0700 (PDT) Received: from mike-desktop.?.holmesfamily.ws (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by mx.google.com with ESMTPSA id t32sm183467qgd.21.2015.05.14.14.23.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 May 2015 14:23:11 -0700 (PDT) From: Mike Holmes To: bala.manoharan@linaro.org Date: Thu, 14 May 2015 17:23:05 -0400 Message-Id: <1431638585-13524-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.4 X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCH] example: classifier: check for null token X-BeenThere: lng-odp@lists.linaro.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: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mike.holmes@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 fixes https://bugs.linaro.org/show_bug.cgi?id=1534 Signed-off-by: Mike Holmes Reviewed-by: Balasubramanian Manoharan --- The case sudo ./example/classifier/odp_classifier -i eth0 -m 0 -p "" now returns odp_classifier.c:599:parse_pmr_policy():Invalid ODP_PMR_TERM string example/classifier/odp_classifier.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index d78eb7b..3cc6738 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -559,6 +559,9 @@ static void swap_pkt_addrs(odp_packet_t pkt_tbl[], unsigned len) static int convert_str_to_pmr_enum(char *token, odp_pmr_term_e *term) { + if (NULL == token) + return -1; + if (0 == strcasecmp(token, "ODP_PMR_SIP_ADDR")) { *term = ODP_PMR_SIP_ADDR; return 0;