login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
August
»
22
Re: [PATCH 1/4 2.6.28] cxgb3 - manage a private ip address for iSCSI
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Andrew Morton <akpm@...>
To: Steve Wise <swise@...>
Cc: <kxie@...>, <netdev@...>, <open-iscsi@...>, <linux-scsi@...>, <linux-kernel@...>, <jgarzik@...>, <davem@...>, <michaelc@...>, <rdreier@...>, <daisyc@...>, <wenxiong@...>, <bhua@...>, <divy@...>, <dm@...>, <leedom@...>
Subject:
Re: [PATCH 1/4 2.6.28] cxgb3 - manage a private ip address for iSCSI
Date: Friday, August 22, 2008 - 3:53 pm
On Fri, 22 Aug 2008 14:17:18 -0500 Steve Wise <swise@opengridcomputing.com> wrote:
quoted text
> 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 != '__PLACEHOLDER__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. >
yeah. But that function is a crock. No error checking at all! --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 1/4 2.6.28] cxgb3 - manage a private ip address for i...
, Karen Xie
, (Fri Aug 22, 2:38 pm)
Re: [PATCH 1/4 2.6.28] cxgb3 - manage a private ip address f...
, Andrew Morton
, (Fri Aug 22, 3:08 pm)
Re: [PATCH 1/4 2.6.28] cxgb3 - manage a private ip address f...
, Herbert Xu
, (Sat Aug 23, 12:55 am)
Re: [PATCH 1/4 2.6.28] cxgb3 - manage a private ip address f...
, Steve Wise
, (Fri Aug 22, 3:17 pm)
Re: [PATCH 1/4 2.6.28] cxgb3 - manage a private ip address f...
, Andrew Morton
, (Fri Aug 22, 3:53 pm)
Re: [PATCH 1/4 2.6.28] cxgb3 - manage a private ip address f...
, Steve Wise
, (Fri Aug 22, 4:09 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Max Krasnyansky
Re: Inquiry: Should we remove "isolcpus= kernel boot option? (may have realtime us...
Jeremy Allison
Re: [RFC] Heads up on sys_fallocate()
Randy Dunlap
Re: -mm merge plans for 2.6.23 (pcmcia)
Damien Wyart
ACPI power off regression in 2.6.23-rc8 (NOT in rc7)
git
:
linux-netdev
:
Josip Rodin
Re: bnx2_poll panicking kernel
Linus Torvalds
Re: [GIT]: Networking
Denys Fedoryshchenko
thousands of classes, e1000 TX unit hang
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
4 users
and
915 guests
online.
Online users
backlinkservchp
strcmp
comprarusty
metalpressings
Syndicate