Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F173481192
D59999.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D59999.diff
View Options
diff --git a/stand/common/dev_net.h b/stand/common/dev_net.h
--- a/stand/common/dev_net.h
+++ b/stand/common/dev_net.h
@@ -30,6 +30,7 @@
extern struct devsw netdev;
int net_configure(struct devdesc *);
+void net_deconfigure(void);
uint32_t net_parse_rootpath(void);
#endif
diff --git a/stand/common/dev_net.c b/stand/common/dev_net.c
--- a/stand/common/dev_net.c
+++ b/stand/common/dev_net.c
@@ -176,21 +176,42 @@
int
net_configure(struct devdesc *dev)
{
- int error, sock;
+ int error;
- sock = netif_open(dev);
- if (sock < 0)
+ if (netdev_sock >= 0)
+ return (0);
+
+ netdev_sock = netif_open(dev);
+ if (netdev_sock < 0)
return (ENXIO);
error = 0;
if (rootip.s_addr == 0)
- error = net_getparams(sock);
+ error = net_getparams(netdev_sock);
if (error == 0)
- net_setparams(sock);
- netif_close(sock);
+ net_setparams(netdev_sock);
+ if (error != 0) {
+ netif_close(netdev_sock);
+ netdev_sock = -1;
+ return (error);
+ }
+
+ netdev_name = strdup(dev->d_dev->dv_name);
+ if (netdev_name == NULL) {
+ netif_close(netdev_sock);
+ netdev_sock = -1;
+ return (ENOMEM);
+ }
return (error);
}
+void
+net_deconfigure(void)
+{
+
+ net_cleanup();
+}
+
static int
net_close(struct open_file *f)
{
diff --git a/stand/efi/loader/memdisk.c b/stand/efi/loader/memdisk.c
--- a/stand/efi/loader/memdisk.c
+++ b/stand/efi/loader/memdisk.c
@@ -245,6 +245,8 @@
if (url == NULL || *url == '\0')
return;
+ /* Release SNP so the firmware network stack can fetch the image. */
+ net_deconfigure();
printf("Downloading initmd from %s\n", url);
error = download_md_image(url);
if (error != 0 && error != ECANCELED)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Sep 27, 6:26 AM (15 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39722270
Default Alt Text
D59999.diff (1 KB)
Attached To
Mode
D59999: loader.efi: Retain standalone network configuration
Attached
Detach File
Event Timeline
Log In to Comment