projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net: dsa: mv88e6352: Refactor shareable code
[firefly-linux-kernel-4.4.55.git]
/
net
/
netfilter
/
nfnetlink.c
diff --git
a/net/netfilter/nfnetlink.c
b/net/netfilter/nfnetlink.c
index cde4a6702fa3199421d6ced324e2bb74fdaa46ab..8b117c90ecd765ac1b7242c58f36ef7531a49b6e 100644
(file)
--- a/
net/netfilter/nfnetlink.c
+++ b/
net/netfilter/nfnetlink.c
@@
-272,7
+272,7
@@
static void nfnl_err_deliver(struct list_head *err_list, struct sk_buff *skb)
static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh,
u_int16_t subsys_id)
{
static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh,
u_int16_t subsys_id)
{
- struct sk_buff *
nskb, *
oskb = skb;
+ struct sk_buff *oskb = skb;
struct net *net = sock_net(skb->sk);
const struct nfnetlink_subsystem *ss;
const struct nfnl_callback *nc;
struct net *net = sock_net(skb->sk);
const struct nfnetlink_subsystem *ss;
const struct nfnl_callback *nc;
@@
-283,12
+283,11
@@
static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh,
if (subsys_id >= NFNL_SUBSYS_COUNT)
return netlink_ack(skb, nlh, -EINVAL);
replay:
if (subsys_id >= NFNL_SUBSYS_COUNT)
return netlink_ack(skb, nlh, -EINVAL);
replay:
-
n
skb = netlink_skb_clone(oskb, GFP_KERNEL);
- if (!
n
skb)
+ skb = netlink_skb_clone(oskb, GFP_KERNEL);
+ if (!skb)
return netlink_ack(oskb, nlh, -ENOMEM);
return netlink_ack(oskb, nlh, -ENOMEM);
- nskb->sk = oskb->sk;
- skb = nskb;
+ skb->sk = oskb->sk;
nfnl_lock(subsys_id);
ss = rcu_dereference_protected(table[subsys_id].subsys,
nfnl_lock(subsys_id);
ss = rcu_dereference_protected(table[subsys_id].subsys,
@@
-305,7
+304,7
@@
replay:
{
nfnl_unlock(subsys_id);
netlink_ack(skb, nlh, -EOPNOTSUPP);
{
nfnl_unlock(subsys_id);
netlink_ack(skb, nlh, -EOPNOTSUPP);
- return kfree_skb(
n
skb);
+ return kfree_skb(skb);
}
}
}
}
@@
-321,7
+320,8
@@
replay:
nlh = nlmsg_hdr(skb);
err = 0;
nlh = nlmsg_hdr(skb);
err = 0;
- if (nlh->nlmsg_len < NLMSG_HDRLEN) {
+ if (nlmsg_len(nlh) < sizeof(struct nfgenmsg) ||
+ skb->len < nlh->nlmsg_len) {
err = -EINVAL;
goto ack;
}
err = -EINVAL;
goto ack;
}
@@
-385,7
+385,7
@@
replay:
nfnl_err_reset(&err_list);
ss->abort(oskb);
nfnl_unlock(subsys_id);
nfnl_err_reset(&err_list);
ss->abort(oskb);
nfnl_unlock(subsys_id);
- kfree_skb(
n
skb);
+ kfree_skb(skb);
goto replay;
}
}
goto replay;
}
}
@@
-426,7
+426,7
@@
done:
nfnl_err_deliver(&err_list, oskb);
nfnl_unlock(subsys_id);
nfnl_err_deliver(&err_list, oskb);
nfnl_unlock(subsys_id);
- kfree_skb(
n
skb);
+ kfree_skb(skb);
}
static void nfnetlink_rcv(struct sk_buff *skb)
}
static void nfnetlink_rcv(struct sk_buff *skb)
@@
-469,7
+469,7
@@
static int nfnetlink_bind(struct net *net, int group)
int type;
if (group <= NFNLGRP_NONE || group > NFNLGRP_MAX)
int type;
if (group <= NFNLGRP_NONE || group > NFNLGRP_MAX)
- return
-EINVAL
;
+ return
0
;
type = nfnl_group2type[group];
type = nfnl_group2type[group];