{"action":"created","comment":{"url":"https://api.github.com/repos/kbandla/dpkt/pulls/comments/75590540","id":75590540,"diff_hunk":"@@ -58,8 +59,103 @@ def unpack(self, buf):\n         dpkt.Packet.unpack(self, buf)\n         try:\n             if self.code == 0:\n-                self.data = self.ppp = ppp.PPP(self.data)\n+                # We need to use the pppoe.PPP header here, because PPPoE\n+                # doesn't do the normal encapsulation.\n+                self.data = self.ppp = PPP(self.data)\n         except dpkt.UnpackError:\n             pass\n \n+\n+class PPP(ppp.PPP):\n+    # Light version for protocols without the usual encapsulation, for PPPoE\n+    __hdr__ = (\n+        # Usuaully two-bytes, but while protocol compression is not recommended, it is supported\n+        ('p', 'B', ppp.PPP_IP),\n+    )\n+\n+    def unpack(self, buf):","path":"dpkt/pppoe.py","position":27,"original_position":27,"commit_id":"1adb6e9e78c2e1a1656856e15ab8502534ff907f","original_commit_id":"1adb6e9e78c2e1a1656856e15ab8502534ff907f","user":{"login":"obormot","id":1717834,"avatar_url":"https://avatars.githubusercontent.com/u/1717834?v=3","gravatar_id":"","url":"https://api.github.com/users/obormot","html_url":"https://github.com/obormot","followers_url":"https://api.github.com/users/obormot/followers","following_url":"https://api.github.com/users/obormot/following{/other_user}","gists_url":"https://api.github.com/users/obormot/gists{/gist_id}","starred_url":"https://api.github.com/users/obormot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obormot/subscriptions","organizations_url":"https://api.github.com/users/obormot/orgs","repos_url":"https://api.github.com/users/obormot/repos","events_url":"https://api.github.com/users/obormot/events{/privacy}","received_events_url":"https://api.github.com/users/obormot/received_events","type":"User","site_admin":false},"body":"I don't think you need unpack() method here at all..  since you're subclassing dpkt.PPP with a different ```__hdr__``` it should all magically work.","created_at":"2016-08-21T07:57:04Z","updated_at":"2016-08-21T07:57:04Z","html_url":"https://github.com/kbandla/dpkt/pull/280#discussion_r75590540","pull_request_url":"https://api.github.com/repos/kbandla/dpkt/pulls/280","_links":{"self":{"href":"https://api.github.com/repos/kbandla/dpkt/pulls/comments/75590540"},"html":{"href":"https://github.com/kbandla/dpkt/pull/280#discussion_r75590540"},"pull_request":{"href":"https://api.github.com/repos/kbandla/dpkt/pulls/280"}}},"pull_request":{"url":"https://api.github.com/repos/kbandla/dpkt/pulls/280","id":81073334,"html_url":"https://github.com/kbandla/dpkt/pull/280","diff_url":"https://github.com/kbandla/dpkt/pull/280.diff","patch_url":"https://github.com/kbandla/dpkt/pull/280.patch","issue_url":"https://api.github.com/repos/kbandla/dpkt/issues/280","number":280,"state":"open","locked":false,"title":"Minor fixes in various protocols.","user":{"login":"kleptog","id":850393,"avatar_url":"https://avatars.githubusercontent.com/u/850393?v=3","gravatar_id":"","url":"https://api.github.com/users/kleptog","html_url":"https://github.com/kleptog","followers_url":"https://api.github.com/users/kleptog/followers","following_url":"https://api.github.com/users/kleptog/following{/other_user}","gists_url":"https://api.github.com/users/kleptog/gists{/gist_id}","starred_url":"https://api.github.com/users/kleptog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kleptog/subscriptions","organizations_url":"https://api.github.com/users/kleptog/orgs","repos_url":"https://api.github.com/users/kleptog/repos","events_url":"https://api.github.com/users/kleptog/events{/privacy}","received_events_url":"https://api.github.com/users/kleptog/received_events","type":"User","site_admin":false},"body":"- Add IPIP (which is the same as IP)\r\n- Endianness in GRE fields\r\n- Correct PPP encapsulation header\r\n\r\nAdd tests.\r\n\r\nBased on decoding http://packetlife.net/captures/gre_and_4over6.cap","created_at":"2016-08-12T06:32:41Z","updated_at":"2016-08-21T07:57:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"537fa9baec33592fdf3f9a6940a2172f3cc3b391","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/kbandla/dpkt/pulls/280/commits","review_comments_url":"https://api.github.com/repos/kbandla/dpkt/pulls/280/comments","review_comment_url":"https://api.github.com/repos/kbandla/dpkt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kbandla/dpkt/issues/280/comments","statuses_url":"https://api.github.com/repos/kbandla/dpkt/statuses/1adb6e9e78c2e1a1656856e15ab8502534ff907f","head":{"label":"kleptog:master","ref":"master","sha":"1adb6e9e78c2e1a1656856e15ab8502534ff907f","user":{"login":"kleptog","id":850393,"avatar_url":"https://avatars.githubusercontent.com/u/850393?v=3","gravatar_id":"","url":"https://api.github.com/users/kleptog","html_url":"https://github.com/kleptog","followers_url":"https://api.github.com/users/kleptog/followers","following_url":"https://api.github.com/users/kleptog/following{/other_user}","gists_url":"https://api.github.com/users/kleptog/gists{/gist_id}","starred_url":"https://api.github.com/users/kleptog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kleptog/subscriptions","organizations_url":"https://api.github.com/users/kleptog/orgs","repos_url":"https://api.github.com/users/kleptog/repos","events_url":"https://api.github.com/users/kleptog/events{/privacy}","received_events_url":"https://api.github.com/users/kleptog/received_events","type":"User","site_admin":false},"repo":{"id":65528193,"name":"dpkt","full_name":"kleptog/dpkt","owner":{"login":"kleptog","id":850393,"avatar_url":"https://avatars.githubusercontent.com/u/850393?v=3","gravatar_id":"","url":"https://api.github.com/users/kleptog","html_url":"https://github.com/kleptog","followers_url":"https://api.github.com/users/kleptog/followers","following_url":"https://api.github.com/users/kleptog/following{/other_user}","gists_url":"https://api.github.com/users/kleptog/gists{/gist_id}","starred_url":"https://api.github.com/users/kleptog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kleptog/subscriptions","organizations_url":"https://api.github.com/users/kleptog/orgs","repos_url":"https://api.github.com/users/kleptog/repos","events_url":"https://api.github.com/users/kleptog/events{/privacy}","received_events_url":"https://api.github.com/users/kleptog/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kleptog/dpkt","description":"fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols","fork":true,"url":"https://api.github.com/repos/kleptog/dpkt","forks_url":"https://api.github.com/repos/kleptog/dpkt/forks","keys_url":"https://api.github.com/repos/kleptog/dpkt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kleptog/dpkt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kleptog/dpkt/teams","hooks_url":"https://api.github.com/repos/kleptog/dpkt/hooks","issue_events_url":"https://api.github.com/repos/kleptog/dpkt/issues/events{/number}","events_url":"https://api.github.com/repos/kleptog/dpkt/events","assignees_url":"https://api.github.com/repos/kleptog/dpkt/assignees{/user}","branches_url":"https://api.github.com/repos/kleptog/dpkt/branches{/branch}","tags_url":"https://api.github.com/repos/kleptog/dpkt/tags","blobs_url":"https://api.github.com/repos/kleptog/dpkt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kleptog/dpkt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kleptog/dpkt/git/refs{/sha}","trees_url":"https://api.github.com/repos/kleptog/dpkt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kleptog/dpkt/statuses/{sha}","languages_url":"https://api.github.com/repos/kleptog/dpkt/languages","stargazers_url":"https://api.github.com/repos/kleptog/dpkt/stargazers","contributors_url":"https://api.github.com/repos/kleptog/dpkt/contributors","subscribers_url":"https://api.github.com/repos/kleptog/dpkt/subscribers","subscription_url":"https://api.github.com/repos/kleptog/dpkt/subscription","commits_url":"https://api.github.com/repos/kleptog/dpkt/commits{/sha}","git_commits_url":"https://api.github.com/repos/kleptog/dpkt/git/commits{/sha}","comments_url":"https://api.github.com/repos/kleptog/dpkt/comments{/number}","issue_comment_url":"https://api.github.com/repos/kleptog/dpkt/issues/comments{/number}","contents_url":"https://api.github.com/repos/kleptog/dpkt/contents/{+path}","compare_url":"https://api.github.com/repos/kleptog/dpkt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kleptog/dpkt/merges","archive_url":"https://api.github.com/repos/kleptog/dpkt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kleptog/dpkt/downloads","issues_url":"https://api.github.com/repos/kleptog/dpkt/issues{/number}","pulls_url":"https://api.github.com/repos/kleptog/dpkt/pulls{/number}","milestones_url":"https://api.github.com/repos/kleptog/dpkt/milestones{/number}","notifications_url":"https://api.github.com/repos/kleptog/dpkt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kleptog/dpkt/labels{/name}","releases_url":"https://api.github.com/repos/kleptog/dpkt/releases{/id}","deployments_url":"https://api.github.com/repos/kleptog/dpkt/deployments","created_at":"2016-08-12T06:13:43Z","updated_at":"2016-08-12T06:13:44Z","pushed_at":"2016-08-21T06:46:44Z","git_url":"git://github.com/kleptog/dpkt.git","ssh_url":"git@github.com:kleptog/dpkt.git","clone_url":"https://github.com/kleptog/dpkt.git","svn_url":"https://github.com/kleptog/dpkt","homepage":"","size":533,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"kbandla:master","ref":"master","sha":"6410c988ce45c56932f5f4b9f5a75a8d2177ea24","user":{"login":"kbandla","id":200847,"avatar_url":"https://avatars.githubusercontent.com/u/200847?v=3","gravatar_id":"","url":"https://api.github.com/users/kbandla","html_url":"https://github.com/kbandla","followers_url":"https://api.github.com/users/kbandla/followers","following_url":"https://api.github.com/users/kbandla/following{/other_user}","gists_url":"https://api.github.com/users/kbandla/gists{/gist_id}","starred_url":"https://api.github.com/users/kbandla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbandla/subscriptions","organizations_url":"https://api.github.com/users/kbandla/orgs","repos_url":"https://api.github.com/users/kbandla/repos","events_url":"https://api.github.com/users/kbandla/events{/privacy}","received_events_url":"https://api.github.com/users/kbandla/received_events","type":"User","site_admin":false},"repo":{"id":4576441,"name":"dpkt","full_name":"kbandla/dpkt","owner":{"login":"kbandla","id":200847,"avatar_url":"https://avatars.githubusercontent.com/u/200847?v=3","gravatar_id":"","url":"https://api.github.com/users/kbandla","html_url":"https://github.com/kbandla","followers_url":"https://api.github.com/users/kbandla/followers","following_url":"https://api.github.com/users/kbandla/following{/other_user}","gists_url":"https://api.github.com/users/kbandla/gists{/gist_id}","starred_url":"https://api.github.com/users/kbandla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbandla/subscriptions","organizations_url":"https://api.github.com/users/kbandla/orgs","repos_url":"https://api.github.com/users/kbandla/repos","events_url":"https://api.github.com/users/kbandla/events{/privacy}","received_events_url":"https://api.github.com/users/kbandla/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kbandla/dpkt","description":"fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols","fork":false,"url":"https://api.github.com/repos/kbandla/dpkt","forks_url":"https://api.github.com/repos/kbandla/dpkt/forks","keys_url":"https://api.github.com/repos/kbandla/dpkt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kbandla/dpkt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kbandla/dpkt/teams","hooks_url":"https://api.github.com/repos/kbandla/dpkt/hooks","issue_events_url":"https://api.github.com/repos/kbandla/dpkt/issues/events{/number}","events_url":"https://api.github.com/repos/kbandla/dpkt/events","assignees_url":"https://api.github.com/repos/kbandla/dpkt/assignees{/user}","branches_url":"https://api.github.com/repos/kbandla/dpkt/branches{/branch}","tags_url":"https://api.github.com/repos/kbandla/dpkt/tags","blobs_url":"https://api.github.com/repos/kbandla/dpkt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kbandla/dpkt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kbandla/dpkt/git/refs{/sha}","trees_url":"https://api.github.com/repos/kbandla/dpkt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kbandla/dpkt/statuses/{sha}","languages_url":"https://api.github.com/repos/kbandla/dpkt/languages","stargazers_url":"https://api.github.com/repos/kbandla/dpkt/stargazers","contributors_url":"https://api.github.com/repos/kbandla/dpkt/contributors","subscribers_url":"https://api.github.com/repos/kbandla/dpkt/subscribers","subscription_url":"https://api.github.com/repos/kbandla/dpkt/subscription","commits_url":"https://api.github.com/repos/kbandla/dpkt/commits{/sha}","git_commits_url":"https://api.github.com/repos/kbandla/dpkt/git/commits{/sha}","comments_url":"https://api.github.com/repos/kbandla/dpkt/comments{/number}","issue_comment_url":"https://api.github.com/repos/kbandla/dpkt/issues/comments{/number}","contents_url":"https://api.github.com/repos/kbandla/dpkt/contents/{+path}","compare_url":"https://api.github.com/repos/kbandla/dpkt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kbandla/dpkt/merges","archive_url":"https://api.github.com/repos/kbandla/dpkt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kbandla/dpkt/downloads","issues_url":"https://api.github.com/repos/kbandla/dpkt/issues{/number}","pulls_url":"https://api.github.com/repos/kbandla/dpkt/pulls{/number}","milestones_url":"https://api.github.com/repos/kbandla/dpkt/milestones{/number}","notifications_url":"https://api.github.com/repos/kbandla/dpkt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kbandla/dpkt/labels{/name}","releases_url":"https://api.github.com/repos/kbandla/dpkt/releases{/id}","deployments_url":"https://api.github.com/repos/kbandla/dpkt/deployments","created_at":"2012-06-06T18:39:31Z","updated_at":"2016-08-20T10:28:13Z","pushed_at":"2016-08-21T06:46:45Z","git_url":"git://github.com/kbandla/dpkt.git","ssh_url":"git@github.com:kbandla/dpkt.git","clone_url":"https://github.com/kbandla/dpkt.git","svn_url":"https://github.com/kbandla/dpkt","homepage":"","size":707,"stargazers_count":265,"watchers_count":265,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":86,"mirror_url":null,"open_issues_count":57,"forks":86,"open_issues":57,"watchers":265,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kbandla/dpkt/pulls/280"},"html":{"href":"https://github.com/kbandla/dpkt/pull/280"},"issue":{"href":"https://api.github.com/repos/kbandla/dpkt/issues/280"},"comments":{"href":"https://api.github.com/repos/kbandla/dpkt/issues/280/comments"},"review_comments":{"href":"https://api.github.com/repos/kbandla/dpkt/pulls/280/comments"},"review_comment":{"href":"https://api.github.com/repos/kbandla/dpkt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kbandla/dpkt/pulls/280/commits"},"statuses":{"href":"https://api.github.com/repos/kbandla/dpkt/statuses/1adb6e9e78c2e1a1656856e15ab8502534ff907f"}}}}
{"actor":{"display_login":"obormot"}}