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

minor typos/spelling/corrections #7

Merged
merged 1 commit into from
May 8, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ func decodePktEth(datalink int, pkt *pcap.Packet) {
}

if len(pkt.Data) < l2hlen+20 {
DEBUG("ip", "Packet to short to be ethernet")
DEBUG("ip", "Packet too short to be ethernet")
return
}

// IP header
iphl := int((uint16(pkt.Data[l2hlen]) & 0x0f) * 4)
if len(pkt.Data) < l2hlen+iphl {
DEBUG("ip", "Packet to short to be IP")
DEBUG("ip", "Packet too short to be IP")
return
}
iphdr := pkt.Data[l2hlen : l2hlen+iphl]
Expand All @@ -122,7 +122,7 @@ func decodePktEth(datalink int, pkt *pcap.Packet) {

protocol := uint8(iphdr[9])
if protocol != 6 {
DEBUG("ip", "Not TCP packet received. Ignoring")
DEBUG("ip", "Not TCP packet. Ignoring")
return
}

Expand All @@ -133,7 +133,7 @@ func decodePktEth(datalink int, pkt *pcap.Packet) {

tcphl := int((uint16(pkt.Data[l2hlen+iphl+12]) >> 4) * 4)
if tcphl > 20 && len(pkt.Data) < l2hlen+iphl+tcphl {
DEBUG("ip", "Packet too short for the TCP header")
DEBUG("ip", "Packet too short to contain TCP header")
return
}

Expand All @@ -158,7 +158,7 @@ func DropPrivileges() error {
}

if !_ConfigMeta.IsDefined("runoptions", "gid") {
return MsgError("GID must be specified for dropping priviledges")
return MsgError("GID must be specified for dropping privileges")
}

INFO("Switching to user: %d.%d", _Config.RunOptions.Uid, _Config.RunOptions.Gid)
Expand Down Expand Up @@ -261,7 +261,7 @@ func main() {

datalink := h.Datalink()
if datalink != pcap.LINKTYPE_ETHERNET && datalink != pcap.LINKTYPE_LINUX_SLL {
WARN("Unsuported link type: %d", datalink)
WARN("Unsupported link type: %d", datalink)
}

_GeoLite, err = libgeo.Load("/usr/share/GeoIP/GeoIP.dat")
Expand Down Expand Up @@ -323,7 +323,7 @@ func main() {
if sleep > 0 {
time.Sleep(sleep)
} else {
WARN("Time in pcap went back in time: %d", sleep)
WARN("Time in pcap went backwards: %d", sleep)
}
}
_lastPktTime := pkt.Time
Expand Down