{"action":"created","comment":{"url":"https://api.github.com/repos/weaveworks/weave/pulls/comments/64253870","id":64253870,"diff_hunk":"@@ -0,0 +1,198 @@\n+package net\n+\n+import (\n+\t\"fmt\"\n+\t\"net\"\n+\n+\t\"github.com/j-keck/arping\"\n+\t\"github.com/vishvananda/netlink\"\n+\t\"github.com/vishvananda/netns\"\n+\n+\t\"github.com/weaveworks/weave/common\"\n+\t\"github.com/weaveworks/weave/common/odp\"\n+)\n+\n+// create and attach local name to the Weave bridge\n+func CreateAndAttachVeth(localName, peerName, bridgeName string, mtu int, init func(local, guest netlink.Link) error) (*netlink.Veth, error) {\n+\tmaybeBridge, err := netlink.LinkByName(bridgeName)\n+\tif err != nil {\n+\t\treturn nil, fmt.Errorf(`bridge \"%s\" not present; did you launch weave?`, bridgeName)\n+\t}\n+\n+\tif mtu == 0 {\n+\t\tmtu = maybeBridge.Attrs().MTU\n+\t}\n+\tlocal := &netlink.Veth{\n+\t\tLinkAttrs: netlink.LinkAttrs{\n+\t\t\tName: localName,\n+\t\t\tMTU:  mtu},\n+\t\tPeerName: peerName,\n+\t}\n+\tif err := netlink.LinkAdd(local); err != nil {\n+\t\treturn nil, fmt.Errorf(`could not create veth pair %s-%s: %s`, local.Name, local.PeerName, err)\n+\t}\n+\n+\tcleanup := func(format string, a ...interface{}) (*netlink.Veth, error) {","path":"net/veth.go","position":35,"original_position":35,"commit_id":"1be4bac9512cd11b627206aba333ca3f2d1e887b","original_commit_id":"65d9873553845545d1f7fd57be762fafd2c6e3fe","user":{"login":"bboreham","id":8125524,"avatar_url":"https://avatars.githubusercontent.com/u/8125524?v=3","gravatar_id":"","url":"https://api.github.com/users/bboreham","html_url":"https://github.com/bboreham","followers_url":"https://api.github.com/users/bboreham/followers","following_url":"https://api.github.com/users/bboreham/following{/other_user}","gists_url":"https://api.github.com/users/bboreham/gists{/gist_id}","starred_url":"https://api.github.com/users/bboreham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bboreham/subscriptions","organizations_url":"https://api.github.com/users/bboreham/orgs","repos_url":"https://api.github.com/users/bboreham/repos","events_url":"https://api.github.com/users/bboreham/events{/privacy}","received_events_url":"https://api.github.com/users/bboreham/received_events","type":"User","site_admin":false},"body":"I think that has other issues; you'd have to arrange that `err` always refers to the right scope.","created_at":"2016-05-23T17:18:24Z","updated_at":"2016-05-23T17:18:24Z","html_url":"https://github.com/weaveworks/weave/pull/2307#discussion_r64253870","pull_request_url":"https://api.github.com/repos/weaveworks/weave/pulls/2307","_links":{"self":{"href":"https://api.github.com/repos/weaveworks/weave/pulls/comments/64253870"},"html":{"href":"https://github.com/weaveworks/weave/pull/2307#discussion_r64253870"},"pull_request":{"href":"https://api.github.com/repos/weaveworks/weave/pulls/2307"}}},"pull_request":{"url":"https://api.github.com/repos/weaveworks/weave/pulls/2307","id":71025151,"html_url":"https://github.com/weaveworks/weave/pull/2307","diff_url":"https://github.com/weaveworks/weave/pull/2307.diff","patch_url":"https://github.com/weaveworks/weave/pull/2307.patch","issue_url":"https://api.github.com/repos/weaveworks/weave/issues/2307","number":2307,"state":"open","locked":false,"title":"Move container attachment from sh to Go","user":{"login":"bboreham","id":8125524,"avatar_url":"https://avatars.githubusercontent.com/u/8125524?v=3","gravatar_id":"","url":"https://api.github.com/users/bboreham","html_url":"https://github.com/bboreham","followers_url":"https://api.github.com/users/bboreham/followers","following_url":"https://api.github.com/users/bboreham/following{/other_user}","gists_url":"https://api.github.com/users/bboreham/gists{/gist_id}","starred_url":"https://api.github.com/users/bboreham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bboreham/subscriptions","organizations_url":"https://api.github.com/users/bboreham/orgs","repos_url":"https://api.github.com/users/bboreham/repos","events_url":"https://api.github.com/users/bboreham/events{/privacy}","received_events_url":"https://api.github.com/users/bboreham/received_events","type":"User","site_admin":false},"body":"Part of #1940 \r\n\r\nMost of this is refactoring the current plugin code to be closer to the script; see also #639 for `arping` and #1726 for `ethtool tx off`.\r\n\r\nThis PR does not mean the proxy can avoid shelling out when attaching a container.  Still to do: allocate IP addresses, rewrite hosts file, add to DNS.","created_at":"2016-05-23T08:53:02Z","updated_at":"2016-05-23T17:18:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"638837ef1c5d7d8e4faeceb9dfb1192218a5b0f6","assignee":{"login":"brb","id":122571,"avatar_url":"https://avatars.githubusercontent.com/u/122571?v=3","gravatar_id":"","url":"https://api.github.com/users/brb","html_url":"https://github.com/brb","followers_url":"https://api.github.com/users/brb/followers","following_url":"https://api.github.com/users/brb/following{/other_user}","gists_url":"https://api.github.com/users/brb/gists{/gist_id}","starred_url":"https://api.github.com/users/brb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brb/subscriptions","organizations_url":"https://api.github.com/users/brb/orgs","repos_url":"https://api.github.com/users/brb/repos","events_url":"https://api.github.com/users/brb/events{/privacy}","received_events_url":"https://api.github.com/users/brb/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/weaveworks/weave/milestones/33","html_url":"https://github.com/weaveworks/weave/milestones/1.6.0","labels_url":"https://api.github.com/repos/weaveworks/weave/milestones/33/labels","id":1702524,"number":33,"title":"1.6.0","description":"","creator":{"login":"rade","id":109109,"avatar_url":"https://avatars.githubusercontent.com/u/109109?v=3","gravatar_id":"","url":"https://api.github.com/users/rade","html_url":"https://github.com/rade","followers_url":"https://api.github.com/users/rade/followers","following_url":"https://api.github.com/users/rade/following{/other_user}","gists_url":"https://api.github.com/users/rade/gists{/gist_id}","starred_url":"https://api.github.com/users/rade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rade/subscriptions","organizations_url":"https://api.github.com/users/rade/orgs","repos_url":"https://api.github.com/users/rade/repos","events_url":"https://api.github.com/users/rade/events{/privacy}","received_events_url":"https://api.github.com/users/rade/received_events","type":"User","site_admin":false},"open_issues":15,"closed_issues":16,"state":"open","created_at":"2016-04-12T21:57:16Z","updated_at":"2016-05-23T08:53:02Z","due_on":"2016-05-30T23:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/weaveworks/weave/pulls/2307/commits","review_comments_url":"https://api.github.com/repos/weaveworks/weave/pulls/2307/comments","review_comment_url":"https://api.github.com/repos/weaveworks/weave/pulls/comments{/number}","comments_url":"https://api.github.com/repos/weaveworks/weave/issues/2307/comments","statuses_url":"https://api.github.com/repos/weaveworks/weave/statuses/1be4bac9512cd11b627206aba333ca3f2d1e887b","head":{"label":"weaveworks:issues/1940-remove-proxy-attach-dep","ref":"issues/1940-remove-proxy-attach-dep","sha":"1be4bac9512cd11b627206aba333ca3f2d1e887b","user":{"login":"weaveworks","id":9976052,"avatar_url":"https://avatars.githubusercontent.com/u/9976052?v=3","gravatar_id":"","url":"https://api.github.com/users/weaveworks","html_url":"https://github.com/weaveworks","followers_url":"https://api.github.com/users/weaveworks/followers","following_url":"https://api.github.com/users/weaveworks/following{/other_user}","gists_url":"https://api.github.com/users/weaveworks/gists{/gist_id}","starred_url":"https://api.github.com/users/weaveworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaveworks/subscriptions","organizations_url":"https://api.github.com/users/weaveworks/orgs","repos_url":"https://api.github.com/users/weaveworks/repos","events_url":"https://api.github.com/users/weaveworks/events{/privacy}","received_events_url":"https://api.github.com/users/weaveworks/received_events","type":"Organization","site_admin":false},"repo":{"id":23059575,"name":"weave","full_name":"weaveworks/weave","owner":{"login":"weaveworks","id":9976052,"avatar_url":"https://avatars.githubusercontent.com/u/9976052?v=3","gravatar_id":"","url":"https://api.github.com/users/weaveworks","html_url":"https://github.com/weaveworks","followers_url":"https://api.github.com/users/weaveworks/followers","following_url":"https://api.github.com/users/weaveworks/following{/other_user}","gists_url":"https://api.github.com/users/weaveworks/gists{/gist_id}","starred_url":"https://api.github.com/users/weaveworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaveworks/subscriptions","organizations_url":"https://api.github.com/users/weaveworks/orgs","repos_url":"https://api.github.com/users/weaveworks/repos","events_url":"https://api.github.com/users/weaveworks/events{/privacy}","received_events_url":"https://api.github.com/users/weaveworks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/weaveworks/weave","description":"Simple, resilient multi-host Docker networking and more.","fork":false,"url":"https://api.github.com/repos/weaveworks/weave","forks_url":"https://api.github.com/repos/weaveworks/weave/forks","keys_url":"https://api.github.com/repos/weaveworks/weave/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weaveworks/weave/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weaveworks/weave/teams","hooks_url":"https://api.github.com/repos/weaveworks/weave/hooks","issue_events_url":"https://api.github.com/repos/weaveworks/weave/issues/events{/number}","events_url":"https://api.github.com/repos/weaveworks/weave/events","assignees_url":"https://api.github.com/repos/weaveworks/weave/assignees{/user}","branches_url":"https://api.github.com/repos/weaveworks/weave/branches{/branch}","tags_url":"https://api.github.com/repos/weaveworks/weave/tags","blobs_url":"https://api.github.com/repos/weaveworks/weave/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weaveworks/weave/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weaveworks/weave/git/refs{/sha}","trees_url":"https://api.github.com/repos/weaveworks/weave/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weaveworks/weave/statuses/{sha}","languages_url":"https://api.github.com/repos/weaveworks/weave/languages","stargazers_url":"https://api.github.com/repos/weaveworks/weave/stargazers","contributors_url":"https://api.github.com/repos/weaveworks/weave/contributors","subscribers_url":"https://api.github.com/repos/weaveworks/weave/subscribers","subscription_url":"https://api.github.com/repos/weaveworks/weave/subscription","commits_url":"https://api.github.com/repos/weaveworks/weave/commits{/sha}","git_commits_url":"https://api.github.com/repos/weaveworks/weave/git/commits{/sha}","comments_url":"https://api.github.com/repos/weaveworks/weave/comments{/number}","issue_comment_url":"https://api.github.com/repos/weaveworks/weave/issues/comments{/number}","contents_url":"https://api.github.com/repos/weaveworks/weave/contents/{+path}","compare_url":"https://api.github.com/repos/weaveworks/weave/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weaveworks/weave/merges","archive_url":"https://api.github.com/repos/weaveworks/weave/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weaveworks/weave/downloads","issues_url":"https://api.github.com/repos/weaveworks/weave/issues{/number}","pulls_url":"https://api.github.com/repos/weaveworks/weave/pulls{/number}","milestones_url":"https://api.github.com/repos/weaveworks/weave/milestones{/number}","notifications_url":"https://api.github.com/repos/weaveworks/weave/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weaveworks/weave/labels{/name}","releases_url":"https://api.github.com/repos/weaveworks/weave/releases{/id}","deployments_url":"https://api.github.com/repos/weaveworks/weave/deployments","created_at":"2014-08-18T05:19:07Z","updated_at":"2016-05-23T01:44:29Z","pushed_at":"2016-05-23T14:38:12Z","git_url":"git://github.com/weaveworks/weave.git","ssh_url":"git@github.com:weaveworks/weave.git","clone_url":"https://github.com/weaveworks/weave.git","svn_url":"https://github.com/weaveworks/weave","homepage":"http://weave.works","size":12968,"stargazers_count":4214,"watchers_count":4214,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":269,"mirror_url":null,"open_issues_count":247,"forks":269,"open_issues":247,"watchers":4214,"default_branch":"master"}},"base":{"label":"weaveworks:master","ref":"master","sha":"df3ccd362a8c50080d72349c5125c4869783d06c","user":{"login":"weaveworks","id":9976052,"avatar_url":"https://avatars.githubusercontent.com/u/9976052?v=3","gravatar_id":"","url":"https://api.github.com/users/weaveworks","html_url":"https://github.com/weaveworks","followers_url":"https://api.github.com/users/weaveworks/followers","following_url":"https://api.github.com/users/weaveworks/following{/other_user}","gists_url":"https://api.github.com/users/weaveworks/gists{/gist_id}","starred_url":"https://api.github.com/users/weaveworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaveworks/subscriptions","organizations_url":"https://api.github.com/users/weaveworks/orgs","repos_url":"https://api.github.com/users/weaveworks/repos","events_url":"https://api.github.com/users/weaveworks/events{/privacy}","received_events_url":"https://api.github.com/users/weaveworks/received_events","type":"Organization","site_admin":false},"repo":{"id":23059575,"name":"weave","full_name":"weaveworks/weave","owner":{"login":"weaveworks","id":9976052,"avatar_url":"https://avatars.githubusercontent.com/u/9976052?v=3","gravatar_id":"","url":"https://api.github.com/users/weaveworks","html_url":"https://github.com/weaveworks","followers_url":"https://api.github.com/users/weaveworks/followers","following_url":"https://api.github.com/users/weaveworks/following{/other_user}","gists_url":"https://api.github.com/users/weaveworks/gists{/gist_id}","starred_url":"https://api.github.com/users/weaveworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaveworks/subscriptions","organizations_url":"https://api.github.com/users/weaveworks/orgs","repos_url":"https://api.github.com/users/weaveworks/repos","events_url":"https://api.github.com/users/weaveworks/events{/privacy}","received_events_url":"https://api.github.com/users/weaveworks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/weaveworks/weave","description":"Simple, resilient multi-host Docker networking and more.","fork":false,"url":"https://api.github.com/repos/weaveworks/weave","forks_url":"https://api.github.com/repos/weaveworks/weave/forks","keys_url":"https://api.github.com/repos/weaveworks/weave/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weaveworks/weave/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weaveworks/weave/teams","hooks_url":"https://api.github.com/repos/weaveworks/weave/hooks","issue_events_url":"https://api.github.com/repos/weaveworks/weave/issues/events{/number}","events_url":"https://api.github.com/repos/weaveworks/weave/events","assignees_url":"https://api.github.com/repos/weaveworks/weave/assignees{/user}","branches_url":"https://api.github.com/repos/weaveworks/weave/branches{/branch}","tags_url":"https://api.github.com/repos/weaveworks/weave/tags","blobs_url":"https://api.github.com/repos/weaveworks/weave/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weaveworks/weave/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weaveworks/weave/git/refs{/sha}","trees_url":"https://api.github.com/repos/weaveworks/weave/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weaveworks/weave/statuses/{sha}","languages_url":"https://api.github.com/repos/weaveworks/weave/languages","stargazers_url":"https://api.github.com/repos/weaveworks/weave/stargazers","contributors_url":"https://api.github.com/repos/weaveworks/weave/contributors","subscribers_url":"https://api.github.com/repos/weaveworks/weave/subscribers","subscription_url":"https://api.github.com/repos/weaveworks/weave/subscription","commits_url":"https://api.github.com/repos/weaveworks/weave/commits{/sha}","git_commits_url":"https://api.github.com/repos/weaveworks/weave/git/commits{/sha}","comments_url":"https://api.github.com/repos/weaveworks/weave/comments{/number}","issue_comment_url":"https://api.github.com/repos/weaveworks/weave/issues/comments{/number}","contents_url":"https://api.github.com/repos/weaveworks/weave/contents/{+path}","compare_url":"https://api.github.com/repos/weaveworks/weave/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weaveworks/weave/merges","archive_url":"https://api.github.com/repos/weaveworks/weave/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weaveworks/weave/downloads","issues_url":"https://api.github.com/repos/weaveworks/weave/issues{/number}","pulls_url":"https://api.github.com/repos/weaveworks/weave/pulls{/number}","milestones_url":"https://api.github.com/repos/weaveworks/weave/milestones{/number}","notifications_url":"https://api.github.com/repos/weaveworks/weave/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weaveworks/weave/labels{/name}","releases_url":"https://api.github.com/repos/weaveworks/weave/releases{/id}","deployments_url":"https://api.github.com/repos/weaveworks/weave/deployments","created_at":"2014-08-18T05:19:07Z","updated_at":"2016-05-23T01:44:29Z","pushed_at":"2016-05-23T14:38:12Z","git_url":"git://github.com/weaveworks/weave.git","ssh_url":"git@github.com:weaveworks/weave.git","clone_url":"https://github.com/weaveworks/weave.git","svn_url":"https://github.com/weaveworks/weave","homepage":"http://weave.works","size":12968,"stargazers_count":4214,"watchers_count":4214,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":269,"mirror_url":null,"open_issues_count":247,"forks":269,"open_issues":247,"watchers":4214,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/weaveworks/weave/pulls/2307"},"html":{"href":"https://github.com/weaveworks/weave/pull/2307"},"issue":{"href":"https://api.github.com/repos/weaveworks/weave/issues/2307"},"comments":{"href":"https://api.github.com/repos/weaveworks/weave/issues/2307/comments"},"review_comments":{"href":"https://api.github.com/repos/weaveworks/weave/pulls/2307/comments"},"review_comment":{"href":"https://api.github.com/repos/weaveworks/weave/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/weaveworks/weave/pulls/2307/commits"},"statuses":{"href":"https://api.github.com/repos/weaveworks/weave/statuses/1be4bac9512cd11b627206aba333ca3f2d1e887b"}}}}
{"actor":{"display_login":"bboreham"}}