Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arp #182

Merged
merged 10 commits into from
Sep 25, 2022
Merged

Arp #182

merged 10 commits into from
Sep 25, 2022

Conversation

lsy1990
Copy link
Contributor

@lsy1990 lsy1990 commented Sep 13, 2022

No description provided.

var (
snapshot_len int32 = 1024
promiscuous bool = false
timeout time.Duration = 30 * time.Second
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

promiscuous、timeout 作为 instance的配置是不是好点

var err error
ins.EthHandle, err = pcap.OpenLive(ins.Ethdevice, snapshot_len, promiscuous, timeout)
if err != nil {
log.Fatal(err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不能用log.Fatal(err),这个方法内部会直接panic。

return types.ErrInstancesEmpty
}
go ins.arpStat()
fmt.Println("I! start arp stat")
Copy link
Contributor

@UlricQin UlricQin Sep 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用fmt打日志,用log.Println("I! start arp stat")
下面代码里打印日志的地方也是一样的问题

sourceAddr := sip.String()
dip = arp.DstProtAddress
if sourceAddr == ins.LocalIP {
fmt.Println("send req")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这行日志有点多余,可以优化一下

@kongfei605
Copy link
Collaborator

LGTM

@UlricQin UlricQin merged commit 168220d into flashcatcloud:main Sep 25, 2022
@lsy1990 lsy1990 deleted the arp branch September 26, 2022 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants