Skip to content

Commit baee5a1

Browse files
committed
Merge tag 'ieee802154-for-net-2022-10-24' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan
Stefan Schmidt says: ==================== pull-request: ieee802154 for net 2022-10-24 Two fixup patches for return code changes of an earlier commit. Wei Yongjun fixed a missed -EINVAL return on the recent change, while Alexander Aring adds handling for unknown address type cases as well. Miquel Raynal fixed a long standing issue with LQI value recording which got broken 8 years ago. (It got more attention with the work in progress enhancement in wpan). * tag 'ieee802154-for-net-2022-10-24' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan: mac802154: Fix LQI recording net: ieee802154: fix error return code in dgram_bind() net: ieee802154: return -EINVAL for unknown addr type ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents fe1fd0c + 5a5c4e0 commit baee5a1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

net/ieee802154/socket.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,10 @@ static int dgram_bind(struct sock *sk, struct sockaddr *uaddr, int len)
502502
if (err < 0)
503503
goto out;
504504

505-
if (addr->family != AF_IEEE802154)
505+
if (addr->family != AF_IEEE802154) {
506+
err = -EINVAL;
506507
goto out;
508+
}
507509

508510
ieee802154_addr_from_sa(&haddr, &addr->addr);
509511
dev = ieee802154_get_dev(sock_net(sk), &haddr);

net/mac802154/rx.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static int
132132
ieee802154_parse_frame_start(struct sk_buff *skb, struct ieee802154_hdr *hdr)
133133
{
134134
int hlen;
135-
struct ieee802154_mac_cb *cb = mac_cb_init(skb);
135+
struct ieee802154_mac_cb *cb = mac_cb(skb);
136136

137137
skb_reset_mac_header(skb);
138138

@@ -294,8 +294,9 @@ void
294294
ieee802154_rx_irqsafe(struct ieee802154_hw *hw, struct sk_buff *skb, u8 lqi)
295295
{
296296
struct ieee802154_local *local = hw_to_local(hw);
297+
struct ieee802154_mac_cb *cb = mac_cb_init(skb);
297298

298-
mac_cb(skb)->lqi = lqi;
299+
cb->lqi = lqi;
299300
skb->pkt_type = IEEE802154_RX_MSG;
300301
skb_queue_tail(&local->skb_queue, skb);
301302
tasklet_schedule(&local->tasklet);

0 commit comments

Comments
 (0)