Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Kubecek <mkubecek@suse.cz>2019-02-14 14:04:28 +0100
committerMichal Kubecek <mkubecek@suse.cz>2019-02-14 14:04:28 +0100
commit8ff20eeeffe6bb471759a5e956e47e6e682a92ee (patch)
tree1e1984a0a0842a7371d3c8757182cfb5f261e403
parentf07d3e7ebda03134cd028b95bc0dfdea6e44771e (diff)
kabi: handle addition of ip6addrlbl_table into struct netns_ipv6
(bsc#1122982). suse-commit: 7e7aa51b485fc0e0274a76ad9a3000a6182bfc02
-rw-r--r--include/net/net_namespace.h7
-rw-r--r--include/net/netns/ipv6.h5
-rw-r--r--net/ipv6/addrlabel.c34
3 files changed, 24 insertions, 22 deletions
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index c4d2e82d9881..e733f115515e 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -147,6 +147,13 @@ struct net {
#endif
struct sock *diag_nlsk;
atomic_t fnhe_genid;
+#ifndef __GENKSYMS__
+ struct {
+ struct hlist_head head;
+ spinlock_t lock;
+ u32 seq;
+ } ip6addrlbl_table;
+#endif
};
#include <linux/seq_file_net.h>
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index 9e8caa8823b0..de7745e2edcc 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -86,11 +86,6 @@ struct netns_ipv6 {
atomic_t dev_addr_genid;
atomic_t fib6_sernum;
struct seg6_pernet_data *seg6_data;
- struct {
- struct hlist_head head;
- spinlock_t lock;
- u32 seq;
- } ip6addrlbl_table;
};
#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c
index 8482c5145d79..26b4a13e4c96 100644
--- a/net/ipv6/addrlabel.c
+++ b/net/ipv6/addrlabel.c
@@ -152,7 +152,7 @@ static struct ip6addrlbl_entry *__ipv6_addr_label(struct net *net,
{
struct ip6addrlbl_entry *p;
- hlist_for_each_entry_rcu(p, &net->ipv6.ip6addrlbl_table.head, list) {
+ hlist_for_each_entry_rcu(p, &net->ip6addrlbl_table.head, list) {
if (__ip6addrlbl_match(p, addr, type, ifindex))
return p;
}
@@ -233,7 +233,7 @@ static int __ip6addrlbl_add(struct net *net, struct ip6addrlbl_entry *newp,
ADDRLABEL(KERN_DEBUG "%s(newp=%p, replace=%d)\n", __func__, newp,
replace);
- hlist_for_each_entry_safe(p, n, &net->ipv6.ip6addrlbl_table.head, list) {
+ hlist_for_each_entry_safe(p, n, &net->ip6addrlbl_table.head, list) {
if (p->prefixlen == newp->prefixlen &&
p->ifindex == newp->ifindex &&
ipv6_addr_equal(&p->prefix, &newp->prefix)) {
@@ -254,10 +254,10 @@ static int __ip6addrlbl_add(struct net *net, struct ip6addrlbl_entry *newp,
if (last)
hlist_add_behind_rcu(&newp->list, &last->list);
else
- hlist_add_head_rcu(&newp->list, &net->ipv6.ip6addrlbl_table.head);
+ hlist_add_head_rcu(&newp->list, &net->ip6addrlbl_table.head);
out:
if (!ret)
- net->ipv6.ip6addrlbl_table.seq++;
+ net->ip6addrlbl_table.seq++;
return ret;
}
@@ -276,9 +276,9 @@ static int ip6addrlbl_add(struct net *net,
newp = ip6addrlbl_alloc(prefix, prefixlen, ifindex, label);
if (IS_ERR(newp))
return PTR_ERR(newp);
- spin_lock(&net->ipv6.ip6addrlbl_table.lock);
+ spin_lock(&net->ip6addrlbl_table.lock);
ret = __ip6addrlbl_add(net, newp, replace);
- spin_unlock(&net->ipv6.ip6addrlbl_table.lock);
+ spin_unlock(&net->ip6addrlbl_table.lock);
if (ret)
ip6addrlbl_free(newp);
return ret;
@@ -296,7 +296,7 @@ static int __ip6addrlbl_del(struct net *net,
ADDRLABEL(KERN_DEBUG "%s(prefix=%pI6, prefixlen=%d, ifindex=%d)\n",
__func__, prefix, prefixlen, ifindex);
- hlist_for_each_entry_safe(p, n, &net->ipv6.ip6addrlbl_table.head, list) {
+ hlist_for_each_entry_safe(p, n, &net->ip6addrlbl_table.head, list) {
if (p->prefixlen == prefixlen &&
p->ifindex == ifindex &&
ipv6_addr_equal(&p->prefix, prefix)) {
@@ -320,9 +320,9 @@ static int ip6addrlbl_del(struct net *net,
__func__, prefix, prefixlen, ifindex);
ipv6_addr_prefix(&prefix_buf, prefix, prefixlen);
- spin_lock(&net->ipv6.ip6addrlbl_table.lock);
+ spin_lock(&net->ip6addrlbl_table.lock);
ret = __ip6addrlbl_del(net, &prefix_buf, prefixlen, ifindex);
- spin_unlock(&net->ipv6.ip6addrlbl_table.lock);
+ spin_unlock(&net->ip6addrlbl_table.lock);
return ret;
}
@@ -334,8 +334,8 @@ static int __net_init ip6addrlbl_net_init(struct net *net)
ADDRLABEL(KERN_DEBUG "%s\n", __func__);
- spin_lock_init(&net->ipv6.ip6addrlbl_table.lock);
- INIT_HLIST_HEAD(&net->ipv6.ip6addrlbl_table.head);
+ spin_lock_init(&net->ip6addrlbl_table.lock);
+ INIT_HLIST_HEAD(&net->ip6addrlbl_table.head);
for (i = 0; i < ARRAY_SIZE(ip6addrlbl_init_table); i++) {
int ret = ip6addrlbl_add(net,
@@ -356,12 +356,12 @@ static void __net_exit ip6addrlbl_net_exit(struct net *net)
struct hlist_node *n;
/* Remove all labels belonging to the exiting net */
- spin_lock(&net->ipv6.ip6addrlbl_table.lock);
- hlist_for_each_entry_safe(p, n, &net->ipv6.ip6addrlbl_table.head, list) {
+ spin_lock(&net->ip6addrlbl_table.lock);
+ hlist_for_each_entry_safe(p, n, &net->ip6addrlbl_table.head, list) {
hlist_del_rcu(&p->list);
ip6addrlbl_put(p);
}
- spin_unlock(&net->ipv6.ip6addrlbl_table.lock);
+ spin_unlock(&net->ip6addrlbl_table.lock);
}
static struct pernet_operations ipv6_addr_label_ops = {
@@ -477,10 +477,10 @@ static int ip6addrlbl_dump(struct sk_buff *skb, struct netlink_callback *cb)
int err;
rcu_read_lock();
- hlist_for_each_entry_rcu(p, &net->ipv6.ip6addrlbl_table.head, list) {
+ hlist_for_each_entry_rcu(p, &net->ip6addrlbl_table.head, list) {
if (idx >= s_idx) {
err = ip6addrlbl_fill(skb, p,
- net->ipv6.ip6addrlbl_table.seq,
+ net->ip6addrlbl_table.seq,
NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq,
RTM_NEWADDRLABEL,
@@ -537,7 +537,7 @@ static int ip6addrlbl_get(struct sk_buff *in_skb, struct nlmsghdr *nlh,
p = __ipv6_addr_label(net, addr, ipv6_addr_type(addr), ifal->ifal_index);
if (p && !ip6addrlbl_hold(p))
p = NULL;
- lseq = net->ipv6.ip6addrlbl_table.seq;
+ lseq = net->ip6addrlbl_table.seq;
rcu_read_unlock();
if (!p) {