From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752322AbcG2TKX (ORCPT ); Fri, 29 Jul 2016 15:10:23 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:33795 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750903AbcG2TKQ (ORCPT ); Fri, 29 Jul 2016 15:10:16 -0400 Subject: Re: [Regression?] fib_rules: Added NLM_F_EXCL support to fib_nl_newrule breaks Android userspace To: John Stultz References: <20160728.212031.549387302791502368.davem@davemloft.net> <5ff19cc3-e607-282d-853a-410b985f8756@cumulusnetworks.com> Cc: David Miller , Mateusz Bajorski , lkml , Guodong Xu , Dmitry Shmidt , Chih-Hung Hsieh , Eric Caruso , Lorenzo Colitti From: David Ahern Message-ID: <54c59314-8f0e-542d-93e6-7953cbcd430e@cumulusnetworks.com> Date: Fri, 29 Jul 2016 13:10:10 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/29/16 10:57 AM, John Stultz wrote: >> I take Android userspace inserts the same rule multiple times? (ip rule ls) > > With the patch reverted, and the system working, I see: > > # ip rule ls > 0: from all lookup local > 10000: from all fwmark 0xc0000/0xd0000 lookup legacy_system > 13000: from all fwmark 0x10063/0x1ffff lookup local_network > 13000: from all fwmark 0x10065/0x1ffff lookup wlan0 > 14000: from all oif wlan0 lookup wlan0 > 14000: from all oif wlan0 lookup wlan0 duplicate rules. > 15000: from all fwmark 0x0/0x10000 lookup legacy_system > 16000: from all fwmark 0x0/0x10000 lookup legacy_network > 17000: from all fwmark 0x0/0x10000 lookup local_network > 19000: from all fwmark 0x64/0x1ffff lookup wlan0 > 19000: from all fwmark 0x65/0x1ffff lookup wlan0 > 22000: from all fwmark 0x0/0xffff lookup wlan0 > 32000: from all unreachable > > With the patch applied, and after toggling wifi, when I see the problem: > > # ip rule ls > 0: from all lookup local > 10000: from all fwmark 0xc0000/0xd0000 lookup legacy_system > 13000: from all fwmark 0x10063/0x1ffff lookup local_network > 13000: from all fwmark 0x10065/0x1ffff lookup wlan0 > 14000: from all oif wlan0 lookup wlan0 The failure would be happening on the insertion of the second wlan0 rule. > 15000: from all fwmark 0x0/0x10000 lookup legacy_system > 16000: from all fwmark 0x0/0x10000 lookup legacy_network > 17000: from all fwmark 0x0/0x10000 lookup local_network > 19000: from all fwmark 0x64/0x1ffff lookup wlan0 > 32000: from all unreachable > > >> If so and multiple components expect to manage their own 'copy' of the rule >> they will need to remove the NLM_F_EXCL flag. > > Adding more networky Android folks to the CC. > > thanks > -john >