{"action":"created","comment":{"url":"https://api.github.com/repos/opencomputeproject/SAI/pulls/comments/88366140","pull_request_review_id":8942325,"id":88366140,"diff_hunk":"@@ -184,6 +187,77 @@ def runTest(self):\n \n             self.client.sai_thrift_remove_virtual_router(vr_id)\n \n+def ip6_to_integer(ip6):\n+        ip6 = socket.inet_pton(socket.AF_INET6, ip6)\n+        a, b = unpack(\">QQ\", ip6)\n+        return (a << 64) | b\n+\n+def integer_to_ip6(ip6int):\n+        a = (ip6int >> 64) & ((1 << 64) - 1)\n+        b = ip6int & ((1 << 64) - 1)\n+        return socket.inet_ntop(socket.AF_INET6, pack(\">QQ\", a, b))\n+        \n+@group('l3')\n+class L3IPv6PrefixTest(sai_base_test.ThriftInterfaceDataPlane):\n+    def runTest(self):\n+        print\n+        print \"Sending packet port 1 -> port 2 (2000::1 -> 3000::1)\"\n+        switch_init(self.client)\n+        port1 = port_list[0]\n+        port2 = port_list[1]\n+        v4_enabled = 1\n+        v6_enabled = 1\n+        mac = ''\n+\n+        vr_id = sai_thrift_create_virtual_router(self.client, v4_enabled, v6_enabled)\n+\n+        rif_id1 = sai_thrift_create_router_interface(self.client, vr_id, 1, port1, 0, v4_enabled, v6_enabled, mac)\n+        rif_id2 = sai_thrift_create_router_interface(self.client, vr_id, 1, port2, 0, v4_enabled, v6_enabled, mac)\n+\n+        addr_family = SAI_IP_ADDR_FAMILY_IPV6\n+        ip_addr1 = '1234:5678:9abc:def0:4422:1133:5577:99aa'\n+        ip_addr1_int = ip6_to_integer(ip_addr1)\n+\n+        dmac1 = '00:11:22:33:44:55'\n+        sai_thrift_create_neighbor(self.client, addr_family, rif_id1, ip_addr1, dmac1)\n+        nhop1 = sai_thrift_create_nhop(self.client, addr_family, ip_addr1, rif_id1)\n+        \n+        pkt = simple_tcpv6_packet( eth_dst=router_mac,\n+                                eth_src='00:22:22:22:22:22',\n+                                ipv6_dst='1234:5678:9abc:def0:4422:1133:5577:99aa',\n+                                ipv6_src='2000::1',\n+                                ipv6_hlim=64)\n+        exp_pkt = simple_tcpv6_packet(\n+                                eth_dst='00:11:22:33:44:55',\n+                                eth_src=router_mac,\n+                                ipv6_dst='1234:5678:9abc:def0:4422:1133:5577:99aa',\n+                                ipv6_src='2000::1',\n+                                ipv6_hlim=63)\n+        try:\n+            for i in range(128):\n+                mask_int = ( ( 1 << (128-i) ) - 1 ) << i\n+                net_int = ip_addr1_int & mask_int\n+                mask = integer_to_ip6(mask_int)\n+                net = integer_to_ip6(net_int)\n+\n+                print net + ' / ' + mask\n+                sai_thrift_create_route(self.client, vr_id, addr_family, net, mask, rif_id1)\n+                send_packet(self, 1, str(pkt))\n+                verify_packets(self, exp_pkt, [0])\n+                sai_thrift_remove_route(self.client, vr_id, addr_family, net, mask, rif_id1)\n+                mask=\"\"\n+        finally:\n+            if mask!=\"\":","path":"test/saithrift/tests/sail3.py","position":74,"original_position":74,"commit_id":"d1316f49f53b870cb2fe6f94fd049c8c29c48b68","original_commit_id":"d1316f49f53b870cb2fe6f94fd049c8c29c48b68","user":{"login":"taoyl-ms","id":22916085,"avatar_url":"https://avatars.githubusercontent.com/u/22916085?v=3","gravatar_id":"","url":"https://api.github.com/users/taoyl-ms","html_url":"https://github.com/taoyl-ms","followers_url":"https://api.github.com/users/taoyl-ms/followers","following_url":"https://api.github.com/users/taoyl-ms/following{/other_user}","gists_url":"https://api.github.com/users/taoyl-ms/gists{/gist_id}","starred_url":"https://api.github.com/users/taoyl-ms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taoyl-ms/subscriptions","organizations_url":"https://api.github.com/users/taoyl-ms/orgs","repos_url":"https://api.github.com/users/taoyl-ms/repos","events_url":"https://api.github.com/users/taoyl-ms/events{/privacy}","received_events_url":"https://api.github.com/users/taoyl-ms/received_events","type":"User","site_admin":false},"body":"Though sai_thrift_remove_route might be called twice in this case, I don't see a problem here. What's your concern about that?","created_at":"2016-11-17T00:54:02Z","updated_at":"2016-11-17T00:54:02Z","html_url":"https://github.com/opencomputeproject/SAI/pull/299#discussion_r88366140","pull_request_url":"https://api.github.com/repos/opencomputeproject/SAI/pulls/299","_links":{"self":{"href":"https://api.github.com/repos/opencomputeproject/SAI/pulls/comments/88366140"},"html":{"href":"https://github.com/opencomputeproject/SAI/pull/299#discussion_r88366140"},"pull_request":{"href":"https://api.github.com/repos/opencomputeproject/SAI/pulls/299"}}},"pull_request":{"url":"https://api.github.com/repos/opencomputeproject/SAI/pulls/299","id":92840315,"html_url":"https://github.com/opencomputeproject/SAI/pull/299","diff_url":"https://github.com/opencomputeproject/SAI/pull/299.diff","patch_url":"https://github.com/opencomputeproject/SAI/pull/299.patch","issue_url":"https://api.github.com/repos/opencomputeproject/SAI/issues/299","number":299,"state":"open","locked":false,"title":"Add IPv6PrefixTest","user":{"login":"taoyl-ms","id":22916085,"avatar_url":"https://avatars.githubusercontent.com/u/22916085?v=3","gravatar_id":"","url":"https://api.github.com/users/taoyl-ms","html_url":"https://github.com/taoyl-ms","followers_url":"https://api.github.com/users/taoyl-ms/followers","following_url":"https://api.github.com/users/taoyl-ms/following{/other_user}","gists_url":"https://api.github.com/users/taoyl-ms/gists{/gist_id}","starred_url":"https://api.github.com/users/taoyl-ms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taoyl-ms/subscriptions","organizations_url":"https://api.github.com/users/taoyl-ms/orgs","repos_url":"https://api.github.com/users/taoyl-ms/repos","events_url":"https://api.github.com/users/taoyl-ms/events{/privacy}","received_events_url":"https://api.github.com/users/taoyl-ms/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-08T19:12:26Z","updated_at":"2016-11-17T00:54:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1a48e4d9a053a9ee6ef2f239b076ea8a7961098","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/opencomputeproject/SAI/pulls/299/commits","review_comments_url":"https://api.github.com/repos/opencomputeproject/SAI/pulls/299/comments","review_comment_url":"https://api.github.com/repos/opencomputeproject/SAI/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opencomputeproject/SAI/issues/299/comments","statuses_url":"https://api.github.com/repos/opencomputeproject/SAI/statuses/d1316f49f53b870cb2fe6f94fd049c8c29c48b68","head":{"label":"taoyl-ms:taoyl/ipv6_prefix_test","ref":"taoyl/ipv6_prefix_test","sha":"d1316f49f53b870cb2fe6f94fd049c8c29c48b68","user":{"login":"taoyl-ms","id":22916085,"avatar_url":"https://avatars.githubusercontent.com/u/22916085?v=3","gravatar_id":"","url":"https://api.github.com/users/taoyl-ms","html_url":"https://github.com/taoyl-ms","followers_url":"https://api.github.com/users/taoyl-ms/followers","following_url":"https://api.github.com/users/taoyl-ms/following{/other_user}","gists_url":"https://api.github.com/users/taoyl-ms/gists{/gist_id}","starred_url":"https://api.github.com/users/taoyl-ms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taoyl-ms/subscriptions","organizations_url":"https://api.github.com/users/taoyl-ms/orgs","repos_url":"https://api.github.com/users/taoyl-ms/repos","events_url":"https://api.github.com/users/taoyl-ms/events{/privacy}","received_events_url":"https://api.github.com/users/taoyl-ms/received_events","type":"User","site_admin":false},"repo":{"id":73217772,"name":"SAI","full_name":"taoyl-ms/SAI","owner":{"login":"taoyl-ms","id":22916085,"avatar_url":"https://avatars.githubusercontent.com/u/22916085?v=3","gravatar_id":"","url":"https://api.github.com/users/taoyl-ms","html_url":"https://github.com/taoyl-ms","followers_url":"https://api.github.com/users/taoyl-ms/followers","following_url":"https://api.github.com/users/taoyl-ms/following{/other_user}","gists_url":"https://api.github.com/users/taoyl-ms/gists{/gist_id}","starred_url":"https://api.github.com/users/taoyl-ms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taoyl-ms/subscriptions","organizations_url":"https://api.github.com/users/taoyl-ms/orgs","repos_url":"https://api.github.com/users/taoyl-ms/repos","events_url":"https://api.github.com/users/taoyl-ms/events{/privacy}","received_events_url":"https://api.github.com/users/taoyl-ms/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/taoyl-ms/SAI","description":"Switch Abstraction Interface","fork":true,"url":"https://api.github.com/repos/taoyl-ms/SAI","forks_url":"https://api.github.com/repos/taoyl-ms/SAI/forks","keys_url":"https://api.github.com/repos/taoyl-ms/SAI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taoyl-ms/SAI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taoyl-ms/SAI/teams","hooks_url":"https://api.github.com/repos/taoyl-ms/SAI/hooks","issue_events_url":"https://api.github.com/repos/taoyl-ms/SAI/issues/events{/number}","events_url":"https://api.github.com/repos/taoyl-ms/SAI/events","assignees_url":"https://api.github.com/repos/taoyl-ms/SAI/assignees{/user}","branches_url":"https://api.github.com/repos/taoyl-ms/SAI/branches{/branch}","tags_url":"https://api.github.com/repos/taoyl-ms/SAI/tags","blobs_url":"https://api.github.com/repos/taoyl-ms/SAI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taoyl-ms/SAI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taoyl-ms/SAI/git/refs{/sha}","trees_url":"https://api.github.com/repos/taoyl-ms/SAI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taoyl-ms/SAI/statuses/{sha}","languages_url":"https://api.github.com/repos/taoyl-ms/SAI/languages","stargazers_url":"https://api.github.com/repos/taoyl-ms/SAI/stargazers","contributors_url":"https://api.github.com/repos/taoyl-ms/SAI/contributors","subscribers_url":"https://api.github.com/repos/taoyl-ms/SAI/subscribers","subscription_url":"https://api.github.com/repos/taoyl-ms/SAI/subscription","commits_url":"https://api.github.com/repos/taoyl-ms/SAI/commits{/sha}","git_commits_url":"https://api.github.com/repos/taoyl-ms/SAI/git/commits{/sha}","comments_url":"https://api.github.com/repos/taoyl-ms/SAI/comments{/number}","issue_comment_url":"https://api.github.com/repos/taoyl-ms/SAI/issues/comments{/number}","contents_url":"https://api.github.com/repos/taoyl-ms/SAI/contents/{+path}","compare_url":"https://api.github.com/repos/taoyl-ms/SAI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taoyl-ms/SAI/merges","archive_url":"https://api.github.com/repos/taoyl-ms/SAI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taoyl-ms/SAI/downloads","issues_url":"https://api.github.com/repos/taoyl-ms/SAI/issues{/number}","pulls_url":"https://api.github.com/repos/taoyl-ms/SAI/pulls{/number}","milestones_url":"https://api.github.com/repos/taoyl-ms/SAI/milestones{/number}","notifications_url":"https://api.github.com/repos/taoyl-ms/SAI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taoyl-ms/SAI/labels{/name}","releases_url":"https://api.github.com/repos/taoyl-ms/SAI/releases{/id}","deployments_url":"https://api.github.com/repos/taoyl-ms/SAI/deployments","created_at":"2016-11-08T19:02:34Z","updated_at":"2016-11-08T19:02:35Z","pushed_at":"2016-11-17T00:12:09Z","git_url":"git://github.com/taoyl-ms/SAI.git","ssh_url":"git@github.com:taoyl-ms/SAI.git","clone_url":"https://github.com/taoyl-ms/SAI.git","svn_url":"https://github.com/taoyl-ms/SAI","homepage":null,"size":35470,"stargazers_count":0,"watchers_count":0,"language":"C","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":"opencomputeproject:master","ref":"master","sha":"ff87fbebe2270829c643896919c1b9d629ce6978","user":{"login":"opencomputeproject","id":16659405,"avatar_url":"https://avatars.githubusercontent.com/u/16659405?v=3","gravatar_id":"","url":"https://api.github.com/users/opencomputeproject","html_url":"https://github.com/opencomputeproject","followers_url":"https://api.github.com/users/opencomputeproject/followers","following_url":"https://api.github.com/users/opencomputeproject/following{/other_user}","gists_url":"https://api.github.com/users/opencomputeproject/gists{/gist_id}","starred_url":"https://api.github.com/users/opencomputeproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencomputeproject/subscriptions","organizations_url":"https://api.github.com/users/opencomputeproject/orgs","repos_url":"https://api.github.com/users/opencomputeproject/repos","events_url":"https://api.github.com/users/opencomputeproject/events{/privacy}","received_events_url":"https://api.github.com/users/opencomputeproject/received_events","type":"Organization","site_admin":false},"repo":{"id":43159385,"name":"SAI","full_name":"opencomputeproject/SAI","owner":{"login":"opencomputeproject","id":16659405,"avatar_url":"https://avatars.githubusercontent.com/u/16659405?v=3","gravatar_id":"","url":"https://api.github.com/users/opencomputeproject","html_url":"https://github.com/opencomputeproject","followers_url":"https://api.github.com/users/opencomputeproject/followers","following_url":"https://api.github.com/users/opencomputeproject/following{/other_user}","gists_url":"https://api.github.com/users/opencomputeproject/gists{/gist_id}","starred_url":"https://api.github.com/users/opencomputeproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencomputeproject/subscriptions","organizations_url":"https://api.github.com/users/opencomputeproject/orgs","repos_url":"https://api.github.com/users/opencomputeproject/repos","events_url":"https://api.github.com/users/opencomputeproject/events{/privacy}","received_events_url":"https://api.github.com/users/opencomputeproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opencomputeproject/SAI","description":"Switch Abstraction Interface","fork":false,"url":"https://api.github.com/repos/opencomputeproject/SAI","forks_url":"https://api.github.com/repos/opencomputeproject/SAI/forks","keys_url":"https://api.github.com/repos/opencomputeproject/SAI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opencomputeproject/SAI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opencomputeproject/SAI/teams","hooks_url":"https://api.github.com/repos/opencomputeproject/SAI/hooks","issue_events_url":"https://api.github.com/repos/opencomputeproject/SAI/issues/events{/number}","events_url":"https://api.github.com/repos/opencomputeproject/SAI/events","assignees_url":"https://api.github.com/repos/opencomputeproject/SAI/assignees{/user}","branches_url":"https://api.github.com/repos/opencomputeproject/SAI/branches{/branch}","tags_url":"https://api.github.com/repos/opencomputeproject/SAI/tags","blobs_url":"https://api.github.com/repos/opencomputeproject/SAI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opencomputeproject/SAI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opencomputeproject/SAI/git/refs{/sha}","trees_url":"https://api.github.com/repos/opencomputeproject/SAI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opencomputeproject/SAI/statuses/{sha}","languages_url":"https://api.github.com/repos/opencomputeproject/SAI/languages","stargazers_url":"https://api.github.com/repos/opencomputeproject/SAI/stargazers","contributors_url":"https://api.github.com/repos/opencomputeproject/SAI/contributors","subscribers_url":"https://api.github.com/repos/opencomputeproject/SAI/subscribers","subscription_url":"https://api.github.com/repos/opencomputeproject/SAI/subscription","commits_url":"https://api.github.com/repos/opencomputeproject/SAI/commits{/sha}","git_commits_url":"https://api.github.com/repos/opencomputeproject/SAI/git/commits{/sha}","comments_url":"https://api.github.com/repos/opencomputeproject/SAI/comments{/number}","issue_comment_url":"https://api.github.com/repos/opencomputeproject/SAI/issues/comments{/number}","contents_url":"https://api.github.com/repos/opencomputeproject/SAI/contents/{+path}","compare_url":"https://api.github.com/repos/opencomputeproject/SAI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opencomputeproject/SAI/merges","archive_url":"https://api.github.com/repos/opencomputeproject/SAI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opencomputeproject/SAI/downloads","issues_url":"https://api.github.com/repos/opencomputeproject/SAI/issues{/number}","pulls_url":"https://api.github.com/repos/opencomputeproject/SAI/pulls{/number}","milestones_url":"https://api.github.com/repos/opencomputeproject/SAI/milestones{/number}","notifications_url":"https://api.github.com/repos/opencomputeproject/SAI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opencomputeproject/SAI/labels{/name}","releases_url":"https://api.github.com/repos/opencomputeproject/SAI/releases{/id}","deployments_url":"https://api.github.com/repos/opencomputeproject/SAI/deployments","created_at":"2015-09-25T16:19:31Z","updated_at":"2016-11-14T16:13:16Z","pushed_at":"2016-11-17T00:14:16Z","git_url":"git://github.com/opencomputeproject/SAI.git","ssh_url":"git@github.com:opencomputeproject/SAI.git","clone_url":"https://github.com/opencomputeproject/SAI.git","svn_url":"https://github.com/opencomputeproject/SAI","homepage":null,"size":71346,"stargazers_count":53,"watchers_count":53,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":66,"mirror_url":null,"open_issues_count":47,"forks":66,"open_issues":47,"watchers":53,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opencomputeproject/SAI/pulls/299"},"html":{"href":"https://github.com/opencomputeproject/SAI/pull/299"},"issue":{"href":"https://api.github.com/repos/opencomputeproject/SAI/issues/299"},"comments":{"href":"https://api.github.com/repos/opencomputeproject/SAI/issues/299/comments"},"review_comments":{"href":"https://api.github.com/repos/opencomputeproject/SAI/pulls/299/comments"},"review_comment":{"href":"https://api.github.com/repos/opencomputeproject/SAI/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opencomputeproject/SAI/pulls/299/commits"},"statuses":{"href":"https://api.github.com/repos/opencomputeproject/SAI/statuses/d1316f49f53b870cb2fe6f94fd049c8c29c48b68"}}}}
{"actor":{"display_login":"taoyl-ms"}}