Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 371212 Details for
Bug 502378
mail-filter/pypolicyd-spf with dev-python/pyspf-2.0.8 - policyd-spf: AttributeError: 'module' object has no attribute 'addr2bin'
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
adds missing addr2bin to pypolicyd-spf. This is not real solution. IPv6 will still be broken.
policyd-spf-fix.diff (text/plain), 1.38 KB, created by
Christian Zuckschwerdt
on 2014-02-25 10:47:07 UTC
(
hide
)
Description:
adds missing addr2bin to pypolicyd-spf. This is not real solution. IPv6 will still be broken.
Filename:
MIME Type:
Creator:
Christian Zuckschwerdt
Created:
2014-02-25 10:47:07 UTC
Size:
1.38 KB
patch
obsolete
>--- /usr/lib/python-exec/python2.7/policyd-spf.orig 2014-02-25 11:43:15.000000000 +0100 >+++ /usr/lib/python-exec/python2.7/policyd-spf 2014-02-25 11:42:45.213324487 +0100 >@@ -43,6 +43,11 @@ > syslog.openlog(os.path.basename(sys.argv[0]), syslog.LOG_PID, syslog.LOG_MAIL) > policydspfsupp._setExceptHook() > >+from struct import unpack as struct_unpack >+from socket import inet_ntoa, inet_aton >+def addr2bin(addr): >+ return struct_unpack('!l', inet_aton(addr))[0] >+ > ############################################# > def _cidrmatch(connectip, ipaddrs, n): > """Match connect IP against a list of other IP addresses. From pyspf.""" >@@ -56,7 +61,7 @@ > bin = spf.bin2long6 > else: > MASK = 0xFFFFFFFF >- bin = spf.addr2bin >+ bin = addr2bin > c = ~(MASK >> n) & MASK & bin(connectip) > for ip in [bin(ip) for ip in ipaddrs]: > if c == ~(MASK >> n) & MASK & ip: return True
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 502378
: 371212