From: Alexander Graf <agraf@suse.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/7] bootp: Move vendor class identifier set to function
Date: Fri, 6 May 2016 21:01:02 +0200 [thread overview]
Message-ID: <1462561267-92773-3-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1462561267-92773-1-git-send-email-agraf@suse.de>
Both the dhcp as well as the bootp case add vendor class identifier
parameters into their packets. Let's move that into a separate function
to make overlaying easier.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
net/bootp.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/net/bootp.c b/net/bootp.c
index d91b307..d718e35 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -411,6 +411,17 @@ static void bootp_timeout_handler(void)
e += vci_strlen; \
} while (0)
+static u8 *add_vci(u8 *e)
+{
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_NET_VCI_STRING)
+ put_vci(e, CONFIG_SPL_NET_VCI_STRING);
+#elif defined(CONFIG_BOOTP_VCI_STRING)
+ put_vci(e, CONFIG_BOOTP_VCI_STRING);
+#endif
+
+ return e;
+}
+
/*
* Initialize BOOTP extension fields in the request.
*/
@@ -508,11 +519,7 @@ static int dhcp_extended(u8 *e, int message_type, struct in_addr server_ip,
}
#endif
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_NET_VCI_STRING)
- put_vci(e, CONFIG_SPL_NET_VCI_STRING);
-#elif defined(CONFIG_BOOTP_VCI_STRING)
- put_vci(e, CONFIG_BOOTP_VCI_STRING);
-#endif
+ e = add_vci(e);
#if defined(CONFIG_BOOTP_VENDOREX)
x = dhcp_vendorex_prep(e);
@@ -598,14 +605,7 @@ static int bootp_extended(u8 *e)
*e++ = (576 - 312 + OPT_FIELD_SIZE) & 0xff;
#endif
-#if defined(CONFIG_BOOTP_VCI_STRING) || \
- (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_NET_VCI_STRING))
-#ifdef CONFIG_SPL_BUILD
- put_vci(e, CONFIG_SPL_NET_VCI_STRING);
-#else
- put_vci(e, CONFIG_BOOTP_VCI_STRING);
-#endif
-#endif
+ add_vci(e);
#if defined(CONFIG_BOOTP_SUBNETMASK)
*e++ = 1; /* Subnet mask request */
--
1.8.5.6
next prev parent reply other threads:[~2016-05-06 19:01 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-06 19:01 [U-Boot] [PATCH v2 0/7] efi_loader: PXE boot support Alexander Graf
2016-05-06 19:01 ` [U-Boot] [PATCH v2 1/7] efi_loader: Add network access support Alexander Graf
2016-05-10 21:25 ` [U-Boot] [PATCH v3 " Alexander Graf
2016-05-14 19:49 ` Simon Glass
2016-05-14 20:34 ` Alexander Graf
2016-05-16 13:24 ` Simon Glass
2016-05-16 18:06 ` Alexander Graf
2016-05-18 17:21 ` Simon Glass
2016-05-19 16:18 ` Alexander Graf
2016-05-19 16:34 ` Simon Glass
2016-05-30 17:56 ` [U-Boot] [U-Boot, v2, " Tom Rini
2016-05-06 19:01 ` Alexander Graf [this message]
2016-05-06 19:28 ` [U-Boot] [PATCH v2 2/7] bootp: Move vendor class identifier set to function Tom Rini
2016-05-30 17:56 ` [U-Boot] [U-Boot, v2, " Tom Rini
2016-05-06 19:01 ` [U-Boot] [PATCH v2 3/7] net: Move the VCI and client arch values to Kconfig Alexander Graf
2016-05-06 19:28 ` Tom Rini
2016-05-30 17:56 ` [U-Boot] [U-Boot, v2, " Tom Rini
2016-05-06 19:01 ` [U-Boot] [PATCH v2 4/7] net: Fix client identifiers for ARM Alexander Graf
2016-05-06 19:28 ` Tom Rini
2016-05-30 17:56 ` [U-Boot] [U-Boot,v2,4/7] " Tom Rini
2016-05-06 19:01 ` [U-Boot] [PATCH v2 5/7] net: Move CONFIG_SPL_NET_VCI_STRING into Kconfig Alexander Graf
2016-05-06 19:28 ` Tom Rini
2016-05-30 17:57 ` [U-Boot] [U-Boot, v2, " Tom Rini
2016-05-06 19:01 ` [U-Boot] [PATCH v2 6/7] net: Optionally use pxe client arch from variable Alexander Graf
2016-05-06 19:28 ` Tom Rini
2016-05-12 13:51 ` [U-Boot] [PATCH v4 " Alexander Graf
2016-05-30 17:57 ` [U-Boot] [U-Boot, v4, " Tom Rini
2016-05-06 19:01 ` [U-Boot] [PATCH v2 7/7] distro: Add efi pxe boot code Alexander Graf
2016-05-06 19:28 ` Tom Rini
2016-05-30 17:57 ` [U-Boot] [U-Boot,v2,7/7] " Tom Rini
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=1462561267-92773-3-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=u-boot@lists.denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.