forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
can: initial support for network namespaces
This patch adds initial support for network namespaces. The changes only enable support in the CAN raw, proc and af_can code. GW and BCM still have their checks that ensure that they are used only from the main namespace. The patch boils down to moving the global structures, i.e. the global filter list and their /proc stats, into a per-namespace structure and passing around the corresponding "struct net" in a lot of different places. Changes since v1: - rebased on current HEAD (2bfe01e) - fixed overlong line Signed-off-by: Mario Kicherer <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
- Loading branch information
1 parent
dabf54d
commit 8e8cda6
Showing
9 changed files
with
242 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* can in net namespaces | ||
*/ | ||
|
||
#ifndef __NETNS_CAN_H__ | ||
#define __NETNS_CAN_H__ | ||
|
||
#include <linux/spinlock.h> | ||
|
||
struct dev_rcv_lists; | ||
|
||
struct netns_can { | ||
#if IS_ENABLED(CONFIG_PROC_FS) | ||
struct proc_dir_entry *proc_dir; | ||
struct proc_dir_entry *pde_version; | ||
struct proc_dir_entry *pde_stats; | ||
struct proc_dir_entry *pde_reset_stats; | ||
struct proc_dir_entry *pde_rcvlist_all; | ||
struct proc_dir_entry *pde_rcvlist_fil; | ||
struct proc_dir_entry *pde_rcvlist_inv; | ||
struct proc_dir_entry *pde_rcvlist_sff; | ||
struct proc_dir_entry *pde_rcvlist_eff; | ||
struct proc_dir_entry *pde_rcvlist_err; | ||
#endif | ||
|
||
/* receive filters subscribed for 'all' CAN devices */ | ||
struct dev_rcv_lists *can_rx_alldev_list; | ||
spinlock_t can_rcvlists_lock; | ||
}; | ||
|
||
#endif /* __NETNS_CAN_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.