If the number of AS numbers in the AS_PATH attribute is less than the
number of AS numbers in the AS4_PATH attribute, then the AS4_PATH
attribute SHALL be ignored, and the AS_PATH attribute SHALL be taken
as the AS path information.
If the number of AS numbers in the AS_PATH attribute is larger than
or equal to the number of AS numbers in the AS4_PATH attribute, then
the AS path information SHALL be constructed by taking as many AS
numbers and path segments as necessary from the leading part of the
AS_PATH attribute, and then prepending them to the AS4_PATH attribute
so that the AS path information has an identical number of AS numbers
as the AS_PATH attribute. Note that a valid AS_CONFED_SEQUENCE or
AS_CONFED_SET path segment SHALL be prepended if it is either the
leading path segment or adjacent to a path segment that is prepended.
5. Handling BGP Communities
As specified in [RFC1997], when the high-order two-octets of the
community attribute is neither 0x0000 nor 0xffff, these two octets
encode the Autonomous System number. Quite clearly this would not
work for BGP speakers that use 4-octets Autonomous System numbers.
Such BGP speakers should use the Four-octet AS Specific Extended
Communities [AS-EXT-COM] instead.