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: github.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:0b33dd6a-6b8c-d0ec-9c04-ddfe4db31c73 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 88C2:3A72BD:68888C:959B75:697A1CC6 |
| html-safe-nonce | db99e836d35278372d37e2a31e866061c572d3fee5aaf356b981ed9086a0e832 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OEMyOjNBNzJCRDo2ODg4OEM6OTU5Qjc1OjY5N0ExQ0M2IiwidmlzaXRvcl9pZCI6IjI0MzIwMzEwNjk5OTAxNjU3MDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f221c996758d7fdb51d56aedafc69a1197fae710db869e83328857f400b1d14c |
| 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 | 24021c77440f544078f9cbe80d78a2fb16ccff65fca92deda9da3c51d1cdc5fc |
| 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 | 2841ead760bbcdca99003cf970f91348178160c3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width