Re: [PATCH] docs: Document newly introduced net_dhcp command

2019-09-02 Thread Andre Przywara
On Fri, 30 Aug 2019 15:20:19 +0200 Daniel Kiper wrote: > On Wed, Aug 21, 2019 at 04:58:34PM +0100, Andre Przywara wrote: > > Commit 5bc41db756c5 ("net/dhcp: Add explicit net_dhcp command") > > introduced the new command "net_dhcp", which (for now) is an al

[PATCH] docs: Document newly introduced net_dhcp command

2019-08-21 Thread Andre Przywara
out net_bootp to read net_dhcp instead, and make the net_bootp stanza point to this new command. On the way add the newly parsed TFTP_SERVER_NAME and BOOTFILE_NAME packets to the list of supported DHCP options. Signed-off-by: Andre Przywara Reported-by: Heinrich Schuchardt --- Hi, this addresses

Re: [PATCH v3 00/10] net: bootp: add native DHCPv4 support

2019-03-08 Thread Andre Przywara
On Fri, 8 Mar 2019 17:03:34 +0100 Daniel Kiper wrote: Hi Daniel, > On Thu, Mar 07, 2019 at 03:14:06PM +0000, Andre Przywara wrote: > > A minor rework compared to v2, addressing Daniel's comments on the list. > > The former patch 2/9 has been split up to first refactor the &

Re: [PATCH v3 08/10] net: dhcp: allow receiving DHCP OFFER and ACK packets

2019-03-08 Thread Andre Przywara
On Fri, 8 Mar 2019 13:01:33 +0100 Daniel Kiper wrote: > On Thu, Mar 07, 2019 at 03:14:14PM +0000, Andre Przywara wrote: > > From: Andrei Borzenkov > > > > In respone to a BOOTREQUEST packet a BOOTP server would answer with a > > BOOTREPLY packet, which ends the conv

Re: [PATCH v3 03/10] net: dhcp: Allow overloading legacy bootfile and name field

2019-03-08 Thread Andre Przywara
On Fri, 8 Mar 2019 12:34:18 +0100 Daniel Kiper wrote: > On Thu, Mar 07, 2019 at 03:14:09PM +0000, Andre Przywara wrote: > > From: Andrei Borzenkov > > > > DHCP specifies a special dummy option OVERLOAD, to allow DHCP options to > > spill over into the (legacy

[PATCH v3 10/10] net: dhcp: add explicit net_dhcp command

2019-03-07 Thread Andre Przywara
ut dropping the DHCP options from the initial DISCOVER packet when the user issues the net_bootp command, but it's unclear whether this is really useful, as both protocols should be able to coexist. Signed-off-by: Andre Przywara Reviewed-by: Daniel Kiper --- grub-core/net/bootp.c | 6

[PATCH v3 05/10] net: dhcp: make grub_net_process_dhcp take an interface

2019-03-07 Thread Andre Przywara
From: Andrei Borzenkov Change the interface of the function dealing with incoming BOOTP packets to take an interface instead of a card, to allow more fine per-interface state (timeout, handshake state) later on. Use the opportunity to clean up the code a bit. Signed-off-by: Andre Przywara

[PATCH v3 03/10] net: dhcp: Allow overloading legacy bootfile and name field

2019-03-07 Thread Andre Przywara
From: Andrei Borzenkov DHCP specifies a special dummy option OVERLOAD, to allow DHCP options to spill over into the (legacy) BOOTFILE and SNAME fields. Parse and handle this option properly. Signed-off-by: Andre Przywara --- grub-core/net/bootp.c | 59

[PATCH v3 02/10] net: dhcp: replace parse_dhcp_vendor() with find_dhcp_option()

2019-03-07 Thread Andre Przywara
with DHCP options before. Signed-off-by: Andre Przywara --- grub-core/net/bootp.c | 227 ++ 1 file changed, 117 insertions(+), 110 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c index c92dfbd3a..8d6763689 100644 --- a/grub-core/net

[PATCH v3 01/10] net: dhcp: remove dead code

2019-03-07 Thread Andre Przywara
From: Andrei Borzenkov The comment is right, the "giaddr" fields holds the IP address of the BOOTP relay, not a general purpose router address. Just remove the commented code, archeologists can find it in the git history. Signed-off-by: Andre Przywara Reviewed-by: Daniel Kiper ---

[PATCH v3 09/10] net: dhcp: actually send out DHCPv4 DISCOVER and REQUEST messages

2019-03-07 Thread Andre Przywara
packets. A pure BOOTP server would ignore the extra DHCP options in the DISCOVER packet and would just reply with a BOOTREPLY packet, which we also handle in the code. Signed-off-by: Andre Przywara Reviewed-by: Daniel Kiper --- grub-core/net/bootp.c | 120

[PATCH v3 08/10] net: dhcp: allow receiving DHCP OFFER and ACK packets

2019-03-07 Thread Andre Przywara
completed by an ACKNOWLEDGE packet from the server. Teach the grub_net_process_dhcp() function to deal with OFFER packets, and treat ACK packets the same es BOOTREPLY packets. Signed-off-by: Andre Przywara Reviewed-by: Daniel Kiper --- grub-core/net/bootp.c | 78

[PATCH v3 04/10] net: dhcp: refactor DHCP packet transmission into separate function

2019-03-07 Thread Andre Przywara
From: Andrei Borzenkov In contrast to BOOTP, DHCP uses a 4-way handshake, so requires to send packets more often. Refactor the generation and sending of the BOOTREQUEST packet into a separate function, so that future code can more easily reuse this. Signed-off-by: Andre Przywara Reviewed-by

[PATCH v3 06/10] net: dhcp: introduce per-interface timeout

2019-03-07 Thread Andre Przywara
: Andre Przywara Reviewed-by: Daniel Kiper --- grub-core/net/bootp.c | 38 ++ include/grub/net.h| 2 ++ 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c index 5bb5b3d27..2fb79d162 100644 --- a

[PATCH v3 00/10] net: bootp: add native DHCPv4 support

2019-03-07 Thread Andre Przywara
A minor rework compared to v2, addressing Daniel's comments on the list. The former patch 2/9 has been split up to first refactor the parse_dhcp_vendor() function, then later introduce the OVERLOAD functionality. The other minor nits should be fixed as well, also I added Daniel's Reviewed-by: tags.

[PATCH v3 07/10] net: dhcp: use DHCP options for name and bootfile

2019-03-07 Thread Andre Przywara
those fields to check for those DHCP options first and use this information, if provided. We fall back to using the BOOTP information if those options are not used. Signed-off-by: Andre Przywara --- grub-core/net/bootp.c | 72 +++ include/grub/net.h| 2

Re: [PATCH v2 6/9] net: dhcp: use DHCP options for name and bootfile

2019-03-07 Thread Andre Przywara
On Thu, 21 Feb 2019 19:49:08 +0100 Daniel Kiper wrote: > On Tue, Feb 12, 2019 at 05:46:57PM +0000, Andre Przywara wrote: > > From: Andrei Borzenkov > > > > The BOOTP RFC describes the boot file name and the server name as being > > part of the integral BOOTP data str

[PATCH v2 6/9] net: dhcp: use DHCP options for name and bootfile

2019-02-12 Thread Andre Przywara
those fields to check for those DHCP options first and use this information, if provided. We fall back to using the BOOTP information if those options are not used. Signed-off-by: Andre Przywara --- grub-core/net/bootp.c | 72 +++ include/grub/net.h| 2

[PATCH v2 9/9] net: dhcp: add explicit net_dhcp command

2019-02-12 Thread Andre Przywara
ut dropping the DHCP options from the initial DISCOVER packet when the user issues the net_bootp command, but it's unclear whether this is really useful, as both protocols should be able to coexist. Signed-off-by: Andre Przywara --- grub-core/net/bootp.c | 6 +- 1 file changed, 5 insertion

[PATCH v2 4/9] net: dhcp: make grub_net_process_dhcp take an interface

2019-02-12 Thread Andre Przywara
From: Andrei Borzenkov Change the interface of the function dealing with incoming BOOTP packets to take an interface instead of a card, to allow more fine per-interface state (timeout, handshake state) later on. Signed-off-by: Andre Przywara --- grub-core/net/bootp.c | 29

[PATCH v2 8/9] net: dhcp: actually send out DHCPv4 DISCOVER and REQUEST messages

2019-02-12 Thread Andre Przywara
packets. A pure BOOTP server would ignore the extra DHCP options in the DISCOVER packet and would just reply with a BOOTREPLY packet, which we also handle in the code. Signed-off-by: Andre Przywara --- grub-core/net/bootp.c | 120 +- include/grub/net.h

[PATCH v2 7/9] net: dhcp: allow receiving DHCP OFFER and ACK packets

2019-02-12 Thread Andre Przywara
completed by an ACKNOWLEDGE packet from the server. Teach the grub_net_process_dhcp() function to deal with OFFER packets, and treat ACK packets the same es BOOTREPLY packets. Signed-off-by: Andre Przywara --- grub-core/net/bootp.c | 76 +++ include/grub

[PATCH v2 0/9] net: bootp: add native DHCPv4 support

2019-02-12 Thread Andre Przywara
This is a split-up of the previous all-in-one patch from Andrei, to teach grub proper DHCP manners. This split is based on my limited understanding of BOOTP/DHCP and grub, but it should be an improvement over the single patch version anyway. All patches compile and work, although only patch 8/9 act

[PATCH v2 1/9] net: dhcp: remove dead code

2019-02-12 Thread Andre Przywara
From: Andrei Borzenkov The comment is right, the "giaddr" fields holds the IP address of the BOOTP relay, not a general purpose router address. Just remove the commented code, archeologists can find it in the git history. Signed-off-by: Andre Przywara --- grub-core/net/bo

[PATCH v2 5/9] net: dhcp: introduce per-interface timeout

2019-02-12 Thread Andre Przywara
: Andre Przywara --- grub-core/net/bootp.c | 38 ++ include/grub/net.h| 2 ++ 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c index 573398aa4..42117b72d 100644 --- a/grub-core/net/bootp.c +++ b

[PATCH v2 3/9] net: dhcp: refactor DHCP packet transmission into separate function

2019-02-12 Thread Andre Przywara
From: Andrei Borzenkov In contrast to BOOTP, DHCP uses a 4-way handshake, so requires to send packets more often. Refactor the generation and sending of the BOOTREQUEST packet into a separate function, so that future code can more easily reuse this. Signed-off-by: Andre Przywara --- grub

[PATCH v2 2/9] net: dhcp: replace parse_dhcp_vendor() with find_dhcp_option()

2019-02-12 Thread Andre Przywara
with DHCP options before. Signed-off-by: Andre Przywara --- grub-core/net/bootp.c | 285 ++ include/grub/net.h| 1 + 2 files changed, 176 insertions(+), 110 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c index c92dfbd3a

Re: [PATCH] bootp: add native DHCPv4 support

2019-02-11 Thread Andre Przywara
On Thu, 24 Jan 2019 15:13:19 +0100 Daniel Kiper wrote: Hi Daniel, > On Mon, Jan 21, 2019 at 02:10:48PM +0000, Andre Przywara wrote: > > On Mon, 21 Jan 2019 13:02:08 +0100 > > Daniel Kiper wrote: ... > > > Is it possible to split this patch to smaller pieces? > &g

Re: [PATCH] bootp: add native DHCPv4 support

2019-01-21 Thread Andre Przywara
On Mon, 21 Jan 2019 13:02:08 +0100 Daniel Kiper wrote: Hi Daniel, thanks very much for your reply! > On Fri, Jan 11, 2019 at 03:59:34PM +0000, Andre Przywara wrote: > > From: Andrei Borzenkov > > > > This patch adds support for native DHCPv4 and removes requirement > &

[PATCH] bootp: add native DHCPv4 support

2019-01-11 Thread Andre Przywara
lient identifier if we ever need one. v2: change find_dhcp_option to use subscripts to avoid signed/unsigned comparison warning. Should fix "may be used uninitialized" warning (although I could not reproduce it). Signed-off-by: Andre Przywara --- Hi, this patch is a reb