Using Python 2.7 which randomizes hash key order, ip.__load_protos() may
implicitly __import__() the ip6 module before some of the other protocols are
populated into ip.IP._protosw. If we do IP6._protosw.update(ip.IP._protosw) as
is done currently, then IP6 would only get a subset of protocols that happen to
be defined so far, and due to hash key randomization, this could very well be
the empty set.
Moreover, ip6 could not import ip before class IP6 is defined. The workaround
here is to do this after class IP6, forcing the sharing of dictionary rather
than making a copy.
import ip
IP6._protosw = ip.IP._protosw
Attaching a patch which I verified to work.
liulk
Original issue reported on code.google.com by liulk@google.com on 28 Nov 2012 at 5:43
Original issue reported on code.google.com by
liulk@google.com
on 28 Nov 2012 at 5:43Attachments: