Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78317
b: refs/heads/master
c: a3c8e7f
h: refs/heads/master
i:
  78315: 552ab9d
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Jan 28, 2008
1 parent 32694dd commit f8bbdc4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e48b9b2fb383879a5d758d526b5eb8de4509f467
refs/heads/master: a3c8e7fd4b36bf6e12fef432cfa8a001dc0b7a26
31 changes: 12 additions & 19 deletions trunk/net/netfilter/nfnetlink_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,14 @@ nfqnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
QDEBUG("entering for msg %u\n", NFNL_MSG_TYPE(nlh->nlmsg_type));

queue = instance_lookup_get(queue_num);
if (queue && queue->peer_pid != NETLINK_CB(skb).pid) {
ret = -EPERM;
goto out_put;
}

if (nfqa[NFQA_CFG_CMD]) {
struct nfqnl_msg_config_cmd *cmd;

cmd = nla_data(nfqa[NFQA_CFG_CMD]);
QDEBUG("found CFG_CMD\n");

Expand All @@ -798,12 +804,6 @@ nfqnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
case NFQNL_CFG_CMD_UNBIND:
if (!queue)
return -ENODEV;

if (queue->peer_pid != NETLINK_CB(skb).pid) {
ret = -EPERM;
goto out_put;
}

instance_destroy(queue);
break;
case NFQNL_CFG_CMD_PF_BIND:
Expand All @@ -820,25 +820,13 @@ nfqnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
ret = -EINVAL;
break;
}
} else {
if (!queue) {
QDEBUG("no config command, and no instance ENOENT\n");
ret = -ENOENT;
goto out_put;
}

if (queue->peer_pid != NETLINK_CB(skb).pid) {
QDEBUG("no config command, and wrong pid\n");
ret = -EPERM;
goto out_put;
}
}

if (nfqa[NFQA_CFG_PARAMS]) {
struct nfqnl_msg_config_params *params;

if (!queue) {
ret = -ENOENT;
ret = -ENODEV;
goto out_put;
}
params = nla_data(nfqa[NFQA_CFG_PARAMS]);
Expand All @@ -848,6 +836,11 @@ nfqnl_recv_config(struct sock *ctnl, struct sk_buff *skb,

if (nfqa[NFQA_CFG_QUEUE_MAXLEN]) {
__be32 *queue_maxlen;

if (!queue) {
ret = -ENODEV;
goto out_put;
}
queue_maxlen = nla_data(nfqa[NFQA_CFG_QUEUE_MAXLEN]);
spin_lock_bh(&queue->lock);
queue->queue_maxlen = ntohl(*queue_maxlen);
Expand Down

0 comments on commit f8bbdc4

Please sign in to comment.