{"comment":{"url":"https://api.github.com/repos/miminar/docker/comments/10565590","html_url":"https://github.com/miminar/docker/commit/75c43c6759b5d937d1389f26458c9a4f80a93a34#commitcomment-10565590","id":10565590,"user":{"login":"aboch","id":10080882,"avatar_url":"https://avatars.githubusercontent.com/u/10080882?v=3","gravatar_id":"","url":"https://api.github.com/users/aboch","html_url":"https://github.com/aboch","followers_url":"https://api.github.com/users/aboch/followers","following_url":"https://api.github.com/users/aboch/following{/other_user}","gists_url":"https://api.github.com/users/aboch/gists{/gist_id}","starred_url":"https://api.github.com/users/aboch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aboch/subscriptions","organizations_url":"https://api.github.com/users/aboch/orgs","repos_url":"https://api.github.com/users/aboch/repos","events_url":"https://api.github.com/users/aboch/events{/privacy}","received_events_url":"https://api.github.com/users/aboch/received_events","type":"User","site_admin":false},"position":73,"line":156,"path":"daemon/networkdriver/bridge/driver.go","commit_id":"75c43c6759b5d937d1389f26458c9a4f80a93a34","created_at":"2015-04-03T16:42:20Z","updated_at":"2015-04-03T16:42:20Z","body":"It may just be me, but I feel the above logic is unnecessary convoluted.\r\n\r\nI would prefer:\r\n\r\nfunc isPacketForwardingEnabled(ipVer ipVersion, iface string) (bool, error) {\r\n\tswitch ipVer {\r\n\t\tcase ipv4, ipv6:\r\n\t\t\t         return getKernelBoolParam(getForwardingKernelParam(ipVer, iface)\r\n\t\t\tcase ipvboth:\r\n\t\t\t\tenable, err := getKernelBoolParam(getForwardingKernelParam(ipv4, \"\")\r\n\t\t\t\tif err != nil | !enabled {\r\n\t\t\t\t\treturn enabled, err\r\n\t\t\t\t}\r\n\t\t\t       return getKernelBoolParam(getForwardingKernelParam(ipv6, iface)\r\n\t\t\t)\r\n\t\t)\r\n\t}\r\n\r\nSame for the function below.\r\n\r\nIf it is just me, feel free to discard this comment."}}