From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cong Wang Subject: Re: broken behaviour of TC filter delete Date: Fri, 24 Aug 2018 11:11:07 -0700 Message-ID: References: <851sao225x.fsf@mojatatu.com> <20180824081751.GA2931@nanopsycho> <85sh33zqkh.fsf@mojatatu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Jiri Pirko , Linux Kernel Network Developers , Jiri Pirko , Jamal Hadi Salim To: Roman Mashak Return-path: Received: from mail-pf1-f172.google.com ([209.85.210.172]:43121 "EHLO mail-pf1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726484AbeHXVrB (ORCPT ); Fri, 24 Aug 2018 17:47:01 -0400 Received: by mail-pf1-f172.google.com with SMTP id j26-v6so4885361pfi.10 for ; Fri, 24 Aug 2018 11:11:19 -0700 (PDT) In-Reply-To: <85sh33zqkh.fsf@mojatatu.com> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, Aug 24, 2018 at 9:21 AM Roman Mashak wrote: > > So _before_ commit f71e0ca4db187af7c44987e9d21e9042c3046070 step 6 would > return -ENOENT with "Error: Filter with specified priority/protocol not > found." and _after_ the commit it returns -EINVAL (Error: Cannot find > specified filter chain.) > > ENOENT seems to be more logical to return when there's no more filter to delete. Yeah, at least we should keep ENOENT for compatibility. The bug here is chain 0 is gone after the last filter is gone, so when you delete the filter again, it treats it as you specify chain 0 which does not exist, so it hits EINVAL before ENOENT. I am not sure how to fix this properly.