@@ -60,8 +60,8 @@ pub(crate) struct FragmentsBuffer {
6060 #[ cfg( feature = "_proto-fragmentation" ) ]
6161 pub ( crate ) assembler : PacketAssemblerSet < FragKey > ,
6262
63- #[ cfg( feature = "proto-sixlowpan -fragmentation" ) ]
64- sixlowpan_reassembly_timeout : Duration ,
63+ #[ cfg( feature = "_proto -fragmentation" ) ]
64+ reassembly_timeout : Duration ,
6565}
6666
6767#[ cfg( not( feature = "_proto-fragmentation" ) ) ]
@@ -538,8 +538,8 @@ impl Interface {
538538
539539 #[ cfg( feature = "_proto-fragmentation" ) ]
540540 assembler : PacketAssemblerSet :: new ( ) ,
541- #[ cfg( feature = "proto-sixlowpan -fragmentation" ) ]
542- sixlowpan_reassembly_timeout : Duration :: from_secs ( 60 ) ,
541+ #[ cfg( feature = "_proto -fragmentation" ) ]
542+ reassembly_timeout : Duration :: from_secs ( 60 ) ,
543543 } ,
544544 fragmenter : Fragmenter :: new ( ) ,
545545 inner : InterfaceInner {
@@ -703,22 +703,18 @@ impl Interface {
703703 }
704704
705705 /// Get the packet reassembly timeout.
706- ///
707- /// Currently used only for 6LoWPAN, will be used for IPv4 in the future as well.
708- #[ cfg( feature = "proto-sixlowpan-fragmentation" ) ]
706+ #[ cfg( feature = "_proto-fragmentation" ) ]
709707 pub fn reassembly_timeout ( & self ) -> Duration {
710- self . fragments . sixlowpan_reassembly_timeout
708+ self . fragments . reassembly_timeout
711709 }
712710
713711 /// Set the packet reassembly timeout.
714- ///
715- /// Currently used only for 6LoWPAN, will be used for IPv4 in the future as well.
716- #[ cfg( feature = "proto-sixlowpan-fragmentation" ) ]
712+ #[ cfg( feature = "_proto-fragmentation" ) ]
717713 pub fn set_reassembly_timeout ( & mut self , timeout : Duration ) {
718714 if timeout > Duration :: from_secs ( 60 ) {
719715 net_debug ! ( "RFC 4944 specifies that the reassembly timeout MUST be set to a maximum of 60 seconds" ) ;
720716 }
721- self . fragments . sixlowpan_reassembly_timeout = timeout;
717+ self . fragments . reassembly_timeout = timeout;
722718 }
723719
724720 /// Transmit packets queued in the given sockets, and receive packets queued
@@ -1288,19 +1284,14 @@ impl InterfaceInner {
12881284 & mut self ,
12891285 sockets : & mut SocketSet ,
12901286 ip_payload : & ' frame T ,
1291- fragments : & ' frame mut FragmentsBuffer ,
1287+ frag : & ' frame mut FragmentsBuffer ,
12921288 ) -> Option < IpPacket < ' frame > > {
12931289 match IpVersion :: of_packet ( ip_payload. as_ref ( ) ) {
12941290 #[ cfg( feature = "proto-ipv4" ) ]
12951291 Ok ( IpVersion :: Ipv4 ) => {
12961292 let ipv4_packet = check ! ( Ipv4Packet :: new_checked( ip_payload) ) ;
12971293
1298- self . process_ipv4 (
1299- sockets,
1300- & ipv4_packet,
1301- #[ cfg( feature = "proto-ipv4-fragmentation" ) ]
1302- & mut fragments. assembler ,
1303- )
1294+ self . process_ipv4 ( sockets, & ipv4_packet, frag)
13041295 }
13051296 #[ cfg( feature = "proto-ipv6" ) ]
13061297 Ok ( IpVersion :: Ipv6 ) => {
0 commit comments