Title: lib.net_pack stores wrong bit length · Issue #71 · python-postgres/fe · GitHub
Open Graph Title: lib.net_pack stores wrong bit length · Issue #71 · python-postgres/fe
X Title: lib.net_pack stores wrong bit length · Issue #71 · python-postgres/fe
Description: when packing an ip_address() for io, the bits value is wrongly stored as a /0 instead of /32 or /128 the following will fix this: --- /usr/lib/python3.4/site-packages/postgresql/types/io/lib.py.orig 2014-06-02 12:42:50.783337348 +0000 ++...
Open Graph Description: when packing an ip_address() for io, the bits value is wrongly stored as a /0 instead of /32 or /128 the following will fix this: --- /usr/lib/python3.4/site-packages/postgresql/types/io/lib.py.ori...
X Description: when packing an ip_address() for io, the bits value is wrongly stored as a /0 instead of /32 or /128 the following will fix this: --- /usr/lib/python3.4/site-packages/postgresql/types/io/lib.py.ori...
Opengraph URL: https://github.com/python-postgres/fe/issues/71
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"lib.net_pack stores wrong bit length","articleBody":"when packing an ip_address() for io, the bits value is wrongly stored as a /0 instead of /32 or /128\n\nthe following will fix this:\n\n```\n--- /usr/lib/python3.4/site-packages/postgresql/types/io/lib.py.orig 2014-06-02 12:42:50.783337348 +0000\n+++ /usr/lib/python3.4/site-packages/postgresql/types/io/lib.py 2014-06-02 12:56:30.460003975 +0000\n@@ -283,7 +283,9 @@\n Pack Postgres' inet/cidr data structure.\n \"\"\"\n family, mask, data = triple\n- return bytes((fmap[family], mask or 0, 0 if mask is None else 1, len(data))) + data\n+ mflag = mask and 1 or 0\n+ mask = mask and mask or {4:32, 6:128}[family]\n+ return bytes((fmap[family], mask, mflag, len(data))) + data\n\n def net_unpack(data,\n # Map IP version number to PGSQL src/include/utils/inet.h.\n```\n\nthe original code stores \"1.2.3.4\" as \"1.2.3.4/0\" instead of \"1.2.3.4/32\". the above fix will store the correct bits value\n","author":{"url":"https://github.com/FirefighterBlu3","@type":"Person","name":"FirefighterBlu3"},"datePublished":"2014-06-02T12:49:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/71/fe/issues/71"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e091570c-03cb-4f7c-51d7-de451695452b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B672:1E09:2BDD8D6:38230C7:697DAC6A |
| html-safe-nonce | d56544e4b9e1a404e628df104e3cdc45a490c733ff38b7b4807729b0e882b55e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjcyOjFFMDk6MkJERDhENjozODIzMEM3OjY5N0RBQzZBIiwidmlzaXRvcl9pZCI6Ijg1NTk3NzU1Mzk1NzU3NjIwMjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 53390ed4b28b22ab2340ed72d39b9c2b7a24ac5549a54f8b8b85f48110480537 |
| hovercard-subject-tag | issue:34769321 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-postgres/fe/71/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a2a59f40cc4d0d678c48f1433eb1a756e2fda0f135aadfec97e7e901734d951d/python-postgres/fe/issues/71 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a2a59f40cc4d0d678c48f1433eb1a756e2fda0f135aadfec97e7e901734d951d/python-postgres/fe/issues/71 |
| og:image:alt | when packing an ip_address() for io, the bits value is wrongly stored as a /0 instead of /32 or /128 the following will fix this: --- /usr/lib/python3.4/site-packages/postgresql/types/io/lib.py.ori... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | FirefighterBlu3 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-postgres/fe git https://github.com/python-postgres/fe.git |
| octolytics-dimension-user_id | 2132548 |
| octolytics-dimension-user_login | python-postgres |
| octolytics-dimension-repository_id | 100230 |
| octolytics-dimension-repository_nwo | python-postgres/fe |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 100230 |
| octolytics-dimension-repository_network_root_nwo | python-postgres/fe |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width