From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Michal Sojka <sojkam1@fel.cvut.cz>, linux-can@vger.kernel.org
Subject: Re: [PATCH] cangw: Print error message on misspelled interface
Date: Wed, 05 Feb 2014 18:59:38 +0100 [thread overview]
Message-ID: <52F27C0A.7030808@hartkopp.net> (raw)
In-Reply-To: <1391615310-10731-1-git-send-email-sojkam1@fel.cvut.cz>
On 05.02.2014 16:48, Michal Sojka wrote:
> If can interface is misspelled or the kernel is configured without netlink
> cangw displayed only generic usage instruction. Now, an appropriate error
> message is displayed.
>
> Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Tnx Michal!
> ---
> cangw.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/cangw.c b/cangw.c
> index b908fe4..effb7ed 100644
> --- a/cangw.c
> +++ b/cangw.c
> @@ -595,10 +595,18 @@ int main(int argc, char **argv)
>
> case 's':
> src_ifindex = if_nametoindex(optarg);
> + if (src_ifindex == 0) {
> + perror(optarg);
> + return 1;
> + }
> break;
>
> case 'd':
> dst_ifindex = if_nametoindex(optarg);
> + if (dst_ifindex == 0) {
> + perror(optarg);
> + return 1;
> + }
> break;
>
> case 't':
>
prev parent reply other threads:[~2014-02-05 17:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-05 15:48 [PATCH] cangw: Print error message on misspelled interface Michal Sojka
2014-02-05 17:59 ` Oliver Hartkopp [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52F27C0A.7030808@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=linux-can@vger.kernel.org \
--cc=sojkam1@fel.cvut.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).