diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2012-01-18 17:13:34 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-01-19 12:35:07 -0500 |
commit | 3d8fe98f8d5cb303d907d8f94ea6dc1f9a1d8b7a (patch) | |
tree | 12152a144b19938b17e112a2dc7d6f1ffb9d158c /drivers/net/ethernet/intel | |
parent | b5417bf8e8952401bca69ded67c30ead484af823 (diff) |
ixgbevf: make operations tables const
The arrays of function pointers should be const to make life harder
for rootkits.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbevf/vf.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbevf/vf.h | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h index 74b22ee497e7..9075c1d61039 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | |||
@@ -279,12 +279,12 @@ enum ixgbevf_boards { | |||
279 | board_X540_vf, | 279 | board_X540_vf, |
280 | }; | 280 | }; |
281 | 281 | ||
282 | extern struct ixgbevf_info ixgbevf_82599_vf_info; | 282 | extern const struct ixgbevf_info ixgbevf_82599_vf_info; |
283 | extern struct ixgbevf_info ixgbevf_X540_vf_info; | 283 | extern const struct ixgbevf_info ixgbevf_X540_vf_info; |
284 | extern const struct ixgbe_mbx_operations ixgbevf_mbx_ops; | 284 | extern const struct ixgbe_mbx_operations ixgbevf_mbx_ops; |
285 | 285 | ||
286 | /* needed by ethtool.c */ | 286 | /* needed by ethtool.c */ |
287 | extern char ixgbevf_driver_name[]; | 287 | extern const char ixgbevf_driver_name[]; |
288 | extern const char ixgbevf_driver_version[]; | 288 | extern const char ixgbevf_driver_version[]; |
289 | 289 | ||
290 | extern int ixgbevf_up(struct ixgbevf_adapter *adapter); | 290 | extern int ixgbevf_up(struct ixgbevf_adapter *adapter); |
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 1cad3b6d2c30..bed411bada21 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | |||
@@ -53,7 +53,7 @@ | |||
53 | 53 | ||
54 | #include "ixgbevf.h" | 54 | #include "ixgbevf.h" |
55 | 55 | ||
56 | char ixgbevf_driver_name[] = "ixgbevf"; | 56 | const char ixgbevf_driver_name[] = "ixgbevf"; |
57 | static const char ixgbevf_driver_string[] = | 57 | static const char ixgbevf_driver_string[] = |
58 | "Intel(R) 10 Gigabit PCI Express Virtual Function Network Driver"; | 58 | "Intel(R) 10 Gigabit PCI Express Virtual Function Network Driver"; |
59 | 59 | ||
diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.c b/drivers/net/ethernet/intel/ixgbevf/vf.c index 5c8c23f8346f..d0138d7a31a1 100644 --- a/drivers/net/ethernet/intel/ixgbevf/vf.c +++ b/drivers/net/ethernet/intel/ixgbevf/vf.c | |||
@@ -402,7 +402,7 @@ static s32 ixgbevf_check_mac_link_vf(struct ixgbe_hw *hw, | |||
402 | return 0; | 402 | return 0; |
403 | } | 403 | } |
404 | 404 | ||
405 | static struct ixgbe_mac_operations ixgbevf_mac_ops = { | 405 | static const struct ixgbe_mac_operations ixgbevf_mac_ops = { |
406 | .init_hw = ixgbevf_init_hw_vf, | 406 | .init_hw = ixgbevf_init_hw_vf, |
407 | .reset_hw = ixgbevf_reset_hw_vf, | 407 | .reset_hw = ixgbevf_reset_hw_vf, |
408 | .start_hw = ixgbevf_start_hw_vf, | 408 | .start_hw = ixgbevf_start_hw_vf, |
@@ -416,12 +416,12 @@ static struct ixgbe_mac_operations ixgbevf_mac_ops = { | |||
416 | .set_vfta = ixgbevf_set_vfta_vf, | 416 | .set_vfta = ixgbevf_set_vfta_vf, |
417 | }; | 417 | }; |
418 | 418 | ||
419 | struct ixgbevf_info ixgbevf_82599_vf_info = { | 419 | const struct ixgbevf_info ixgbevf_82599_vf_info = { |
420 | .mac = ixgbe_mac_82599_vf, | 420 | .mac = ixgbe_mac_82599_vf, |
421 | .mac_ops = &ixgbevf_mac_ops, | 421 | .mac_ops = &ixgbevf_mac_ops, |
422 | }; | 422 | }; |
423 | 423 | ||
424 | struct ixgbevf_info ixgbevf_X540_vf_info = { | 424 | const struct ixgbevf_info ixgbevf_X540_vf_info = { |
425 | .mac = ixgbe_mac_X540_vf, | 425 | .mac = ixgbe_mac_X540_vf, |
426 | .mac_ops = &ixgbevf_mac_ops, | 426 | .mac_ops = &ixgbevf_mac_ops, |
427 | }; | 427 | }; |
diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.h b/drivers/net/ethernet/intel/ixgbevf/vf.h index 10306b492ee6..d556619a9212 100644 --- a/drivers/net/ethernet/intel/ixgbevf/vf.h +++ b/drivers/net/ethernet/intel/ixgbevf/vf.h | |||
@@ -167,7 +167,7 @@ struct ixgbevf_hw_stats { | |||
167 | 167 | ||
168 | struct ixgbevf_info { | 168 | struct ixgbevf_info { |
169 | enum ixgbe_mac_type mac; | 169 | enum ixgbe_mac_type mac; |
170 | struct ixgbe_mac_operations *mac_ops; | 170 | const struct ixgbe_mac_operations *mac_ops; |
171 | }; | 171 | }; |
172 | 172 | ||
173 | #endif /* __IXGBE_VF_H__ */ | 173 | #endif /* __IXGBE_VF_H__ */ |