]> git.ipfire.org Git - network.git/commitdiff
ports: Constify info struct
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 4 Jun 2023 17:12:52 +0000 (17:12 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 4 Jun 2023 17:12:52 +0000 (17:12 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/networkd/port-dummy.c
src/networkd/port-dummy.h
src/networkd/port-vlan.c
src/networkd/port-vlan.h
src/networkd/port.h

index d6842d0cea722e53d9b460f7f17029a0dc69844e..e71e740dafb471dcf0fd56eb5af8f424b0c9cd85 100644 (file)
@@ -20,6 +20,6 @@
 
 #include "port-dummy.h"
 
-nw_port_info_t nw_port_info_dummy = {
+const nw_port_info_t nw_port_info_dummy = {
        .kind = "dummy",
 };
index b07cf3998596f3091033b6294b0568dbfd71b6f9..b74c991eb80e58fddb3fa626fcee21e2fa506eb4 100644 (file)
@@ -23,6 +23,6 @@
 
 #include "port.h"
 
-extern nw_port_info_t nw_port_info_dummy;
+extern const nw_port_info_t nw_port_info_dummy;
 
 #endif /* NETWORKD_PORT_DUMMY_H */
index f1cd9fbb107941ea4a677e338f0c5e933a11ab21..5e970e9108770470b7ec0edfc220b68f8acdeabf 100644 (file)
@@ -77,7 +77,7 @@ static int nw_port_vlan_create_link(nw_port* port, sd_netlink_message* m) {
        return 0;
 }
 
-nw_port_info_t nw_port_info_vlan = {
+const nw_port_info_t nw_port_info_vlan = {
        .kind = "vlan",
 
        // Operations
index c666dfb6b5124d2b7e9b1631ce52ca1bfc735aa6..f02c529c99ef2fabe012cef35fbf324446208c46 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "port.h"
 
-extern nw_port_info_t nw_port_info_vlan;
+extern const nw_port_info_t nw_port_info_vlan;
 
 // ID
 int nw_port_get_vlan_id(nw_port* port);
index b73c5fe97c5d1419a01352c949d31d920ee15c30..8bc4db8af32e9aa0c7eabdd988a60ee12b06c3ef 100644 (file)
@@ -84,7 +84,7 @@ struct nw_port {
        nw_address_t address;
 
        // Type Operations
-       nw_port_info_t* info;
+       const nw_port_info_t* info;
 
        // VLAN settings
        struct nw_port_vlan {