Skip to content

Commit

Permalink
fix: ipv6/4 detection - cater for internal layout always being 16 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
gnanderson committed Jul 26, 2019
1 parent c37c44a commit b21ea8c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func init() {
rootCmd.PersistentFlags().StringVar(&adminUser, "user", "", "admin_user if any configured in rippled config")
rootCmd.PersistentFlags().StringVar(&adminPassword, "passwd", "", "admin_password if any configured in rippled config")
rootCmd.PersistentFlags().BoolVarP(&useTls, "tls", "t", false, "use wss scheme, omitting this flag assumes running on localhost")
rootCmd.PersistentFlags().StringVarP(&minVersion, "minver", "m", "1.2.3", "Minimum version number acceptable to avoid the ban hammer.")
rootCmd.PersistentFlags().StringVarP(&minVersion, "minver", "m", "1.2.4", "Minimum version number acceptable to avoid the ban hammer.")
viper.BindPFlag("addr", rootCmd.PersistentFlags().Lookup("addr"))
viper.BindPFlag("port", rootCmd.PersistentFlags().Lookup("port"))
viper.BindPFlag("user", rootCmd.PersistentFlags().Lookup("user"))
Expand Down
6 changes: 3 additions & 3 deletions cmd/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ func show(args []string) {
table.SetHeader([]string{"IP", "Status", "Version", "Uptime", "Latency", "Load", "Public Key"})

for _, peer := range peers {
if peer.Sanity == "" {
peer.Sanity = xrpl.Good
}
if peer.TooOld() {
peer.Sanity = xrpl.Old
}
if peer.Sanity == "" {
peer.Sanity = xrpl.Good
}
line := lineFromPeer(peer)

if arg == argCandidates {
Expand Down
4 changes: 2 additions & 2 deletions firewall/firewalld.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func newRejectRule(ip string, timeout int) (*rejectRule, error) {
}

family := "ipv4"
if IP.To16() != nil {
if IP.To4() == nil {
family = "ipv6"
}

Expand Down Expand Up @@ -94,7 +94,7 @@ func newDropRule(ip string, timeout int) (*dropRule, error) {
}

family := "ipv4"
if IP.To16() != nil {
if IP.To4() == nil {
family = "ipv6"
}

Expand Down
2 changes: 1 addition & 1 deletion goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ builds:
hooks:

sign:
artifacts: checksum
artifacts: none

# Archive customization
archive:
Expand Down

0 comments on commit b21ea8c

Please sign in to comment.