Skip to content

Commit e602370

Browse files
committed
New error for unsupported filter. Provide filter value
1 parent 4fb8516 commit e602370

File tree

1 file changed

+6
-3
lines changed
  • vm/devices/net/netvsp/src

1 file changed

+6
-3
lines changed

vm/devices/net/netvsp/src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3025,12 +3025,16 @@ enum OidError {
30253025
BadVersion,
30263026
#[error("feature {0} not supported")]
30273027
NotSupported(&'static str),
3028+
#[error("packet filter {0} not supported")]
3029+
UnsupportedFilter(u32),
30283030
}
30293031

30303032
impl OidError {
30313033
fn as_status(&self) -> u32 {
30323034
match self {
3033-
OidError::UnknownOid | OidError::NotSupported(_) => rndisprot::STATUS_NOT_SUPPORTED,
3035+
OidError::UnknownOid | OidError::NotSupported(_) | OidError::UnsupportedFilter(_) => {
3036+
rndisprot::STATUS_NOT_SUPPORTED
3037+
}
30343038
OidError::BadVersion => rndisprot::STATUS_BAD_VERSION,
30353039
OidError::InvalidInput(_) => rndisprot::STATUS_INVALID_DATA,
30363040
OidError::Access(_) => rndisprot::STATUS_FAILURE,
@@ -3410,8 +3414,7 @@ impl Adapter {
34103414
if filter != 0 {
34113415
// TODO:
34123416
// Maybe dont return error since previously we were not?
3413-
// Log the filter value with the error
3414-
return Err(OidError::NotSupported("unsupported filter"));
3417+
return Err(OidError::UnsupportedFilter(filter));
34153418
}
34163419
primary.stop_rx = true;
34173420
Ok(primary.stop_rx)

0 commit comments

Comments
 (0)