diff options
author | Michael Brown | 2009-02-05 10:30:32 +0100 |
---|---|---|
committer | Michael Brown | 2009-02-05 10:34:32 +0100 |
commit | 881f1f59ef2abb9b0e9c5a56730a22fb9094b84c (patch) | |
tree | 589ef6553912e55d8ae56d666d5765f179666a7c /src/hci/commands | |
parent | [pxe] Skip PXE boot server discovery if directed to do so (diff) | |
download | ipxe-881f1f59ef2abb9b0e9c5a56730a22fb9094b84c.tar.gz ipxe-881f1f59ef2abb9b0e9c5a56730a22fb9094b84c.tar.xz ipxe-881f1f59ef2abb9b0e9c5a56730a22fb9094b84c.zip |
[pxe] Obey lists of PXE Boot Servers and associated Discovery Control bits
Various combinations of options 43.6, 43.7 and 43.8 dictate which
servers we send Boot Server Discovery requests to, and which servers
we should accept responses from. Obey these options, and remove the
explicit specification of a single Boot Server from start_pxebs() and
dependent functions.
Diffstat (limited to 'src/hci/commands')
-rw-r--r-- | src/hci/commands/dhcp_cmd.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/hci/commands/dhcp_cmd.c b/src/hci/commands/dhcp_cmd.c index b44433e7..9b577c86 100644 --- a/src/hci/commands/dhcp_cmd.c +++ b/src/hci/commands/dhcp_cmd.c @@ -109,7 +109,7 @@ static int dhcp_exec ( int argc, char **argv ) { */ static void pxebs_syntax ( char **argv ) { printf ( "Usage:\n" - " %s <interface> <discovery_ip> <server_type>\n" + " %s <interface> <server_type>\n" "\n" "Perform PXE Boot Server discovery\n", argv[0] ); @@ -128,10 +128,8 @@ static int pxebs_exec ( int argc, char **argv ) { { NULL, 0, NULL, 0 }, }; const char *netdev_txt; - const char *pxe_server_txt; const char *pxe_type_txt; struct net_device *netdev; - struct in_addr pxe_server; unsigned int pxe_type; char *end; int c; @@ -148,15 +146,12 @@ static int pxebs_exec ( int argc, char **argv ) { return 1; } } - - /* Need exactly one interface name remaining after the options */ - if ( optind != ( argc - 3 ) ) { + if ( optind != ( argc - 2 ) ) { pxebs_syntax ( argv ); return 1; } netdev_txt = argv[optind]; - pxe_server_txt = argv[ optind + 1 ]; - pxe_type_txt = argv[ optind + 2 ]; + pxe_type_txt = argv[ optind + 1 ]; /* Parse arguments */ netdev = find_netdev ( netdev_txt ); @@ -164,10 +159,6 @@ static int pxebs_exec ( int argc, char **argv ) { printf ( "No such interface: %s\n", netdev_txt ); return 1; } - if ( inet_aton ( pxe_server_txt, &pxe_server ) == 0 ) { - printf ( "Bad discovery IP address: %s\n", pxe_server_txt ); - return 1; - } pxe_type = strtoul ( pxe_type_txt, &end, 0 ); if ( *end ) { printf ( "Bad server type: %s\n", pxe_type_txt ); @@ -175,7 +166,7 @@ static int pxebs_exec ( int argc, char **argv ) { } /* Perform Boot Server Discovery */ - if ( ( rc = pxebs ( netdev, pxe_server, pxe_type ) ) != 0 ) { + if ( ( rc = pxebs ( netdev, pxe_type ) ) != 0 ) { printf ( "Could not discover boot server on %s: %s\n", netdev->name, strerror ( rc ) ); return 1; |