File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -788,13 +788,18 @@ impl<'a> Repr<'a> {
788
788
( field:: OPT_DOMAIN_NAME_SERVER , _) => {
789
789
let mut servers = Vec :: new ( ) ;
790
790
const IP_ADDR_BYTE_LEN : usize = 4 ;
791
- for chunk in data. chunks ( IP_ADDR_BYTE_LEN ) {
791
+ let mut addrs = data. chunks_exact ( IP_ADDR_BYTE_LEN ) ;
792
+ for chunk in & mut addrs {
792
793
// We ignore push failures because that will only happen
793
794
// if we attempt to push more than 4 addresses, and the only
794
795
// solution to that is to support more addresses.
795
796
servers. push ( Ipv4Address :: from_bytes ( chunk) ) . ok ( ) ;
796
797
}
797
798
dns_servers = Some ( servers) ;
799
+
800
+ if !addrs. remainder ( ) . is_empty ( ) {
801
+ net_trace ! ( "DHCP domain name servers contained invalid address" ) ;
802
+ }
798
803
}
799
804
_ => { }
800
805
}
You can’t perform that action at this time.
0 commit comments