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:
Steve Wise <swise@...>
To: Andrew Morton <akpm@...>
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 - 4:09 pm
Andrew Morton wrote:
quoted text
> On Fri, 22 Aug 2008 14:17:18 -0500 > Steve Wise <swise@opengridcomputing.com> wrote: > > >> 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! >
Oh you want error checking? :) Yea if this is a user/sysadmin supplied value, then we need a rubust inet_aton() in the kernel to validate it... --
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
:
Al Boldi
Re: [ck] Re: [ANNOUNCE] RSDL completely fair starvation free interactive cpu sched...
Ingo Molnar
Re: [patch] sched_clock(): cleanups
Greg KH
[GIT PATCH] driver core patches against 2.6.24
Amit K. Arora
[RFC] Heads up on sys_fallocate()
git
:
linux-netdev
:
Jarek Poplawski
[PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
David Miller
[GIT]: Networking
Gerrit Renker
[PATCH 18/37] dccp: Support for Mandatory options
Denys Vlasenko
[PATCH 1/2] bnx2: factor out gzip unpacker
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
1 user
and
941 guests
online.
Online users
zeekec
Syndicate