-/* $OpenBSD: ieee80211_ioctl.c,v 1.61 2018/07/11 20:18:09 phessler Exp $ */
+/* $OpenBSD: ieee80211_ioctl.c,v 1.62 2018/08/06 11:28:01 stsp Exp $ */
/* $NetBSD: ieee80211_ioctl.c,v 1.15 2004/05/06 02:58:16 dyoung Exp $ */
/*-
ieee80211_disable_wep(ic);
/* save nwid for auto-join */
if (!(join.i_flags & IEEE80211_JOIN_DEL))
- ieee80211_add_ess(ic, ic->ic_des_essid, 0, 0);
+ ieee80211_add_ess(ic, 0, 0);
ieee80211_set_ess(ic, ic->ic_des_essid);
error = ENETRESET;
break;
break;
error = ieee80211_ioctl_setnwkeys(ic, (void *)data);
if (error == ENETRESET)
- ieee80211_add_ess(ic, ic->ic_des_essid, 0, 1);
+ ieee80211_add_ess(ic, 0, 1);
break;
case SIOCG80211NWKEY:
error = ieee80211_ioctl_getnwkeys(ic, (void *)data);
break;
error = ieee80211_ioctl_setwpaparms(ic, (void *)data);
if (error == ENETRESET)
- ieee80211_add_ess(ic, ic->ic_des_essid, 1, 0);
+ ieee80211_add_ess(ic, 1, 0);
break;
case SIOCG80211WPAPARMS:
error = ieee80211_ioctl_getwpaparms(ic, (void *)data);
ic->ic_flags &= ~IEEE80211_F_PSK;
memset(ic->ic_psk, 0, sizeof(ic->ic_psk));
}
- ieee80211_add_ess(ic, ic->ic_des_essid, 1, 0);
+ ieee80211_add_ess(ic, 1, 0);
error = ENETRESET;
break;
case SIOCG80211WPAPSK:
-/* $OpenBSD: ieee80211_node.c,v 1.137 2018/08/06 09:34:17 florian Exp $ */
+/* $OpenBSD: ieee80211_node.c,v 1.138 2018/08/06 11:28:01 stsp Exp $ */
/* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */
/*-
}
int
-ieee80211_add_ess(struct ieee80211com *ic, char *nwid, int wpa, int wep)
+ieee80211_add_ess(struct ieee80211com *ic, int wpa, int wep)
{
struct ieee80211_ess *ess;
int i = 0, new = 0, ness = 0;
return (0);
/* Don't save an empty nwid */
- if (strnlen(nwid, IEEE80211_NWID_LEN) == 0)
+ if (ic->ic_des_esslen == 0)
return (0);
TAILQ_FOREACH(ess, &ic->ic_ess, ess_next) {
- if (memcmp(ess->essid, nwid, IEEE80211_NWID_LEN) == 0)
+ if (ess->esslen == ic->ic_des_esslen &&
+ memcmp(ess->essid, ic->ic_des_essid, ess->esslen) == 0)
break;
ness++;
}
ess = malloc(sizeof(*ess), M_DEVBUF, M_NOWAIT|M_ZERO);
if (ess == NULL)
return (ENOMEM);
- memcpy(ess->essid, nwid, ic->ic_des_esslen);
+ memcpy(ess->essid, ic->ic_des_essid, ic->ic_des_esslen);
ess->esslen = ic->ic_des_esslen;
}
-/* $OpenBSD: ieee80211_var.h,v 1.86 2018/07/11 20:18:09 phessler Exp $ */
+/* $OpenBSD: ieee80211_var.h,v 1.87 2018/08/06 11:28:01 stsp Exp $ */
/* $NetBSD: ieee80211_var.h,v 1.7 2004/05/06 03:07:10 dyoung Exp $ */
/*-
const struct ieee80211_channel *);
void ieee80211_disable_wep(struct ieee80211com *);
void ieee80211_disable_rsn(struct ieee80211com *);
-int ieee80211_add_ess(struct ieee80211com *, char *, int, int);
+int ieee80211_add_ess(struct ieee80211com *, int, int);
void ieee80211_del_ess(struct ieee80211com *, char *, int);
void ieee80211_set_ess(struct ieee80211com *, char *);