From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: "Eric Bénard" <eric@eukrea.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/3] dhcp: fix request packet's requested IP option
Date: Fri, 30 Jan 2015 16:01:46 +0800 [thread overview]
Message-ID: <C03A4704-67BB-4EA6-8643-D79F9D14064D@jcrosoft.com> (raw)
In-Reply-To: <1422488254-18414-1-git-send-email-eric@eukrea.com>
> On Jan 29, 2015, at 7:37 AM, Eric Bénard <eric@eukrea.com> wrote:
>
> In the request packet, we are supposed to copy the IP that the DHCP server
> provided in the offer packet so that dhcp_extended can fill the option 50.
> There is actually an error in barebox as the pointer to the packet currently
> built is used as the source instead of the pointer to the offer packet.
> With this patch, barebox now sends a request packet which includes the right
> requested IP in option 50.
>
> Signed-off-by: Eric Bénard <eric@eukrea.com>
> ---
> net/dhcp.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/net/dhcp.c b/net/dhcp.c
> index 9551d60..78440dd 100644
> --- a/net/dhcp.c
> +++ b/net/dhcp.c
> @@ -579,7 +579,7 @@ static void dhcp_send_request_packet(struct bootp *bp_offer)
> /*
> * Copy options from OFFER packet if present
> */
> - net_copy_ip(&OfferedIP, &bp->bp_yiaddr);
> + net_copy_ip(&OfferedIP, &bp_offer->bp_yiaddr);
> extlen = dhcp_extended((u8 *)bp->bp_vend, DHCP_REQUEST, net_dhcp_server_ip,
> OfferedIP);
>
> @@ -745,9 +745,7 @@ static int do_dhcp(int argc, char *argv[])
> ret = net_udp_bind(dhcp_con, PORT_BOOTPC);
> if (ret)
> goto out1;
> -
> net_set_ip(0);
> -
one fix at a time
I do prefer the empty it make the code more readable
Best Regards,
J.
> dhcp_start = get_time_ns();
> ret = bootp_request(); /* Basically same as BOOTP */
> if (ret)
> --
> 1.9.3
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2015-01-30 8:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-28 23:37 Eric Bénard
2015-01-28 23:37 ` [PATCH 2/3] dhcp: fix request packet Eric Bénard
2015-01-28 23:37 ` [PATCH 3/3] dhcp: fix request packet's seconds elapsed Eric Bénard
2015-01-28 23:42 ` [PATCH v2 1/3] dhcp: fix request packet's requested IP option Eric Bénard
2015-01-29 7:40 ` Sascha Hauer
2015-01-30 8:01 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2015-01-30 8:13 ` [PATCH " Eric Bénard
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=C03A4704-67BB-4EA6-8643-D79F9D14064D@jcrosoft.com \
--to=plagnioj@jcrosoft.com \
--cc=barebox@lists.infradead.org \
--cc=eric@eukrea.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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