mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 04:02:20 +00:00
0970bf676f
'struct llc_sap_state_trans' are not modified in this driver. Constifying this structure moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig, as an example: Before: ====== text data bss dec hex filename 339 456 24 819 333 net/llc/llc_s_st.o After: ===== text data bss dec hex filename 683 144 0 827 33b net/llc/llc_s_st.o Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/9d17587639195ee94b74ff06a11ef97d1833ee52.1720973710.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski <kuba@kernel.org>
39 lines
1.0 KiB
C
39 lines
1.0 KiB
C
#ifndef LLC_S_ST_H
|
|
#define LLC_S_ST_H
|
|
/*
|
|
* Copyright (c) 1997 by Procom Technology,Inc.
|
|
* 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
|
|
*
|
|
* This program can be redistributed or modified under the terms of the
|
|
* GNU General Public License as published by the Free Software Foundation.
|
|
* This program is distributed without any warranty or implied warranty
|
|
* of merchantability or fitness for a particular purpose.
|
|
*
|
|
* See the GNU General Public License for more details.
|
|
*/
|
|
|
|
#include <linux/types.h>
|
|
#include <net/llc_s_ac.h>
|
|
#include <net/llc_s_ev.h>
|
|
|
|
struct llc_sap_state_trans;
|
|
|
|
#define LLC_NR_SAP_STATES 2 /* size of state table */
|
|
|
|
/* structures and types */
|
|
/* SAP state table structure */
|
|
struct llc_sap_state_trans {
|
|
llc_sap_ev_t ev;
|
|
u8 next_state;
|
|
const llc_sap_action_t *ev_actions;
|
|
};
|
|
|
|
struct llc_sap_state {
|
|
u8 curr_state;
|
|
const struct llc_sap_state_trans **transitions;
|
|
};
|
|
|
|
/* only access to SAP state table */
|
|
extern struct llc_sap_state llc_sap_state_table[LLC_NR_SAP_STATES];
|
|
#endif /* LLC_S_ST_H */
|