From patchwork Tue Oct 7 15:23:04 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick McHardy X-Patchwork-Id: 3185 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.176.167]) by ozlabs.org (Postfix) with ESMTP id 01DACDDE22 for ; Wed, 8 Oct 2008 02:23:18 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752572AbYJGPXM (ORCPT ); Tue, 7 Oct 2008 11:23:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753174AbYJGPXM (ORCPT ); Tue, 7 Oct 2008 11:23:12 -0400 Received: from stinky.trash.net ([213.144.137.162]:49119 "EHLO stinky.trash.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752572AbYJGPXL (ORCPT ); Tue, 7 Oct 2008 11:23:11 -0400 Received: from [192.168.0.100] (unknown [78.42.204.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by stinky.trash.net (Postfix) with ESMTP id EBD2794946; Tue, 7 Oct 2008 17:23:09 +0200 (MEST) Message-ID: <48EB7ED8.7090603@trash.net> Date: Tue, 07 Oct 2008 17:23:04 +0200 From: Patrick McHardy User-Agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: Linux Netdev List , Stephen Hemminger Subject: Re: [IPROUTE]: Refuse "ip link add/replace" without device type parameter References: <48EB7D4B.4030501@trash.net> In-Reply-To: <48EB7D4B.4030501@trash.net> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fix typo noticed by Phil Oester: information vs. informatin commit c3ae059edf3316cff1075c2401bdeefa5e262251 Author: Patrick McHardy Date: Tue Oct 7 16:55:21 2008 +0200 [IPROUTE]: Refuse "ip link add/replace" without device type parameter Fix confusing error message noticed by Martin Josefsson: # ip link add RTNETLINK answers: Operation not supported The reason is missing device type information, refuse this and print a message. Signed-off-by: Patrick McHardy diff --git a/ip/iplink.c b/ip/iplink.c index 81122ae..6e9ac71 100644 --- a/ip/iplink.c +++ b/ip/iplink.c @@ -336,6 +336,10 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv) return -1; } linkinfo->rta_len = (void *)NLMSG_TAIL(&req.n) - (void *)linkinfo; + } else if (flags & NLM_F_CREATE) { + fprintf(stderr, "Not enough information: \"type\" argument " + "is required\n"); + return -1; } if (!(flags & NLM_F_CREATE)) {