File tree Expand file tree Collapse file tree 1 file changed +18
-16
lines changed Expand file tree Collapse file tree 1 file changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,7 @@ struct ndisc_options *ndisc_parse_options(const struct net_device *dev,
227
227
return NULL ;
228
228
memset (ndopts , 0 , sizeof (* ndopts ));
229
229
while (opt_len ) {
230
+ bool unknown = false;
230
231
int l ;
231
232
if (opt_len < sizeof (struct nd_opt_hdr ))
232
233
return NULL ;
@@ -262,22 +263,23 @@ struct ndisc_options *ndisc_parse_options(const struct net_device *dev,
262
263
break ;
263
264
#endif
264
265
default :
265
- if (ndisc_is_useropt (dev , nd_opt )) {
266
- ndopts -> nd_useropts_end = nd_opt ;
267
- if (!ndopts -> nd_useropts )
268
- ndopts -> nd_useropts = nd_opt ;
269
- } else {
270
- /*
271
- * Unknown options must be silently ignored,
272
- * to accommodate future extension to the
273
- * protocol.
274
- */
275
- ND_PRINTK (2 , notice ,
276
- "%s: ignored unsupported option; type=%d, len=%d\n" ,
277
- __func__ ,
278
- nd_opt -> nd_opt_type ,
279
- nd_opt -> nd_opt_len );
280
- }
266
+ unknown = true;
267
+ }
268
+ if (ndisc_is_useropt (dev , nd_opt )) {
269
+ ndopts -> nd_useropts_end = nd_opt ;
270
+ if (!ndopts -> nd_useropts )
271
+ ndopts -> nd_useropts = nd_opt ;
272
+ } else if (unknown ) {
273
+ /*
274
+ * Unknown options must be silently ignored,
275
+ * to accommodate future extension to the
276
+ * protocol.
277
+ */
278
+ ND_PRINTK (2 , notice ,
279
+ "%s: ignored unsupported option; type=%d, len=%d\n" ,
280
+ __func__ ,
281
+ nd_opt -> nd_opt_type ,
282
+ nd_opt -> nd_opt_len );
281
283
}
282
284
next_opt :
283
285
opt_len -= l ;
You can’t perform that action at this time.
0 commit comments