{"action":"created","comment":{"url":"https://api.github.com/repos/google/gopacket/pulls/comments/53434136","id":53434136,"diff_hunk":"@@ -187,6 +191,16 @@ func (b *BPFSniffer) ReadPacketData() ([]byte, gopacket.CaptureInfo, error) {\n \thdr := (*unix.BpfHdr)(unsafe.Pointer(&b.readBuffer[b.readBytesConsumed]))\n \tframeStart := b.readBytesConsumed + int(hdr.Hdrlen)\n \tb.readBytesConsumed += bpfWordAlign(int(hdr.Hdrlen) + int(hdr.Caplen))\n+\n+\tif frameStart+int(hdr.Caplen) > len(b.readBuffer) {\n+\t\tcaptureInfo := gopacket.CaptureInfo{\n+\t\t\tTimestamp:     time.Unix(int64(hdr.Tstamp.Sec), int64(hdr.Tstamp.Usec)*1000),\n+\t\t\tCaptureLength: 0,\n+\t\t\tLength:        0,\n+\t\t}\n+\t\treturn nil, captureInfo, nil","path":"bsdbpf/bsd_bpf_sniffer.go","position":null,"original_position":29,"commit_id":"12e8d446ea8463d55ce3944675ba5c93d9fbcaa1","original_commit_id":"5b944d0f0f121875ee43402f1b05835eae798ce9","user":{"login":"david415","id":50611,"avatar_url":"https://avatars.githubusercontent.com/u/50611?v=3","gravatar_id":"","url":"https://api.github.com/users/david415","html_url":"https://github.com/david415","followers_url":"https://api.github.com/users/david415/followers","following_url":"https://api.github.com/users/david415/following{/other_user}","gists_url":"https://api.github.com/users/david415/gists{/gist_id}","starred_url":"https://api.github.com/users/david415/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david415/subscriptions","organizations_url":"https://api.github.com/users/david415/orgs","repos_url":"https://api.github.com/users/david415/repos","events_url":"https://api.github.com/users/david415/events{/privacy}","received_events_url":"https://api.github.com/users/david415/received_events","type":"User","site_admin":false},"body":"I decided to return an error. Oh but we should specify our own error type so that the user of this API can choose to ignore this class of error.","created_at":"2016-02-19T08:34:53Z","updated_at":"2016-02-19T08:34:53Z","html_url":"https://github.com/google/gopacket/pull/168#discussion_r53434136","pull_request_url":"https://api.github.com/repos/google/gopacket/pulls/168","_links":{"self":{"href":"https://api.github.com/repos/google/gopacket/pulls/comments/53434136"},"html":{"href":"https://github.com/google/gopacket/pull/168#discussion_r53434136"},"pull_request":{"href":"https://api.github.com/repos/google/gopacket/pulls/168"}}},"pull_request":{"url":"https://api.github.com/repos/google/gopacket/pulls/168","id":59821889,"html_url":"https://github.com/google/gopacket/pull/168","diff_url":"https://github.com/google/gopacket/pull/168.diff","patch_url":"https://github.com/google/gopacket/pull/168.patch","issue_url":"https://api.github.com/repos/google/gopacket/issues/168","number":168,"state":"open","locked":false,"title":"167.fix bsd bpf.0","user":{"login":"david415","id":50611,"avatar_url":"https://avatars.githubusercontent.com/u/50611?v=3","gravatar_id":"","url":"https://api.github.com/users/david415","html_url":"https://github.com/david415","followers_url":"https://api.github.com/users/david415/followers","following_url":"https://api.github.com/users/david415/following{/other_user}","gists_url":"https://api.github.com/users/david415/gists{/gist_id}","starred_url":"https://api.github.com/users/david415/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david415/subscriptions","organizations_url":"https://api.github.com/users/david415/orgs","repos_url":"https://api.github.com/users/david415/repos","events_url":"https://api.github.com/users/david415/events{/privacy}","received_events_url":"https://api.github.com/users/david415/received_events","type":"User","site_admin":false},"body":"\r\nHi. What do you think of this solution to the bug in the BPF sniffer?\r\n\r\nThis also includes a change to make ``pickBpfDevice`` panic if no BPF device was acquired.","created_at":"2016-02-18T16:11:32Z","updated_at":"2016-02-19T08:34:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3a79a4aea7f9a7b287609f930023cf4a973c436","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/google/gopacket/pulls/168/commits","review_comments_url":"https://api.github.com/repos/google/gopacket/pulls/168/comments","review_comment_url":"https://api.github.com/repos/google/gopacket/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/gopacket/issues/168/comments","statuses_url":"https://api.github.com/repos/google/gopacket/statuses/12e8d446ea8463d55ce3944675ba5c93d9fbcaa1","head":{"label":"david415:167.fix_bsd_bpf.0","ref":"167.fix_bsd_bpf.0","sha":"12e8d446ea8463d55ce3944675ba5c93d9fbcaa1","user":{"login":"david415","id":50611,"avatar_url":"https://avatars.githubusercontent.com/u/50611?v=3","gravatar_id":"","url":"https://api.github.com/users/david415","html_url":"https://github.com/david415","followers_url":"https://api.github.com/users/david415/followers","following_url":"https://api.github.com/users/david415/following{/other_user}","gists_url":"https://api.github.com/users/david415/gists{/gist_id}","starred_url":"https://api.github.com/users/david415/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david415/subscriptions","organizations_url":"https://api.github.com/users/david415/orgs","repos_url":"https://api.github.com/users/david415/repos","events_url":"https://api.github.com/users/david415/events{/privacy}","received_events_url":"https://api.github.com/users/david415/received_events","type":"User","site_admin":false},"repo":{"id":37559505,"name":"gopacket","full_name":"david415/gopacket","owner":{"login":"david415","id":50611,"avatar_url":"https://avatars.githubusercontent.com/u/50611?v=3","gravatar_id":"","url":"https://api.github.com/users/david415","html_url":"https://github.com/david415","followers_url":"https://api.github.com/users/david415/followers","following_url":"https://api.github.com/users/david415/following{/other_user}","gists_url":"https://api.github.com/users/david415/gists{/gist_id}","starred_url":"https://api.github.com/users/david415/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david415/subscriptions","organizations_url":"https://api.github.com/users/david415/orgs","repos_url":"https://api.github.com/users/david415/repos","events_url":"https://api.github.com/users/david415/events{/privacy}","received_events_url":"https://api.github.com/users/david415/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/david415/gopacket","description":"Provides packet processing capabilities for Go","fork":true,"url":"https://api.github.com/repos/david415/gopacket","forks_url":"https://api.github.com/repos/david415/gopacket/forks","keys_url":"https://api.github.com/repos/david415/gopacket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/david415/gopacket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/david415/gopacket/teams","hooks_url":"https://api.github.com/repos/david415/gopacket/hooks","issue_events_url":"https://api.github.com/repos/david415/gopacket/issues/events{/number}","events_url":"https://api.github.com/repos/david415/gopacket/events","assignees_url":"https://api.github.com/repos/david415/gopacket/assignees{/user}","branches_url":"https://api.github.com/repos/david415/gopacket/branches{/branch}","tags_url":"https://api.github.com/repos/david415/gopacket/tags","blobs_url":"https://api.github.com/repos/david415/gopacket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/david415/gopacket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/david415/gopacket/git/refs{/sha}","trees_url":"https://api.github.com/repos/david415/gopacket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/david415/gopacket/statuses/{sha}","languages_url":"https://api.github.com/repos/david415/gopacket/languages","stargazers_url":"https://api.github.com/repos/david415/gopacket/stargazers","contributors_url":"https://api.github.com/repos/david415/gopacket/contributors","subscribers_url":"https://api.github.com/repos/david415/gopacket/subscribers","subscription_url":"https://api.github.com/repos/david415/gopacket/subscription","commits_url":"https://api.github.com/repos/david415/gopacket/commits{/sha}","git_commits_url":"https://api.github.com/repos/david415/gopacket/git/commits{/sha}","comments_url":"https://api.github.com/repos/david415/gopacket/comments{/number}","issue_comment_url":"https://api.github.com/repos/david415/gopacket/issues/comments{/number}","contents_url":"https://api.github.com/repos/david415/gopacket/contents/{+path}","compare_url":"https://api.github.com/repos/david415/gopacket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/david415/gopacket/merges","archive_url":"https://api.github.com/repos/david415/gopacket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/david415/gopacket/downloads","issues_url":"https://api.github.com/repos/david415/gopacket/issues{/number}","pulls_url":"https://api.github.com/repos/david415/gopacket/pulls{/number}","milestones_url":"https://api.github.com/repos/david415/gopacket/milestones{/number}","notifications_url":"https://api.github.com/repos/david415/gopacket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/david415/gopacket/labels{/name}","releases_url":"https://api.github.com/repos/david415/gopacket/releases{/id}","deployments_url":"https://api.github.com/repos/david415/gopacket/deployments","created_at":"2015-06-16T22:32:30Z","updated_at":"2015-06-16T22:32:31Z","pushed_at":"2016-02-18T23:59:15Z","git_url":"git://github.com/david415/gopacket.git","ssh_url":"git@github.com:david415/gopacket.git","clone_url":"https://github.com/david415/gopacket.git","svn_url":"https://github.com/david415/gopacket","homepage":"","size":3625,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"cdd21628caecd1489c9204a8596414467fd6d629","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":32351944,"name":"gopacket","full_name":"google/gopacket","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/gopacket","description":"Provides packet processing capabilities for Go","fork":false,"url":"https://api.github.com/repos/google/gopacket","forks_url":"https://api.github.com/repos/google/gopacket/forks","keys_url":"https://api.github.com/repos/google/gopacket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/gopacket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/gopacket/teams","hooks_url":"https://api.github.com/repos/google/gopacket/hooks","issue_events_url":"https://api.github.com/repos/google/gopacket/issues/events{/number}","events_url":"https://api.github.com/repos/google/gopacket/events","assignees_url":"https://api.github.com/repos/google/gopacket/assignees{/user}","branches_url":"https://api.github.com/repos/google/gopacket/branches{/branch}","tags_url":"https://api.github.com/repos/google/gopacket/tags","blobs_url":"https://api.github.com/repos/google/gopacket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/gopacket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/gopacket/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/gopacket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/gopacket/statuses/{sha}","languages_url":"https://api.github.com/repos/google/gopacket/languages","stargazers_url":"https://api.github.com/repos/google/gopacket/stargazers","contributors_url":"https://api.github.com/repos/google/gopacket/contributors","subscribers_url":"https://api.github.com/repos/google/gopacket/subscribers","subscription_url":"https://api.github.com/repos/google/gopacket/subscription","commits_url":"https://api.github.com/repos/google/gopacket/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/gopacket/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/gopacket/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/gopacket/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/gopacket/contents/{+path}","compare_url":"https://api.github.com/repos/google/gopacket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/gopacket/merges","archive_url":"https://api.github.com/repos/google/gopacket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/gopacket/downloads","issues_url":"https://api.github.com/repos/google/gopacket/issues{/number}","pulls_url":"https://api.github.com/repos/google/gopacket/pulls{/number}","milestones_url":"https://api.github.com/repos/google/gopacket/milestones{/number}","notifications_url":"https://api.github.com/repos/google/gopacket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/gopacket/labels{/name}","releases_url":"https://api.github.com/repos/google/gopacket/releases{/id}","deployments_url":"https://api.github.com/repos/google/gopacket/deployments","created_at":"2015-03-16T20:46:00Z","updated_at":"2016-02-19T03:08:38Z","pushed_at":"2016-02-18T23:59:16Z","git_url":"git://github.com/google/gopacket.git","ssh_url":"git@github.com:google/gopacket.git","clone_url":"https://github.com/google/gopacket.git","svn_url":"https://github.com/google/gopacket","homepage":"","size":3969,"stargazers_count":492,"watchers_count":492,"language":"Go","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":86,"mirror_url":null,"open_issues_count":38,"forks":86,"open_issues":38,"watchers":492,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/gopacket/pulls/168"},"html":{"href":"https://github.com/google/gopacket/pull/168"},"issue":{"href":"https://api.github.com/repos/google/gopacket/issues/168"},"comments":{"href":"https://api.github.com/repos/google/gopacket/issues/168/comments"},"review_comments":{"href":"https://api.github.com/repos/google/gopacket/pulls/168/comments"},"review_comment":{"href":"https://api.github.com/repos/google/gopacket/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/gopacket/pulls/168/commits"},"statuses":{"href":"https://api.github.com/repos/google/gopacket/statuses/12e8d446ea8463d55ce3944675ba5c93d9fbcaa1"}}}}