Skip to content

Commit

Permalink
net: ipv6: Check extension header No Next Header
Browse files Browse the repository at this point in the history
If we receive extension 59 (No Next Header), then drop the
packet as we do not support forwarding atm.

Change-Id: I8b1a2a3748f2e88dbf47eb24b732f5edfb9c006c
Signed-off-by: Jukka Rissanen <[email protected]>
  • Loading branch information
jukkar committed Dec 2, 2016
1 parent 037f9c5 commit bd48a9e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/yaip/net_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,14 @@ static inline enum net_verdict process_ipv6_pkt(struct net_buf *buf)
#endif

switch (next) {
case NET_IPV6_NEXTHDR_NONE:
/* There is nothing after this header (see RFC 2460,
* ch 4.7), so we can drop the packet now.
* This is not an error case so do not update drop
* statistics.
*/
goto drop;

case NET_IPV6_NEXTHDR_HBHO:
/* Hop by hop option */
if (net_nbuf_ext_bitmap(buf) &
Expand Down

0 comments on commit bd48a9e

Please sign in to comment.