From patchwork Sat Aug 12 12:04:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Sutter X-Patchwork-Id: 800895 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xV0zd12CBz9t3C for ; Sat, 12 Aug 2017 22:09:33 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752389AbdHLMJa (ORCPT ); Sat, 12 Aug 2017 08:09:30 -0400 Received: from orbyte.nwl.cc ([151.80.46.58]:48873 "EHLO mail.nwl.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751624AbdHLMJ2 (ORCPT ); Sat, 12 Aug 2017 08:09:28 -0400 Received: from mail.nwl.cc (orbyte.nwl.cc [127.0.0.1]) by mail.nwl.cc (Postfix) with ESMTP id 0372968252; Sat, 12 Aug 2017 14:09:27 +0200 (CEST) Received: from xsao (localhost [IPv6:::1]) by mail.nwl.cc (Postfix) with ESMTP id D708B681D7; Sat, 12 Aug 2017 14:09:26 +0200 (CEST) From: Phil Sutter To: Stephen Hemminger Cc: netdev@vger.kernel.org Subject: [iproute PATCH 06/51] iplink_vrf: Complain if main table is not found Date: Sat, 12 Aug 2017 14:04:25 +0200 Message-Id: <20170812120510.28750-7-phil@nwl.cc> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170812120510.28750-1-phil@nwl.cc> References: <20170812120510.28750-1-phil@nwl.cc> X-Virus-Scanned: ClamAV using ClamSMTP Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Phil Sutter Acked-by: David Ahern --- ip/iplink_vrf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ip/iplink_vrf.c b/ip/iplink_vrf.c index 917630e853375..809eda5de8f6e 100644 --- a/ip/iplink_vrf.c +++ b/ip/iplink_vrf.c @@ -131,7 +131,10 @@ __u32 ipvrf_get_table(const char *name) &answer.n, sizeof(answer)) < 0) { /* special case "default" vrf to be the main table */ if (errno == ENODEV && !strcmp(name, "default")) - rtnl_rttable_a2n(&tb_id, "main"); + if (rtnl_rttable_a2n(&tb_id, "main")) + fprintf(stderr, + "BUG: RTTable \"main\" not found.\n"); + return tb_id; }