@@ -9,9 +9,9 @@ use netlink_packet_utils::{
9
9
10
10
use super :: super :: {
11
11
InfoBond , InfoBridge , InfoGeneve , InfoGreTap , InfoGreTap6 , InfoGreTun ,
12
- InfoGreTun6 , InfoGtp , InfoHsr , InfoIpVlan , InfoIpVtap , InfoIpoib , InfoKind ,
13
- InfoMacSec , InfoMacVlan , InfoMacVtap , InfoSitTun , InfoTun , InfoVeth ,
14
- InfoVlan , InfoVrf , InfoVti , InfoVxlan , InfoXfrm ,
12
+ InfoGreTun6 , InfoGtp , InfoHsr , InfoIpTun , InfoIpVlan , InfoIpVtap ,
13
+ InfoIpoib , InfoKind , InfoMacSec , InfoMacVlan , InfoMacVtap , InfoSitTun ,
14
+ InfoTun , InfoVeth , InfoVlan , InfoVrf , InfoVti , InfoVxlan , InfoXfrm ,
15
15
} ;
16
16
17
17
const IFLA_INFO_DATA : u16 = 2 ;
@@ -42,6 +42,7 @@ pub enum InfoData {
42
42
MacSec ( Vec < InfoMacSec > ) ,
43
43
Hsr ( Vec < InfoHsr > ) ,
44
44
Geneve ( Vec < InfoGeneve > ) ,
45
+ IpTun ( Vec < InfoIpTun > ) ,
45
46
Other ( Vec < u8 > ) ,
46
47
}
47
48
@@ -71,6 +72,7 @@ impl Nla for InfoData {
71
72
Self :: Vti ( nlas) => nlas. as_slice ( ) . buffer_len ( ) ,
72
73
Self :: Gtp ( nlas) => nlas. as_slice ( ) . buffer_len ( ) ,
73
74
Self :: Geneve ( nlas) => nlas. as_slice ( ) . buffer_len ( ) ,
75
+ Self :: IpTun ( nlas) => nlas. as_slice ( ) . buffer_len ( ) ,
74
76
Self :: Other ( v) => v. len ( ) ,
75
77
}
76
78
}
@@ -100,6 +102,7 @@ impl Nla for InfoData {
100
102
Self :: Vti ( nlas) => nlas. as_slice ( ) . emit ( buffer) ,
101
103
Self :: Gtp ( nlas) => nlas. as_slice ( ) . emit ( buffer) ,
102
104
Self :: Geneve ( nlas) => nlas. as_slice ( ) . emit ( buffer) ,
105
+ Self :: IpTun ( nlas) => nlas. as_slice ( ) . emit ( buffer) ,
103
106
Self :: Other ( v) => buffer. copy_from_slice ( v. as_slice ( ) ) ,
104
107
}
105
108
}
@@ -353,6 +356,17 @@ impl InfoData {
353
356
}
354
357
InfoData :: Hsr ( v)
355
358
}
359
+ InfoKind :: IpIp | InfoKind :: Ip6Tnl => {
360
+ let mut v = Vec :: new ( ) ;
361
+ for nla in NlasIterator :: new ( payload) {
362
+ let nla = & nla. context ( format ! (
363
+ "invalid IFLA_INFO_DATA for {kind} {payload:?}"
364
+ ) ) ?;
365
+ let parsed = InfoIpTun :: parse ( nla) ?;
366
+ v. push ( parsed) ;
367
+ }
368
+ InfoData :: IpTun ( v)
369
+ }
356
370
InfoKind :: Geneve => {
357
371
let mut v = Vec :: new ( ) ;
358
372
for nla in NlasIterator :: new ( payload) {
0 commit comments