summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorSimon Rettberg2023-04-04 15:12:41 +0200
committerSimon Rettberg2023-04-04 15:12:41 +0200
commit5ba496dce11d10198a0eae0c8440dccb256fbf32 (patch)
tree549903f1dab893870335a6e4767a4530444d2e83 /src/usr
parent[vesafb] Map Unicode characters to CP437 if possible (diff)
parent[tls] Handle fragmented handshake records (diff)
downloadipxe-5ba496dce11d10198a0eae0c8440dccb256fbf32.tar.gz
ipxe-5ba496dce11d10198a0eae0c8440dccb256fbf32.tar.xz
ipxe-5ba496dce11d10198a0eae0c8440dccb256fbf32.zip
Merge branch 'master' into openslx
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/autoboot.c16
-rw-r--r--src/usr/pxemenu.c2
2 files changed, 14 insertions, 4 deletions
diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c
index 24043ae69..d1f259621 100644
--- a/src/usr/autoboot.c
+++ b/src/usr/autoboot.c
@@ -27,6 +27,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <stdio.h>
#include <errno.h>
#include <ipxe/netdevice.h>
+#include <ipxe/vlan.h>
#include <ipxe/dhcp.h>
#include <ipxe/settings.h>
#include <ipxe/image.h>
@@ -57,6 +58,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
/** Link-layer address of preferred autoboot device, if known */
static uint8_t autoboot_ll_addr[MAX_LL_ADDR_LEN];
+/** VLAN tag of preferred autoboot device, if known */
+static unsigned int autoboot_vlan;
+
/** Device location of preferred autoboot device, if known */
static struct device_description autoboot_desc;
@@ -494,8 +498,9 @@ void set_autoboot_busloc ( unsigned int bus_type, unsigned int location ) {
*/
static int is_autoboot_ll_addr ( struct net_device *netdev ) {
- return ( memcmp ( netdev->ll_addr, autoboot_ll_addr,
- netdev->ll_protocol->ll_addr_len ) == 0 );
+ return ( ( memcmp ( netdev->ll_addr, autoboot_ll_addr,
+ netdev->ll_protocol->ll_addr_len ) == 0 ) &&
+ ( vlan_tag ( netdev ) == autoboot_vlan ) );
}
/**
@@ -503,14 +508,19 @@ static int is_autoboot_ll_addr ( struct net_device *netdev ) {
*
* @v ll_addr Link-layer address
* @v len Length of link-layer address
+ * @v vlan VLAN tag
*/
-void set_autoboot_ll_addr ( const void *ll_addr, size_t len ) {
+void set_autoboot_ll_addr ( const void *ll_addr, size_t len,
+ unsigned int vlan ) {
/* Record autoboot link-layer address (truncated if necessary) */
if ( len > sizeof ( autoboot_ll_addr ) )
len = sizeof ( autoboot_ll_addr );
memcpy ( autoboot_ll_addr, ll_addr, len );
+ /* Record autoboot VLAN tag */
+ autoboot_vlan = vlan;
+
/* Mark autoboot device as present */
is_autoboot_device = is_autoboot_ll_addr;
}
diff --git a/src/usr/pxemenu.c b/src/usr/pxemenu.c
index 5e497f990..34fdf37ee 100644
--- a/src/usr/pxemenu.c
+++ b/src/usr/pxemenu.c
@@ -204,7 +204,7 @@ static void pxe_menu_draw_item ( struct pxe_menu *menu,
buf[ sizeof ( buf ) - 1 ] = '\0';
/* Draw row */
- row = ( LINES - menu->num_items + index );
+ row = ( LINES - menu->num_items + index - 1 );
color_set ( ( selected ? CPAIR_PXE : CPAIR_DEFAULT ), NULL );
mvprintw ( row, 0, "%s", buf );
move ( row, 1 );