Skip to content

Commit

Permalink
net: l2: ppp: ipv6cp: add assert to check the link address length
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tomi-font authored and henrikbrixandersen committed Feb 26, 2024
1 parent d1da071 commit a738bfa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions subsys/net/l2/ppp/ipv6cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a738bfa

Please sign in to comment.