mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-08 18:26:48 +00:00
fmt
This commit is contained in:
parent
c9806be704
commit
acd348572d
@ -38,7 +38,7 @@ use crate::{
|
||||
},
|
||||
},
|
||||
exception::{irqdesc::IrqReturn, IrqNumber},
|
||||
filesystem::{kernfs::KernFSInode, mbr::MbrDiskPartionTable, sysfs::AttributeGroup},
|
||||
filesystem::{kernfs::KernFSInode, mbr::MbrDiskPartionTable},
|
||||
init::initcall::INITCALL_POSTCORE,
|
||||
libs::{
|
||||
rwlock::{RwLockReadGuard, RwLockWriteGuard},
|
||||
|
@ -286,7 +286,9 @@ impl LoopbackInterface {
|
||||
smoltcp::iface::Interface::new(iface_config, &mut driver, Instant::now().into());
|
||||
//设置网卡地址为127.0.0.1
|
||||
iface.update_ip_addrs(|ip_addrs| {
|
||||
ip_addrs.push(IpCidr::new(IpAddress::v4(127, 0, 0, 1), 8)).expect("Push ipCidr failed: full");
|
||||
ip_addrs
|
||||
.push(IpCidr::new(IpAddress::v4(127, 0, 0, 1), 8))
|
||||
.expect("Push ipCidr failed: full");
|
||||
});
|
||||
|
||||
Arc::new(LoopbackInterface {
|
||||
|
@ -10,9 +10,9 @@ use crate::{driver::net::Iface, libs::rwlock::RwLock};
|
||||
|
||||
pub mod event_poll;
|
||||
pub mod net_core;
|
||||
pub mod posix;
|
||||
pub mod socket;
|
||||
pub mod syscall;
|
||||
pub mod posix;
|
||||
|
||||
lazy_static! {
|
||||
/// # 所有网络接口的列表
|
||||
|
@ -1,7 +1,7 @@
|
||||
#![allow(unused_variables)]
|
||||
|
||||
use crate::net::socket::*;
|
||||
use crate::net::posix::MsgHdr;
|
||||
use crate::net::socket::*;
|
||||
use alloc::sync::Arc;
|
||||
use core::any::Any;
|
||||
use core::fmt::Debug;
|
||||
|
@ -14,16 +14,14 @@ fn create_inet_socket(
|
||||
// log::debug!("type: {:?}, protocol: {:?}", socket_type, protocol);
|
||||
use smoltcp::wire::IpProtocol::*;
|
||||
match socket_type {
|
||||
PSOCK::Datagram => {
|
||||
match protocol {
|
||||
HopByHop | Udp => {
|
||||
return Ok(UdpSocket::new(false));
|
||||
}
|
||||
_ => {
|
||||
return Err(EPROTONOSUPPORT);
|
||||
}
|
||||
PSOCK::Datagram => match protocol {
|
||||
HopByHop | Udp => {
|
||||
return Ok(UdpSocket::new(false));
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
return Err(EPROTONOSUPPORT);
|
||||
}
|
||||
},
|
||||
PSOCK::Stream => match protocol {
|
||||
HopByHop | Tcp => {
|
||||
return Ok(TcpSocket::new(false));
|
||||
|
Loading…
x
Reference in New Issue
Block a user