>
>
> First, the patch seems to be wrapped unexpectedly when line exceeds
> 80(?) characters or so.
> Please confirm you mailer settings.
> https://git-scm.com/docs/git-format-patch#_mua_specific_hints
>
>
I used Gmail web app, so I understand I have to change. I'll experiment a
bit on this before resubmitting the patch. Just for my information, what
mail client do you use? Do you know if Outlook messages (in raw text mode)
are OK with line wrapping?
> +import binascii
>
> binascii is imported, but does not seem to be used.
>
>
Exact. Fixed in the next version.
> > +
> > + if len(buf) > length:
> > + parse_opt = options.parser(buf[length:])
> > + length += parse_opt.options_len
> > +
> > + if msg_type == DHCPV6_RELAY_FORW or msg_type ==
> DHCPV6_RELAY_REPL:
> > + return (cls(msg_type, parse_opt, 0, hop_count,
> > + addrconv.ipv6.bin_to_text(link_address),
> > + addrconv.ipv6.bin_to_text(peer_address)),
> > + None, buf[length:])
> > + else:
> > + return (cls(msg_type, parse_opt, transaction_id),
> > + None, buf[length:])
>
> There seems to be the case that the local variables 'parse_opt',
> 'hop_count',
> 'link_address', 'peer_address' and 'transaction_id' might be referenced
> before assignment.
> e.g.) When NOT len(buf) > length, 'parse_opt' will not be initialized.
>
> Is it the rare case?
> > +
> > + @classmethod
> > + def parser(cls, buf):
> > + try:
> > + return cls._parser(buf)
> > + except:
> > + return None, None, buf
>
> This except statement is too broad for me.
> How about 'except struct.error'?
>
>
I reused this pattern from dhcp.py, but I confess I did not noticed it
until your remarked it. I will propose a solution in the next version that
passed my tests. If this solution is OK I will propose the same solution
for dhcp.py.
> > +
> > + def serialize(self, payload=None, prev=None):
> > + seri_opt = self.options.serialize()
> > + if (self.msg_type == DHCPV6_RELAY_FORW or
> > + self.msg_type == DHCPV6_RELAY_REPL):
> > + pack_str = '%s%ds' % (self._DHCPV6_RELAY_PACK_STR,
> > + self.options.options_len)
> > + str = struct.pack(pack_str, self.hop_count,
>
> The value name 'str' seems to shadow built-in type.
> How about using 'buf' for it?
>
>
Exact. Fixed in the next version.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel