aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet
diff options
context:
space:
mode:
Diffstat (limited to 'net/decnet')
-rw-r--r--net/decnet/af_decnet.c25
-rw-r--r--net/decnet/dn_dev.c6
-rw-r--r--net/decnet/dn_fib.c4
-rw-r--r--net/decnet/dn_route.c6
-rw-r--r--net/decnet/dn_table.c2
5 files changed, 13 insertions, 30 deletions
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index acd48ee522d6..fc2efe899e91 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -1094,7 +1094,7 @@ static int dn_accept(struct socket *sock, struct socket *newsock, int flags)
1094 1094
1095 cb = DN_SKB_CB(skb); 1095 cb = DN_SKB_CB(skb);
1096 sk->sk_ack_backlog--; 1096 sk->sk_ack_backlog--;
1097 newsk = dn_alloc_sock(sk->sk_net, newsock, sk->sk_allocation); 1097 newsk = dn_alloc_sock(sock_net(sk), newsock, sk->sk_allocation);
1098 if (newsk == NULL) { 1098 if (newsk == NULL) {
1099 release_sock(sk); 1099 release_sock(sk);
1100 kfree_skb(skb); 1100 kfree_skb(skb);
@@ -2089,7 +2089,7 @@ static int dn_device_event(struct notifier_block *this, unsigned long event,
2089{ 2089{
2090 struct net_device *dev = (struct net_device *)ptr; 2090 struct net_device *dev = (struct net_device *)ptr;
2091 2091
2092 if (dev->nd_net != &init_net) 2092 if (dev_net(dev) != &init_net)
2093 return NOTIFY_DONE; 2093 return NOTIFY_DONE;
2094 2094
2095 switch(event) { 2095 switch(event) {
@@ -2320,25 +2320,8 @@ static const struct seq_operations dn_socket_seq_ops = {
2320 2320
2321static int dn_socket_seq_open(struct inode *inode, struct file *file) 2321static int dn_socket_seq_open(struct inode *inode, struct file *file)
2322{ 2322{
2323 struct seq_file *seq; 2323 return seq_open_private(file, &dn_socket_seq_ops,
2324 int rc = -ENOMEM; 2324 sizeof(struct dn_iter_state));
2325 struct dn_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL);
2326
2327 if (!s)
2328 goto out;
2329
2330 rc = seq_open(file, &dn_socket_seq_ops);
2331 if (rc)
2332 goto out_kfree;
2333
2334 seq = file->private_data;
2335 seq->private = s;
2336 memset(s, 0, sizeof(*s));
2337out:
2338 return rc;
2339out_kfree:
2340 kfree(s);
2341 goto out;
2342} 2325}
2343 2326
2344static const struct file_operations dn_socket_seq_fops = { 2327static const struct file_operations dn_socket_seq_fops = {
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 1bbfce5f7a2d..2f0ac3c3eb71 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -625,7 +625,7 @@ static const struct nla_policy dn_ifa_policy[IFA_MAX+1] = {
625 625
626static int dn_nl_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) 626static int dn_nl_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
627{ 627{
628 struct net *net = skb->sk->sk_net; 628 struct net *net = sock_net(skb->sk);
629 struct nlattr *tb[IFA_MAX+1]; 629 struct nlattr *tb[IFA_MAX+1];
630 struct dn_dev *dn_db; 630 struct dn_dev *dn_db;
631 struct ifaddrmsg *ifm; 631 struct ifaddrmsg *ifm;
@@ -663,7 +663,7 @@ errout:
663 663
664static int dn_nl_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) 664static int dn_nl_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
665{ 665{
666 struct net *net = skb->sk->sk_net; 666 struct net *net = sock_net(skb->sk);
667 struct nlattr *tb[IFA_MAX+1]; 667 struct nlattr *tb[IFA_MAX+1];
668 struct net_device *dev; 668 struct net_device *dev;
669 struct dn_dev *dn_db; 669 struct dn_dev *dn_db;
@@ -779,7 +779,7 @@ errout:
779 779
780static int dn_nl_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb) 780static int dn_nl_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
781{ 781{
782 struct net *net = skb->sk->sk_net; 782 struct net *net = sock_net(skb->sk);
783 int idx, dn_idx = 0, skip_ndevs, skip_naddr; 783 int idx, dn_idx = 0, skip_ndevs, skip_naddr;
784 struct net_device *dev; 784 struct net_device *dev;
785 struct dn_dev *dn_db; 785 struct dn_dev *dn_db;
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c
index 4aa9a423e606..27ea2e9b080a 100644
--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -504,7 +504,7 @@ static int dn_fib_check_attr(struct rtmsg *r, struct rtattr **rta)
504 504
505static int dn_fib_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) 505static int dn_fib_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
506{ 506{
507 struct net *net = skb->sk->sk_net; 507 struct net *net = sock_net(skb->sk);
508 struct dn_fib_table *tb; 508 struct dn_fib_table *tb;
509 struct rtattr **rta = arg; 509 struct rtattr **rta = arg;
510 struct rtmsg *r = NLMSG_DATA(nlh); 510 struct rtmsg *r = NLMSG_DATA(nlh);
@@ -524,7 +524,7 @@ static int dn_fib_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *
524 524
525static int dn_fib_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) 525static int dn_fib_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
526{ 526{
527 struct net *net = skb->sk->sk_net; 527 struct net *net = sock_net(skb->sk);
528 struct dn_fib_table *tb; 528 struct dn_fib_table *tb;
529 struct rtattr **rta = arg; 529 struct rtattr **rta = arg;
530 struct rtmsg *r = NLMSG_DATA(nlh); 530 struct rtmsg *r = NLMSG_DATA(nlh);
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 9dc0abb50eaf..2f665a516476 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -580,7 +580,7 @@ int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type
580 struct dn_dev *dn = (struct dn_dev *)dev->dn_ptr; 580 struct dn_dev *dn = (struct dn_dev *)dev->dn_ptr;
581 unsigned char padlen = 0; 581 unsigned char padlen = 0;
582 582
583 if (dev->nd_net != &init_net) 583 if (dev_net(dev) != &init_net)
584 goto dump_it; 584 goto dump_it;
585 585
586 if (dn == NULL) 586 if (dn == NULL)
@@ -1512,7 +1512,7 @@ rtattr_failure:
1512 */ 1512 */
1513static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void *arg) 1513static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void *arg)
1514{ 1514{
1515 struct net *net = in_skb->sk->sk_net; 1515 struct net *net = sock_net(in_skb->sk);
1516 struct rtattr **rta = arg; 1516 struct rtattr **rta = arg;
1517 struct rtmsg *rtm = NLMSG_DATA(nlh); 1517 struct rtmsg *rtm = NLMSG_DATA(nlh);
1518 struct dn_route *rt = NULL; 1518 struct dn_route *rt = NULL;
@@ -1601,7 +1601,7 @@ out_free:
1601 */ 1601 */
1602int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb) 1602int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb)
1603{ 1603{
1604 struct net *net = skb->sk->sk_net; 1604 struct net *net = sock_net(skb->sk);
1605 struct dn_route *rt; 1605 struct dn_route *rt;
1606 int h, s_h; 1606 int h, s_h;
1607 int idx, s_idx; 1607 int idx, s_idx;
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c
index e09d915dbd77..3a2830ac89c2 100644
--- a/net/decnet/dn_table.c
+++ b/net/decnet/dn_table.c
@@ -463,7 +463,7 @@ static int dn_fib_table_dump(struct dn_fib_table *tb, struct sk_buff *skb,
463 463
464int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb) 464int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb)
465{ 465{
466 struct net *net = skb->sk->sk_net; 466 struct net *net = sock_net(skb->sk);
467 unsigned int h, s_h; 467 unsigned int h, s_h;
468 unsigned int e = 0, s_e; 468 unsigned int e = 0, s_e;
469 struct dn_fib_table *tb; 469 struct dn_fib_table *tb;