mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: yegorslists@googlemail.com
Cc: barebox@lists.infradead.org, linux@rempel-privat.de
Subject: Re: [PATCH] DHCP: fix option 54 passing
Date: Thu, 22 Feb 2018 08:12:57 +0100	[thread overview]
Message-ID: <20180222071257.jmysyzpc72nr7ccu@pengutronix.de> (raw)
In-Reply-To: <1519112870-16824-1-git-send-email-yegorslists@googlemail.com>

On Tue, Feb 20, 2018 at 08:47:50AM +0100, yegorslists@googlemail.com wrote:
> From: Yegor Yefremov <yegorslists@googlemail.com>
> 
> Though variable net_dhcp_server_ip was declared and used as a
> function parameter it was never assigned. That's why a DHCP
> request was sent without option 54 set. Some DHCP server for
> example dnsmasq didn't accept such a packet.
> 
> As both offered IP address and server IP are stored in the global
> dhcp_result structure we don't need either net_dhcp_server_ip or
> OfferedIP variables and can use the addresses from dhcp_result
> directly.
> 
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
>  net/dhcp.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/net/dhcp.c b/net/dhcp.c
> index 946efaa..d30551d 100644
> --- a/net/dhcp.c
> +++ b/net/dhcp.c
> @@ -76,7 +76,6 @@ typedef enum {
>  
>  static uint32_t Bootp_id;
>  static dhcp_state_t dhcp_state;
> -static IPaddr_t net_dhcp_server_ip;
>  static uint64_t dhcp_start;
>  static struct eth_device *dhcp_edev;
>  struct dhcp_req_param dhcp_param;
> @@ -350,7 +349,6 @@ static void dhcp_send_request_packet(struct bootp *bp_offer)
>  {
>  	struct bootp *bp;
>  	int extlen;
> -	IPaddr_t OfferedIP;
>  
>  	debug("%s: Sending DHCPREQUEST\n", __func__);
>  
> @@ -378,9 +376,8 @@ static void dhcp_send_request_packet(struct bootp *bp_offer)
>  	/*
>  	 * Copy options from OFFER packet if present
>  	 */
> -	net_copy_ip(&OfferedIP, &bp_offer->bp_yiaddr);
> -	extlen = dhcp_extended(bp->bp_vend, DHCP_REQUEST, net_dhcp_server_ip,
> -				OfferedIP);
> +	extlen = dhcp_extended(bp->bp_vend, DHCP_REQUEST, dhcp_result->serverip,
> +				dhcp_result->ip);
>  
>  	debug("Transmitting DHCPREQUEST packet\n");
>  	net_udp_send(dhcp_con, sizeof(*bp) + extlen);
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2018-02-22  7:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20  7:47 yegorslists
2018-02-22  7:12 ` Sascha Hauer [this message]

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=20180222071257.jmysyzpc72nr7ccu@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=linux@rempel-privat.de \
    --cc=yegorslists@googlemail.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