ndisc: fix two infinite loops
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 28 Sep 2018 10:28:05 +0000 (19:28 +0900)
committerLukáš Nykrýn <lnykryn@redhat.com>
Fri, 3 May 2019 10:50:30 +0000 (12:50 +0200)
(cherry picked from commit f3241c61f12dbd8f0ed37419ae272e291d09461d)

Resolves: #1696224

src/libsystemd-network/ndisc-router.c

index 25b693a4583bca7fccd773fcc030e75a1005cafe..380680443588cc9fa7865055e39c860e41c8a8e6 100644 (file)
@@ -189,7 +189,7 @@ int ndisc_router_parse(sd_ndisc_router *rt) {
 
                         if (has_mtu) {
                                 log_ndisc("MTU option specified twice, ignoring.");
-                                continue;
+                                break;
                         }
 
                         if (length != 8) {
@@ -230,7 +230,7 @@ int ndisc_router_parse(sd_ndisc_router *rt) {
 
                         if (has_flag_extension) {
                                 log_ndisc("Flags extension option specified twice, ignoring.");
-                                continue;
+                                break;
                         }
 
                         if (length < 1*8) {