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: Karen Xie <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:17 pm
Andrew Morton wrote:
quoted text
>> + 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. --
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
:
Greg KH
[GIT PATCH] driver core patches against 2.6.24
Andi Kleen
Re: [PATCH] Version 3 (2.6.23-rc8) Smack: Simplified Mandatory Access Control Kernel
Paolo Giarrusso
Re: [uml-devel] User Mode Linux still doesn't build in 2.6.23-final.
Jeremy Fitzhardinge
Re: [RFC] Heads up on sys_fallocate()
git
:
linux-netdev
:
Gerrit Renker
[PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side)
Jarek Poplawski
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Alexey Dobriyan
Re: [GIT]: Networking
Julius R. Volz
[PATCH 18/26] IPVS: Add functions for getting/creating IPv6 connections.
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
3 users
and
899 guests
online.
Online users
strcmp
palasdely
beverlyfullman
Syndicate