Skip to contentSkip to conversation

backport: add backport for get_net_ns_by_fd()

PATCH Superseded Arend van Spriel 2 participants 3 messages Jan 30, 2015

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 backport: add backport for get_net_ns_by_fd()

In mac80211-next a call to get_net_ns_by_fd() has been added in cfg80211 which resides in networking core. This function has been backported such that it will always fail, ie. as it would when CONFIG_NET_NS is not defined. The call was added by:

commit 4b681c82d2f9bef121c912ffcaac89a004af3f2c
Author: Vadim Kochan <[email protected]>
Date: Mon Jan 12 16:34:05 2015 +0200

nl80211: Allow set network namespace by fd

---
This patch replaces the commit
"backport: add backport file for the next kernel release" which has Message-ID: <[email protected]>

Changes:
V2
- solve backport using LINUX_BACKPORT macro (Johannes Berg)

---
 backport/backport-include/net/net_namespace.h | 6 ++++++
 1 file changed, 6 insertions(+)
backport/backport-include/net/net_namespace.h +6 -0
index e83b103..8927af7 100644
@@ -24,4 +24,10 @@ net_ieee802154_lowpan(struct net *net)
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) */
 #endif /* CPTCFG_IEEE802154_6LOWPAN */
 
+#define get_net_ns_by_fd	LINUX_BACKPORT(get_net_ns_by_fd)
+static inline struct net *get_net_ns_by_fd(int fd)
+{
+	return ERR_PTR(-EINVAL);
+}
+
 #endif	/* _COMPAT_NET_NET_NAMESPACE_H */
Signature · 1 line
1.9.1
#1 lore raw
Quoted 29 lines · Arend van Spriel

In mac80211-next a call to get_net_ns_by_fd() has been added in cfg80211 which resides in networking core. This function has been backported such that it will always fail, ie. as it would when CONFIG_NET_NS is not defined. The call was added by:

commit 4b681c82d2f9bef121c912ffcaac89a004af3f2c
Author: Vadim Kochan <[email protected]>
Date: Mon Jan 12 16:34:05 2015 +0200

nl80211: Allow set network namespace by fd

---
This patch replaces the commit
"backport: add backport file for the next kernel release" which has Message-ID: <[email protected]>

Changes:
V2
- solve backport using LINUX_BACKPORT macro (Johannes Berg)

---
 backport/backport-include/net/net_namespace.h | 6 ++++++
 1 file changed, 6 insertions(+)
backport/backport-include/net/net_namespace.h +0 -0
index e83b103..8927af7 100644

backport/backport-include/net/net_namespace.h net_ieee802154_lowpan(struct net *net) · line 26

Quoted 3 lines
backport/backport-include/net/net_namespace.h +0 -0
@@ -24,4 +24,10 @@ net_ieee802154_lowpan(struct net *net)
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) */
 #endif /* CPTCFG_IEEE802154_6LOWPAN */
 

When we are on a kernel which exports this function like 3.20, this code should not get compiled in. Your should add something like this:
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,20,0)

Quoted 8 lines
backport/backport-include/net/net_namespace.h +6 -0
+#define get_net_ns_by_fd	LINUX_BACKPORT(get_net_ns_by_fd)
+static inline struct net *get_net_ns_by_fd(int fd)
+{
+	return ERR_PTR(-EINVAL);
+}
+
 #endif	/* _COMPAT_NET_NET_NAMESPACE_H */
#2 lore raw
Quoted 27 lines · Hauke Mehrtens
Quoted 24 lines · Arend van Spriel

In mac80211-next a call to get_net_ns_by_fd() has been added in cfg80211 which resides in networking core. This function has been backported such that it will always fail, ie. as it would when CONFIG_NET_NS is not defined. The call was added by:

commit 4b681c82d2f9bef121c912ffcaac89a004af3f2c
Author: Vadim Kochan<[email protected]>
Date: Mon Jan 12 16:34:05 2015 +0200

nl80211: Allow set network namespace by fd

---
This patch replaces the commit
"backport: add backport file for the next kernel release" which has Message-ID:<[email protected]>

Changes:
V2
- solve backport using LINUX_BACKPORT macro (Johannes Berg)

---
  backport/backport-include/net/net_namespace.h | 6 ++++++
  1 file changed, 6 insertions(+)
Quoted 12 lines

backport/backport-include/net/net_namespace.h net_ieee802154_lowpan(struct net *net) · line 26

Quoted 8 lines
backport/backport-include/net/net_namespace.h +0 -0
index e83b103..8927af7 100644
@@ -24,4 +24,10 @@ net_ieee802154_lowpan(struct net *net)
  #endif /* LINUX_VERSION_CODE<  KERNEL_VERSION(3,15,0) */
  #endif /* CPTCFG_IEEE802154_6LOWPAN */
 

When we are on a kernel which exports this function like 3.20, this code should not get compiled in. Your should add something like this:
#if LINUX_VERSION_CODE< KERNEL_VERSION(3,20,0)

That indeed makes sense. Thanks.

Regards,
Arend

Quoted 8 lines
Quoted 8 lines
backport/backport-include/net/net_namespace.h +6 -0
+#define get_net_ns_by_fd	LINUX_BACKPORT(get_net_ns_by_fd)
+static inline struct net *get_net_ns_by_fd(int fd)
+{
+	return ERR_PTR(-EINVAL);
+}
+
  #endif	/* _COMPAT_NET_NET_NAMESPACE_H */