Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78675
b: refs/heads/master
c: 00f5e06
h: refs/heads/master
i:
  78673: bc78db1
  78671: d46b592
v: v3
  • Loading branch information
Li Zefan authored and David S. Miller committed Jan 28, 2008
1 parent f43b342 commit 254d36c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 27 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: fd00eeccd92b7b4b5ca95bd988c195efb4e5ec29
refs/heads/master: 00f5e06c032507206c4ac0c846ad82b75ae7665b
30 changes: 4 additions & 26 deletions trunk/drivers/connector/connector.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,34 +181,15 @@ static int cn_call_callback(struct cn_msg *msg, void (*destruct_data)(void *), v
return err;
}

/*
* Skb receive helper - checks skb and msg size and calls callback
* helper.
*/
static int __cn_rx_skb(struct sk_buff *skb, struct nlmsghdr *nlh)
{
u32 pid, uid, seq, group;
struct cn_msg *msg;

pid = NETLINK_CREDS(skb)->pid;
uid = NETLINK_CREDS(skb)->uid;
seq = nlh->nlmsg_seq;
group = NETLINK_CB((skb)).dst_group;
msg = NLMSG_DATA(nlh);

return cn_call_callback(msg, (void (*)(void *))kfree_skb, skb);
}

/*
* Main netlink receiving function.
*
* It checks skb and netlink header sizes and calls the skb receive
* helper with a shared skb.
* It checks skb, netlink header and msg sizes, and calls callback helper.
*/
static void cn_rx_skb(struct sk_buff *__skb)
{
struct cn_msg *msg;
struct nlmsghdr *nlh;
u32 len;
int err;
struct sk_buff *skb;

Expand All @@ -224,11 +205,8 @@ static void cn_rx_skb(struct sk_buff *__skb)
return;
}

len = NLMSG_ALIGN(nlh->nlmsg_len);
if (len > skb->len)
len = skb->len;

err = __cn_rx_skb(skb, nlh);
msg = NLMSG_DATA(nlh);
err = cn_call_callback(msg, (void (*)(void *))kfree_skb, skb);
if (err < 0)
kfree_skb(skb);
}
Expand Down

0 comments on commit 254d36c

Please sign in to comment.