From patchwork Thu Jun 13 17:20:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philipp_Sch=C3=B6nberger?= X-Patchwork-Id: 251119 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id BC2A32C0079 for ; Fri, 14 Jun 2013 03:20:57 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757625Ab3FMRUy (ORCPT ); Thu, 13 Jun 2013 13:20:54 -0400 Received: from mail-qe0-f50.google.com ([209.85.128.50]:60627 "EHLO mail-qe0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756333Ab3FMRUx convert rfc822-to-8bit (ORCPT ); Thu, 13 Jun 2013 13:20:53 -0400 Received: by mail-qe0-f50.google.com with SMTP id f6so6728482qej.9 for ; Thu, 13 Jun 2013 10:20:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=YNEv4mKsgKX7Jfd7JtcIi8UIIdzV0lu46CqMs3caenE=; b=AMc1rDPHoxUg5xm91ResgrwNyVRYPG0JxL4SPt4T2yrzPPEUDRwd4oJxCFjrumROaO ly3FgJ/YcUdj9G4XQiC3hpz+sls3c9SYEMbrXZFVcaT5hsX55XnIV6FzU2R7uy7/ywvV amaAb9A0aWqR5PUXHVLyFEU4T9YMFEWRXcDf0B1j9m/TSAn5hsTepTCF3QMeyN3NHjY2 fIoRAUpN/37dGS62iDjyuwDIi8WUCiB1K4iI5IWrjcRmeUdsHRklGlOHQ54X4Cr1pe/U 1B1tGUVqicaS3WiNhT+NilyBPtoMAV+n2hSff/I8k1YqnkwNOrHHIIGQ1Rnhu1xRDkAr TUqQ== MIME-Version: 1.0 X-Received: by 10.224.53.68 with SMTP id l4mr4130607qag.93.1371144052307; Thu, 13 Jun 2013 10:20:52 -0700 (PDT) Received: by 10.224.198.1 with HTTP; Thu, 13 Jun 2013 10:20:52 -0700 (PDT) Date: Thu, 13 Jun 2013 19:20:52 +0200 Message-ID: Subject: [iproute2 PATCH] tc: handle is not used without containing ':' From: =?ISO-8859-1?Q?Philipp_Sch=F6nberger?= To: netdev@vger.kernel.org Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Handle is not used if it is not containing a ':' . This is reproducible with these commands. /sbin/tc qdisc add dev lo parent 0xffffffff handle 0x10000 pfifo limit 10 /sbin/tc qdisc show dev lo qdisc pfifo 8001: root refcnt 2 limit 10p Signed-off-by: Philipp Schönberger --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- iproute2-2.6.33/tc/tc_util.c 2010-02-25 04:56:50.000000000 +0100 +++ /home/pschoen/tc_util.c 2013-06-13 18:31:00.347135625 +0200 @@ -50,9 +50,14 @@ maj = strtoul(str, &p, 16); if (p == str) return -1; - maj <<= 16; - if (*p != ':' && *p!=0) - return -1; + if (*p != ':') + { + if(*p!=0) + return -1; + else if (TC_H_MIN(maj) != 0) + return -1; + }else + maj <<= 16; ok: *h = maj; return 0;