* [U-Boot] [PATCH 1/1] net:Fix potential empty DHCP Parameter Request List
@ 2010-10-22 8:36 Jason Liu
2010-10-22 9:31 ` Wolfgang Denk
2010-10-22 20:06 ` Mike Frysinger
0 siblings, 2 replies; 6+ messages in thread
From: Jason Liu @ 2010-10-22 8:36 UTC (permalink / raw)
To: u-boot
From: Gray Remlin <g_remlin@rocketmail.com>
Can't get IP address with dhcp due to the dhcp server not
allow the empty param list request under some network env
Signed-off-by: Gray Remlin <g_remlin@rocketmail.com>
Signed-off-by: Jason Liu <r64343@freescale.com>
---
net/bootp.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/net/bootp.c b/net/bootp.c
index e679f8b..c87d0c2 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -417,9 +417,19 @@ static int DhcpExtended (u8 * e, int message_type, IPaddr_t ServerID, IPaddr_t R
return x - start;
#endif
+#if defined(CONFIG_BOOTP_SUBNETMASK) || \
+ defined(CONFIG_BOOTP_TIMEOFFSET) || \
+ defined(CONFIG_BOOTP_GATEWAY) || \
+ defined(CONFIG_BOOTP_DNS) || \
+ defined(CONFIG_BOOTP_HOSTNAME) || \
+ defined(CONFIG_BOOTP_BOOTFILESIZE) || \
+ defined(CONFIG_BOOTP_BOOTPATH) || \
+ defined(CONFIG_BOOTP_NISDOMAIN) || \
+ defined(CONFIG_BOOTP_NTPSERVER)
*e++ = 55; /* Parameter Request List */
cnt = e++; /* Pointer to count of requested items */
*cnt = 0;
+#endif
#if defined(CONFIG_BOOTP_SUBNETMASK)
*e++ = 1; /* Subnet Mask */
*cnt += 1;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 1/1] net:Fix potential empty DHCP Parameter Request List
2010-10-22 8:36 [U-Boot] [PATCH 1/1] net:Fix potential empty DHCP Parameter Request List Jason Liu
@ 2010-10-22 9:31 ` Wolfgang Denk
2010-10-22 11:48 ` Jason Liu
2010-10-22 20:06 ` Mike Frysinger
1 sibling, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2010-10-22 9:31 UTC (permalink / raw)
To: u-boot
Dear Jason Liu,
In message <1287736585-32489-1-git-send-email-r64343@freescale.com> you wrote:
> From: Gray Remlin <g_remlin@rocketmail.com>
>
> Can't get IP address with dhcp due to the dhcp server not
> allow the empty param list request under some network env
>
> Signed-off-by: Gray Remlin <g_remlin@rocketmail.com>
> Signed-off-by: Jason Liu <r64343@freescale.com>
> ---
> net/bootp.c | 10 ++++++++++
> 1 files changed, 10 insertions(+), 0 deletions(-)
What is the purpose of you reposting Gray's patch here, without any
comment?
Did you change it? Did you test it? Or what??
You did not even keep the mail thread in place; please do not do that!
Please make sure to read
http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
In
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/86974/focus=86995
I asked you to test Gray's; you did not send a formal "Tested-by:"
notification, but ok.
But I really don't understand why you now repost this patch,
completely without any explanations? Please elucidate.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The inappropriate cannot be beautiful.
- Frank Lloyd Wright _The Future of Architecture_ (1953)
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 1/1] net:Fix potential empty DHCP Parameter Request List
2010-10-22 9:31 ` Wolfgang Denk
@ 2010-10-22 11:48 ` Jason Liu
2010-10-22 12:04 ` Wolfgang Denk
0 siblings, 1 reply; 6+ messages in thread
From: Jason Liu @ 2010-10-22 11:48 UTC (permalink / raw)
To: u-boot
Hi, Wolfgang,
2010/10/22 Wolfgang Denk <wd@denx.de>:
> Dear Jason Liu,
>
> In message <1287736585-32489-1-git-send-email-r64343@freescale.com> you wrote:
>> From: Gray Remlin <g_remlin@rocketmail.com>
>>
>> Can't get IP address with dhcp due to the dhcp server not
>> allow the empty param list request under some network env
>>
>> Signed-off-by: Gray Remlin <g_remlin@rocketmail.com>
>> Signed-off-by: Jason Liu <r64343@freescale.com>
>> ---
>> ?net/bootp.c | ? 10 ++++++++++
>> ?1 files changed, 10 insertions(+), 0 deletions(-)
>
> What is the purpose of you reposting Gray's patch here, without any
> comment?
I just made some change compared with original patch.
>
> Did you change it? ?Did you test it? Or what??
>
> You did not even keep the mail thread in place; please do not do that!
>
> Please make sure to read
> http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
>
Sorry for that,
>
> In
> http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/86974/focus=86995
> I asked you to test Gray's; you did not send a formal "Tested-by:"
> notification, but ok.
Yes, I have test it and send you the email, it also fix the dhcp issue
I met in FSL office.
I have posted my patch to ML, but I think this patch is good and fix
this issue at low level and
no need every board owner to fix it at the board level.
I don;t know whether it's not permitted to post other's patch here. If
that's true, I will not do that forever.
>
>
> But I really don't understand why you now repost this patch,
> completely without any explanations? ?Please elucidate.
>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> The inappropriate cannot be beautiful.
> ? ? ? ? ? ? - Frank Lloyd Wright _The Future of Architecture_ (1953)
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 1/1] net:Fix potential empty DHCP Parameter Request List
2010-10-22 11:48 ` Jason Liu
@ 2010-10-22 12:04 ` Wolfgang Denk
0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Denk @ 2010-10-22 12:04 UTC (permalink / raw)
To: u-boot
Dear Jason Liu,
In message <AANLkTi=KTe+LOaUqb5M2TaWVMATDRpHP1yf8NLR5KmV=@mail.gmail.com> you wrote:
>
> > What is the purpose of you reposting Gray's patch here, without any
> > comment?
>
> I just made some change compared with original patch.
So would you please document what you changed, and why?
> I don;t know whether it's not permitted to post other's patch here. If
> that's true, I will not do that forever.
This is no problem; in a case like this, where you modified the patch,
you should add your Signed-off-by: line.
In any case, you should explain what you changed, and why (see
http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions).
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Killing is wrong.
-- Losira, "That Which Survives", stardate unknown
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 1/1] net:Fix potential empty DHCP Parameter Request List
2010-10-22 8:36 [U-Boot] [PATCH 1/1] net:Fix potential empty DHCP Parameter Request List Jason Liu
2010-10-22 9:31 ` Wolfgang Denk
@ 2010-10-22 20:06 ` Mike Frysinger
2010-11-14 3:58 ` Jason Liu
1 sibling, 1 reply; 6+ messages in thread
From: Mike Frysinger @ 2010-10-22 20:06 UTC (permalink / raw)
To: u-boot
On Friday, October 22, 2010 04:36:25 Jason Liu wrote:
> From: Gray Remlin <g_remlin@rocketmail.com>
>
> Can't get IP address with dhcp due to the dhcp server not
> allow the empty param list request under some network env
>
> --- a/net/bootp.c
> +++ b/net/bootp.c
> @@ -417,9 +417,19 @@ static int DhcpExtended (u8 * e, int message_type,
> IPaddr_t ServerID, IPaddr_t R return x - start;
> #endif
>
> +#if defined(CONFIG_BOOTP_SUBNETMASK) || \
> + defined(CONFIG_BOOTP_TIMEOFFSET) || \
> + defined(CONFIG_BOOTP_GATEWAY) || \
> + defined(CONFIG_BOOTP_DNS) || \
> + defined(CONFIG_BOOTP_HOSTNAME) || \
> + defined(CONFIG_BOOTP_BOOTFILESIZE) || \
> + defined(CONFIG_BOOTP_BOOTPATH) || \
> + defined(CONFIG_BOOTP_NISDOMAIN) || \
> + defined(CONFIG_BOOTP_NTPSERVER)
> *e++ = 55; /* Parameter Request List */
> cnt = e++; /* Pointer to count of requested items */
> *cnt = 0;
> +#endif
this list is pretty ugly and prone to breakage. how about having the code
back itself up and let gcc optimize things away ? two ways of doing this ...
(1) after the current ifdef list and before the "*e++ = 255;", add like:
/* no options, so back up to avoid sending an empty request list */
if (*cnt == 0)
e -= 2;
(2) add a "bool empty_list" to this func. where we set "*cnt = 0", do:
empty_list = true;
then in every ifdef currently, add:
empty_list = false;
and at the end, do:
/* no options, so back up to avoid sending an empty request list */
if (empty_list)
e -= 2;
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20101022/fa87c00b/attachment.pgp
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 1/1] net:Fix potential empty DHCP Parameter Request List
2010-10-22 20:06 ` Mike Frysinger
@ 2010-11-14 3:58 ` Jason Liu
0 siblings, 0 replies; 6+ messages in thread
From: Jason Liu @ 2010-11-14 3:58 UTC (permalink / raw)
To: u-boot
2010/10/23 Mike Frysinger <vapier@gentoo.org>:
> On Friday, October 22, 2010 04:36:25 Jason Liu wrote:
>> From: Gray Remlin <g_remlin@rocketmail.com>
>>
>> Can't get IP address with dhcp due to the dhcp server not
>> allow the empty param list request under some network env
>>
>> --- a/net/bootp.c
>> +++ b/net/bootp.c
>> @@ -417,9 +417,19 @@ static int DhcpExtended (u8 * e, int message_type,
>> IPaddr_t ServerID, IPaddr_t R return x - start;
>> ?#endif
>>
>> +#if defined(CONFIG_BOOTP_SUBNETMASK) || \
>> + ? ?defined(CONFIG_BOOTP_TIMEOFFSET) || \
>> + ? ?defined(CONFIG_BOOTP_GATEWAY) || \
>> + ? ?defined(CONFIG_BOOTP_DNS) || \
>> + ? ?defined(CONFIG_BOOTP_HOSTNAME) || \
>> + ? ?defined(CONFIG_BOOTP_BOOTFILESIZE) || \
>> + ? ?defined(CONFIG_BOOTP_BOOTPATH) || \
>> + ? ?defined(CONFIG_BOOTP_NISDOMAIN) || \
>> + ? ?defined(CONFIG_BOOTP_NTPSERVER)
>> ? ? ? *e++ = 55; ? ? ? ? ? ? ?/* Parameter Request List */
>> ? ? ? ?cnt = e++; ? ? ? ? ? ? /* Pointer to count of requested items */
>> ? ? ? *cnt = 0;
>> +#endif
>
> this list is pretty ugly and prone to breakage. ?how about having the code
> back itself up and let gcc optimize things away ? ?two ways of doing this ...
>
> (1) after the current ifdef list and before the "*e++ = 255;", add like:
> ? ? ? ?/* no options, so back up to avoid sending an empty request list */
> ? ? ? ?if (*cnt == 0)
> ? ? ? ? ? ? ? ?e -= 2;
>
> (2) add a "bool empty_list" to this func. ?where we set "*cnt = 0", do:
> ? ? ? ?empty_list = true;
> then in every ifdef currently, add:
> ? ? ? ?empty_list = false;
> and at the end, do:
> ? ? ? ?/* no options, so back up to avoid sending an empty request list */
> ? ? ? ?if (empty_list)
> ? ? ? ? ? ? ? ?e -= 2;
Good point, thanks, mike. I will select option 1 to send v2 patch soon.
> -mike
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-11-14 3:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-22 8:36 [U-Boot] [PATCH 1/1] net:Fix potential empty DHCP Parameter Request List Jason Liu
2010-10-22 9:31 ` Wolfgang Denk
2010-10-22 11:48 ` Jason Liu
2010-10-22 12:04 ` Wolfgang Denk
2010-10-22 20:06 ` Mike Frysinger
2010-11-14 3:58 ` Jason Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox