diff options
Diffstat (limited to 'net/decnet')
-rw-r--r-- | net/decnet/dn_dev.c | 4 | ||||
-rw-r--r-- | net/decnet/dn_fib.c | 4 | ||||
-rw-r--r-- | net/decnet/dn_route.c | 16 | ||||
-rw-r--r-- | net/decnet/netfilter/dn_rtmsg.c | 2 |
4 files changed, 19 insertions, 7 deletions
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index a603823a3e27..3b726f31c64c 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
@@ -574,7 +574,7 @@ static int dn_nl_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
574 | struct dn_ifaddr __rcu **ifap; | 574 | struct dn_ifaddr __rcu **ifap; |
575 | int err = -EINVAL; | 575 | int err = -EINVAL; |
576 | 576 | ||
577 | if (!capable(CAP_NET_ADMIN)) | 577 | if (!netlink_capable(skb, CAP_NET_ADMIN)) |
578 | return -EPERM; | 578 | return -EPERM; |
579 | 579 | ||
580 | if (!net_eq(net, &init_net)) | 580 | if (!net_eq(net, &init_net)) |
@@ -618,7 +618,7 @@ static int dn_nl_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
618 | struct dn_ifaddr *ifa; | 618 | struct dn_ifaddr *ifa; |
619 | int err; | 619 | int err; |
620 | 620 | ||
621 | if (!capable(CAP_NET_ADMIN)) | 621 | if (!netlink_capable(skb, CAP_NET_ADMIN)) |
622 | return -EPERM; | 622 | return -EPERM; |
623 | 623 | ||
624 | if (!net_eq(net, &init_net)) | 624 | if (!net_eq(net, &init_net)) |
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c index 57dc159245ec..d332aefb0846 100644 --- a/net/decnet/dn_fib.c +++ b/net/decnet/dn_fib.c | |||
@@ -505,7 +505,7 @@ static int dn_fib_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
505 | struct nlattr *attrs[RTA_MAX+1]; | 505 | struct nlattr *attrs[RTA_MAX+1]; |
506 | int err; | 506 | int err; |
507 | 507 | ||
508 | if (!capable(CAP_NET_ADMIN)) | 508 | if (!netlink_capable(skb, CAP_NET_ADMIN)) |
509 | return -EPERM; | 509 | return -EPERM; |
510 | 510 | ||
511 | if (!net_eq(net, &init_net)) | 511 | if (!net_eq(net, &init_net)) |
@@ -530,7 +530,7 @@ static int dn_fib_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
530 | struct nlattr *attrs[RTA_MAX+1]; | 530 | struct nlattr *attrs[RTA_MAX+1]; |
531 | int err; | 531 | int err; |
532 | 532 | ||
533 | if (!capable(CAP_NET_ADMIN)) | 533 | if (!netlink_capable(skb, CAP_NET_ADMIN)) |
534 | return -EPERM; | 534 | return -EPERM; |
535 | 535 | ||
536 | if (!net_eq(net, &init_net)) | 536 | if (!net_eq(net, &init_net)) |
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index ce0cbbfe0f43..daccc4a36d80 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c | |||
@@ -752,7 +752,7 @@ static int dn_to_neigh_output(struct sk_buff *skb) | |||
752 | return n->output(n, skb); | 752 | return n->output(n, skb); |
753 | } | 753 | } |
754 | 754 | ||
755 | static int dn_output(struct sk_buff *skb) | 755 | static int dn_output(struct sock *sk, struct sk_buff *skb) |
756 | { | 756 | { |
757 | struct dst_entry *dst = skb_dst(skb); | 757 | struct dst_entry *dst = skb_dst(skb); |
758 | struct dn_route *rt = (struct dn_route *)dst; | 758 | struct dn_route *rt = (struct dn_route *)dst; |
@@ -838,6 +838,18 @@ drop: | |||
838 | * Used to catch bugs. This should never normally get | 838 | * Used to catch bugs. This should never normally get |
839 | * called. | 839 | * called. |
840 | */ | 840 | */ |
841 | static int dn_rt_bug_sk(struct sock *sk, struct sk_buff *skb) | ||
842 | { | ||
843 | struct dn_skb_cb *cb = DN_SKB_CB(skb); | ||
844 | |||
845 | net_dbg_ratelimited("dn_rt_bug: skb from:%04x to:%04x\n", | ||
846 | le16_to_cpu(cb->src), le16_to_cpu(cb->dst)); | ||
847 | |||
848 | kfree_skb(skb); | ||
849 | |||
850 | return NET_RX_DROP; | ||
851 | } | ||
852 | |||
841 | static int dn_rt_bug(struct sk_buff *skb) | 853 | static int dn_rt_bug(struct sk_buff *skb) |
842 | { | 854 | { |
843 | struct dn_skb_cb *cb = DN_SKB_CB(skb); | 855 | struct dn_skb_cb *cb = DN_SKB_CB(skb); |
@@ -1463,7 +1475,7 @@ make_route: | |||
1463 | 1475 | ||
1464 | rt->n = neigh; | 1476 | rt->n = neigh; |
1465 | rt->dst.lastuse = jiffies; | 1477 | rt->dst.lastuse = jiffies; |
1466 | rt->dst.output = dn_rt_bug; | 1478 | rt->dst.output = dn_rt_bug_sk; |
1467 | switch (res.type) { | 1479 | switch (res.type) { |
1468 | case RTN_UNICAST: | 1480 | case RTN_UNICAST: |
1469 | rt->dst.input = dn_forward; | 1481 | rt->dst.input = dn_forward; |
diff --git a/net/decnet/netfilter/dn_rtmsg.c b/net/decnet/netfilter/dn_rtmsg.c index e83015cecfa7..e4d9560a910b 100644 --- a/net/decnet/netfilter/dn_rtmsg.c +++ b/net/decnet/netfilter/dn_rtmsg.c | |||
@@ -107,7 +107,7 @@ static inline void dnrmg_receive_user_skb(struct sk_buff *skb) | |||
107 | if (nlh->nlmsg_len < sizeof(*nlh) || skb->len < nlh->nlmsg_len) | 107 | if (nlh->nlmsg_len < sizeof(*nlh) || skb->len < nlh->nlmsg_len) |
108 | return; | 108 | return; |
109 | 109 | ||
110 | if (!capable(CAP_NET_ADMIN)) | 110 | if (!netlink_capable(skb, CAP_NET_ADMIN)) |
111 | RCV_SKB_FAIL(-EPERM); | 111 | RCV_SKB_FAIL(-EPERM); |
112 | 112 | ||
113 | /* Eventually we might send routing messages too */ | 113 | /* Eventually we might send routing messages too */ |