@@ -193,18 +193,16 @@ impl<'a, T: AsRef<[u8]> + ?Sized>
193193 let msg = match RouteMessageBuffer :: new_checked ( & buf. inner ( ) ) {
194194 Ok ( buf) => RouteMessage :: parse ( & buf)
195195 . context ( "invalid route message" ) ?,
196- // HACK: iproute2 sends invalid RTM_GETROUTE message, where
197- // the header is limited to the
198- // interface family (1 byte) and 3 bytes of padding.
196+ // HACK: iproute2 sends an invalid RTM_GETROUTE message,
197+ // where the header is limited to the interface family
198+ // (1 byte) and 3 bytes of padding.
199199 Err ( e) => {
200- // Not only does iproute2 sends invalid messages, it's
201- // also inconsistent in
202- // doing so: for link and address messages, the length
203- // advertised in the
204- // netlink header includes the 3 bytes of padding but it
205- // does not seem to be the case
206- // for the route message, hence the buf.length() == 1
207- // check.
200+ // Not only does iproute2 send invalid messages, it's
201+ // also inconsistent in doing so: for link and address
202+ // messages, the length advertised in the netlink header
203+ // includes the 3 bytes of padding, but it does not seem
204+ // to be the case for the route message, hence the
205+ // `buf.length() == 1` check.
208206 if ( buf. inner ( ) . len ( ) == 4 || buf. inner ( ) . len ( ) == 1 )
209207 && message_type == RTM_GETROUTE
210208 {
@@ -253,6 +251,7 @@ impl<'a, T: AsRef<[u8]> + ?Sized>
253251 _ => unreachable ! ( ) ,
254252 }
255253 }
254+
256255 // TC Messages
257256 RTM_NEWQDISC | RTM_DELQDISC | RTM_GETQDISC | RTM_NEWTCLASS
258257 | RTM_DELTCLASS | RTM_GETTCLASS | RTM_NEWTFILTER
@@ -292,13 +291,13 @@ impl<'a, T: AsRef<[u8]> + ?Sized>
292291 }
293292 }
294293
294+ // TC action messages
295295 RTM_NEWACTION | RTM_DELACTION | RTM_GETACTION => {
296- let err = "invalid tc action message" ;
297296 let msg = TcActionMessage :: parse (
298297 & TcActionMessageBuffer :: new_checked ( & buf. inner ( ) )
299- . context ( err ) ?,
298+ . context ( "invalid tc action message buffer" ) ?,
300299 )
301- . context ( err ) ?;
300+ . context ( "invalid tc action message" ) ?;
302301 match message_type {
303302 RTM_NEWACTION => RouteNetlinkMessage :: NewTrafficAction ( msg) ,
304303 RTM_DELACTION => RouteNetlinkMessage :: DelTrafficAction ( msg) ,
0 commit comments