Skip to content

Fix InhibitIPv4 nil panic#2519

Merged
arkodg merged 1 commit intomoby:masterfrom
wangyumu:fix-InhibitIPv4-nil-panic
Mar 4, 2020
Merged

Fix InhibitIPv4 nil panic#2519
arkodg merged 1 commit intomoby:masterfrom
wangyumu:fix-InhibitIPv4-nil-panic

Conversation

@wangyumu
Copy link
Contributor

@wangyumu wangyumu commented Mar 2, 2020

- What I did
When I upgrade the docker of my laptop from 19.03 to the latest master branch, docker.service startup failed with panic:

Feb 27 01:44:56 localhost systemd: Starting Docker Application Container Engine...
Feb 27 01:44:57 localhost dockerd: panic: interface conversion: interface {} is nil, not bool
Feb 27 01:44:57 localhost dockerd: goroutine 1 [running]:
Feb 27 01:44:57 localhost dockerd: github.com/docker/docker/vendor/github.com/docker/libnetwork/drivers/bridge.(*networkConfiguration).UnmarshalJSON(0xc0006ee410, 0xc00097b1e0, 0x189, 0x189, 0x7f9979d15510, 0xc0006ee410)
Feb 27 01:44:57 localhost dockerd: /go/src/github.com/docker/docker/vendor/github.com/docker/libnetwork/drivers/bridge/bridge_store.go:201 +0xb9a
Feb 27 01:44:57 localhost dockerd: encoding/json.(*decodeState).object(0xc000c2b550, 0x55f9eff967c0, 0xc0006ee410, 0x16, 0xc000c2b578, 0xc00051537b)
Feb 27 01:44:57 localhost dockerd: /usr/local/go/src/encoding/json/decode.go:667 +0x220d

and this PR will fix it.

- How I did it

There is no "InhibitIPv4" field in the json string of Bridge before PR #2317, so I just add a nil check before the type cast

Signed-off-by: Wang Yumu <[email protected]>
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

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

LGTM, PTAL @selansen @thaJeztah

@arkodg arkodg requested a review from selansen March 3, 2020 23:16
@wangyumu wangyumu requested a review from arkodg March 4, 2020 00:46
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@thaJeztah
Copy link
Member

I see the related change is only on master, so no need to backport to 18.09 or 19.03

@arkodg arkodg merged commit aca52ce into moby:master Mar 4, 2020
@wangyumu wangyumu deleted the fix-InhibitIPv4-nil-panic branch June 3, 2020 14:28
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.

3 participants