ip addr parser can assert and fail for some IPv6 addresses

Bug #1508695 reported by Mike Pontillo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
LaMont Jones

Bug Description

Example:

inet6 2601:282:8100:3500:216:3eff:fe7b:2746/64 scope global dynamic

The parser currently expects everything after an IPv6 address to be in <key> <value> pair format.

Unfortunately, sometimes values which do not match this format can be found in this line. (for example, the word "dynamic" above, with no corresponding value.

For IPv4, the interface name (and alias) is often the last thing on this line, so there is already a special case for this.

Without knowing how "ip addr" outputs this line in all cases, it seems as though the possible fixes are:

 - Pass this line though to the data structure without attempting to parse it
 - Always truncate "remainder" values if the line is in the format <key> <value> <something-else>
 - Add special cases for specific keywords we have seen, such as "dynamic" (if we do this, we should inspect the source to ensure good coverage. but this solution has the disadvantage of requiring maintenance if the output changes in the future.)

Related branches

Revision history for this message
LaMont Jones (lamont) wrote :

looking at the ip addr output spec, it would seem that other than "scope $SCOPE", everything on that line is of the form "flag".

Changed in maas:
assignee: nobody → LaMont Jones (lamont)
Changed in maas:
status: Triaged → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.