better format of Icmpv6

This commit is contained in:
zonyitoo
2022-01-19 09:56:24 +08:00
parent b4167b0add
commit 082ef9741b
5 changed files with 19 additions and 13 deletions

View File

@@ -266,7 +266,7 @@ impl Tun {
error!("handle UDP packet failed, err: {}, packet: {:?}", err, udp_packet);
}
}
IpProtocol::Icmp => {
IpProtocol::Icmp | IpProtocol::Icmpv6 => {
self.handle_icmp_packet(&packet).await?;
}
_ => {
@@ -282,11 +282,17 @@ impl Tun {
match *packet {
IpPacket::Ipv4(ref ipv4) => {
let icmp = Icmpv4Packet::new_checked(ipv4.payload())?;
debug!("[TUN] received {}", icmp);
trace!("[TUN] received {}", icmp);
}
IpPacket::Ipv6(ref ipv6) => {
let _icmp = Icmpv6Packet::new_checked(ipv6.payload())?;
debug!("[TUN] received ICMPv6");
let icmp = Icmpv6Packet::new_checked(ipv6.payload())?;
trace!(
"[TUN] received ICMPv6 {:?} code={} echo_ident={} echo_seq_no={}",
icmp.msg_type(),
icmp.msg_code(),
icmp.echo_ident(),
icmp.echo_seq_no()
);
}
}

View File

@@ -42,7 +42,7 @@ struct TcpSocketManager {
impl TcpSocketManager {
fn notify(&self) {
self.manager_notify.notify_waiters();
self.manager_notify.notify_one();
}
}
@@ -290,7 +290,7 @@ impl TcpTun {
}
// Wake up and poll the interface.
self.manager_notify.notify_waiters();
self.manager_notify.notify_one();
}
pub async fn recv_packet(&mut self) -> Vec<u8> {

View File

@@ -713,7 +713,7 @@ pub fn main(matches: &ArgMatches) {
if config.local.is_empty() {
eprintln!(
"missing `local_address`, consider specifying it by --local-addr command line option, \
or \"local_address\" and \"local_port\" in configuration file"
or \"local_address\" and \"local_port\" in configuration file"
);
return;
}
@@ -721,9 +721,9 @@ pub fn main(matches: &ArgMatches) {
if config.server.is_empty() {
eprintln!(
"missing proxy servers, consider specifying it by \
--server-addr, --encrypt-method, --password command line option, \
or --server-url command line option, \
or configuration file, check more details in https://shadowsocks.org/en/config/quick-guide.html"
--server-addr, --encrypt-method, --password command line option, \
or --server-url command line option, \
or configuration file, check more details in https://shadowsocks.org/en/config/quick-guide.html"
);
return;
}

View File

@@ -412,7 +412,7 @@ pub fn main(matches: &ArgMatches) {
if config.manager.is_none() {
eprintln!(
"missing `manager_address`, consider specifying it by --manager-address command line option, \
or \"manager_address\" and \"manager_port\" keys in configuration file"
or \"manager_address\" and \"manager_port\" keys in configuration file"
);
return;
}

View File

@@ -419,8 +419,8 @@ pub fn main(matches: &ArgMatches) {
if config.server.is_empty() {
eprintln!(
"missing proxy servers, consider specifying it by \
--server-addr, --encrypt-method, --password command line option, \
or configuration file, check more details in https://shadowsocks.org/en/config/quick-guide.html"
--server-addr, --encrypt-method, --password command line option, \
or configuration file, check more details in https://shadowsocks.org/en/config/quick-guide.html"
);
return;
}