From: Steve Wise <swise@opengridcomputing•com>
To: Andrew Morton <akpm@linux-foundation•org>
Cc: Karen Xie <kxie@chelsio•com>,
netdev@vger•kernel.org, open-iscsi@googlegroups•com,
linux-scsi@vger•kernel.org, linux-kernel@vger•kernel.org,
jgarzik@pobox•com, davem@davemloft•net, michaelc@cs•wisc.edu,
rdreier@cisco•com, daisyc@us•ibm.com, wenxiong@us•ibm.com,
bhua@us•ibm.com, divy@chelsio•com, dm@chelsio•com,
leedom@chelsio•com
Subject: Re: [PATCH 1/4 2.6.28] cxgb3 - manage a private ip address for iSCSI
Date: Fri, 22 Aug 2008 14:17:18 -0500 [thread overview]
Message-ID: <48AF10BE.9050100@opengridcomputing.com> (raw)
In-Reply-To: <20080822120851.c45a90f2.akpm@linux-foundation.org>
Andrew Morton wrote:
>> + unsigned long octet;
>> + const char *parse = buf;
>> + char *endp;
>> + int i;
>> +
>> + for (i = 1; i <= 4; i++) {
>> + octet = simple_strtoul(parse, &endp, 10);
>> + if (endp == buf || octet > 255 ||
>> + (i < 4 && *endp != '.') ||
>> + (i == 4 && *endp != '\0' && *endp != '\n'))
>> + return -EINVAL;
>> + a = (a << 8) | octet;
>> + parse = endp+1;
>> + }
>> + pi->iscsi_ipaddr = htonl(a);
>> + return endp-buf;
>> +}
>>
>
> This appears to be taking a dotted quad ipv4 address in ascii form,
> turning it into a u32 while performing checking?
>
> Surely we have a library function somewhere in networking which does
> this? If not, I'd suggest writing one.
>
>
try in_aton() from include/linux/inet.h.
next prev parent reply other threads:[~2008-08-22 19:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-22 18:38 [PATCH 1/4 2.6.28] cxgb3 - manage a private ip address for iSCSI Karen Xie
2008-08-22 19:08 ` Andrew Morton
2008-08-22 19:17 ` Steve Wise [this message]
2008-08-22 19:53 ` Andrew Morton
2008-08-22 20:09 ` Steve Wise
2008-08-23 4:55 ` Herbert Xu
-- strict thread matches above, loose matches on Subject: below --
2008-08-28 4:21 Karen Xie
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=48AF10BE.9050100@opengridcomputing.com \
--to=swise@opengridcomputing$(echo .)com \
--cc=akpm@linux-foundation$(echo .)org \
--cc=bhua@us$(echo .)ibm.com \
--cc=daisyc@us$(echo .)ibm.com \
--cc=davem@davemloft$(echo .)net \
--cc=divy@chelsio$(echo .)com \
--cc=dm@chelsio$(echo .)com \
--cc=jgarzik@pobox$(echo .)com \
--cc=kxie@chelsio$(echo .)com \
--cc=leedom@chelsio$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-scsi@vger$(echo .)kernel.org \
--cc=michaelc@cs$(echo .)wisc.edu \
--cc=netdev@vger$(echo .)kernel.org \
--cc=open-iscsi@googlegroups$(echo .)com \
--cc=rdreier@cisco$(echo .)com \
--cc=wenxiong@us$(echo .)ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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