net: l2: ppp: ipv6cp: add assert to check the link address length
This ensures that the configured link address is at least as big as the part of it that is used. Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
This commit is contained in:
parent
d1da07144e
commit
a738bfa7f4
|
@ -37,6 +37,7 @@ static int ipv6cp_add_iid(struct ppp_context *ctx, struct net_pkt *pkt)
|
|||
if (linkaddr->len == 8) {
|
||||
memcpy(iid, linkaddr->addr, iid_len);
|
||||
} else {
|
||||
NET_ASSERT(linkaddr->len >= 6);
|
||||
memcpy(iid, linkaddr->addr, 3);
|
||||
iid[3] = 0xff;
|
||||
iid[4] = 0xfe;
|
||||
|
|
Loading…
Reference in a new issue