Commit d77b4852 authored by Alexander Aring's avatar Alexander Aring Committed by Marcel Holtmann

mac802154: add llsec address update workaround

This patch adds a workaround for using the new nl802154 netlink
interface with the old ieee802154 netlink interface togehter. The
nl802154 currently supports no access for llsec layer, currently there
are users outside which are using both interfaces at the same time. This
patch adds a necessary call when addresses are updated.
Reported-by: default avatarSimon Vincent <simon.vincent@xsilon.com>
Suggested-by: default avatarPhoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent fac5e5b9
......@@ -145,13 +145,18 @@ static int
ieee802154_set_pan_id(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
__le16 pan_id)
{
int ret;
ASSERT_RTNL();
if (wpan_dev->pan_id == pan_id)
return 0;
wpan_dev->pan_id = pan_id;
return 0;
ret = mac802154_wpan_update_llsec(wpan_dev->netdev);
if (!ret)
wpan_dev->pan_id = pan_id;
return ret;
}
static int
......
......@@ -167,6 +167,8 @@ void mac802154_get_table(struct net_device *dev,
struct ieee802154_llsec_table **t);
void mac802154_unlock_table(struct net_device *dev);
int mac802154_wpan_update_llsec(struct net_device *dev);
/* interface handling */
int ieee802154_iface_init(void);
void ieee802154_iface_exit(void);
......
......@@ -30,7 +30,7 @@
#include "ieee802154_i.h"
#include "driver-ops.h"
static int mac802154_wpan_update_llsec(struct net_device *dev)
int mac802154_wpan_update_llsec(struct net_device *dev)
{
struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
struct ieee802154_mlme_ops *ops = ieee802154_mlme_ops(dev);
......@@ -471,6 +471,7 @@ ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata,
enum nl802154_iftype type)
{
struct wpan_dev *wpan_dev = &sdata->wpan_dev;
int ret;
u8 tmp;
/* set some type-dependent values */
......@@ -505,6 +506,10 @@ ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata,
mutex_init(&sdata->sec_mtx);
mac802154_llsec_init(&sdata->sec);
ret = mac802154_wpan_update_llsec(sdata->dev);
if (ret < 0)
return ret;
break;
case NL802154_IFTYPE_MONITOR:
sdata->dev->destructor = free_netdev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment