File: net-Unregister-net_default_ip-and-net_default_mac-variabl.patch

package info (click to toggle)
grub2 2.12-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 70,780 kB
  • sloc: ansic: 424,740; asm: 16,228; sh: 9,525; cpp: 2,095; makefile: 1,590; python: 1,468; sed: 431; lex: 393; yacc: 268; awk: 85; lisp: 54; perl: 31
file content (28 lines) | stat: -rw-r--r-- 976 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: B Horn <b@horn.uk>
Date: Thu, 28 Nov 2024 04:05:04 +0000
Subject: net: Unregister net_default_ip and net_default_mac variables hooks
 on unload

The net module is a dependency of normal. So, it shouldn't be possible
to unload the net. Though unregister variables hooks as a precaution.
It also gets in line with unregistering the other net module hooks.

Signed-off-by: B Horn <b@horn.uk>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 grub-core/net/net.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/grub-core/net/net.c b/grub-core/net/net.c
index 556c21d..9c6c84c 100644
--- a/grub-core/net/net.c
+++ b/grub-core/net/net.c
@@ -2214,6 +2214,8 @@ GRUB_MOD_FINI(net)
 
   grub_register_variable_hook ("net_default_server", 0, 0);
   grub_register_variable_hook ("pxe_default_server", 0, 0);
+  grub_register_variable_hook ("net_default_ip", 0, 0);
+  grub_register_variable_hook ("net_default_mac", 0, 0);
 
   grub_bootp_fini ();
   grub_dns_fini ();