Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66239
b: refs/heads/master
c: 744b096
h: refs/heads/master
i:
  66237: 443407d
  66235: c0986f5
  66231: 47baf1d
  66223: b99beed
  66207: 0975284
  66175: 8d1061e
v: v3
  • Loading branch information
Thomas Graf authored and David S. Miller committed Oct 10, 2007
1 parent bf17bf6 commit 49be0d4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 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: 1bec3f1a3ec5d922d1040c7845b82cd496c02d90
refs/heads/master: 744b096e2b0976a10ae9a66aa6a3ae7fa4fce9f1
30 changes: 16 additions & 14 deletions trunk/net/wireless/wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -1129,10 +1129,12 @@ static int rtnetlink_fill_iwinfo(struct sk_buff *skb, struct net_device *dev,
{
struct ifinfomsg *r;
struct nlmsghdr *nlh;
unsigned char *b = skb_tail_pointer(skb);

nlh = NLMSG_PUT(skb, 0, 0, type, sizeof(*r));
r = NLMSG_DATA(nlh);
nlh = nlmsg_put(skb, 0, 0, type, sizeof(*r), 0);
if (nlh == NULL)
return -EMSGSIZE;

r = nlmsg_data(nlh);
r->ifi_family = AF_UNSPEC;
r->__ifi_pad = 0;
r->ifi_type = dev->type;
Expand All @@ -1141,15 +1143,13 @@ static int rtnetlink_fill_iwinfo(struct sk_buff *skb, struct net_device *dev,
r->ifi_change = 0; /* Wireless changes don't affect those flags */

/* Add the wireless events in the netlink packet */
RTA_PUT(skb, IFLA_WIRELESS, event_len, event);
NLA_PUT(skb, IFLA_WIRELESS, event_len, event);

nlh->nlmsg_len = skb_tail_pointer(skb) - b;
return skb->len;
return nlmsg_end(skb, nlh);

nlmsg_failure:
rtattr_failure:
nlmsg_trim(skb, b);
return -1;
nla_put_failure:
nlmsg_cancel(skb, nlh);
return -EMSGSIZE;
}

/* ---------------------------------------------------------------- */
Expand All @@ -1162,17 +1162,19 @@ static int rtnetlink_fill_iwinfo(struct sk_buff *skb, struct net_device *dev,
static void rtmsg_iwinfo(struct net_device *dev, char *event, int event_len)
{
struct sk_buff *skb;
int size = NLMSG_GOODSIZE;
int err;

skb = alloc_skb(size, GFP_ATOMIC);
skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
if (!skb)
return;

if (rtnetlink_fill_iwinfo(skb, dev, RTM_NEWLINK,
event, event_len) < 0) {
err = rtnetlink_fill_iwinfo(skb, dev, RTM_NEWLINK, event, event_len);
if (err < 0) {
WARN_ON(err == -EMSGSIZE);
kfree_skb(skb);
return;
}

NETLINK_CB(skb).dst_group = RTNLGRP_LINK;
skb_queue_tail(&wireless_nlevent_queue, skb);
tasklet_schedule(&wireless_nlevent_tasklet);
Expand Down

0 comments on commit 49be0d4

Please sign in to comment.