Closed Jitoxxx closed 6 years ago
"rd": "?\xfd\x91\x00\x00\xfd\xfa\x00" means that the first short of the RD is 16381.
> unpack('!H',"?\xfd")
(16381,)
Therefore the following code use the string representation of the binary of what looks like AFAIK an invalid RD ( https://en.wikipedia.org/wiki/Route_distinguisher )
def _str (self):
t,c1,c2,c3 = unpack('!HHHH',self.rd)
if t == 0:
rd = '%d:%d' % (c1,(c2 << 16)+c3)
elif t == 1:
rd = '%d.%d.%d.%d:%d' % (c1 >> 8,c1 & 0xFF,c2 >> 8,c2 & 0xFF,c3)
elif t == 2:
rd = '%d:%d' % ((c1 << 16) + c2,c3)
else:
rd = str(self.rd)
return rd
which indeed does not generate some valid JSON.
>>> s = """{"rd": "?\xfd\x91\x00\x00\xfd\xfa\x00"}"""
>>> json.loads(s)
Traceback (most recent call last):
It was changed to be an hex string of the value.
>>> hexstring("?\xfd\x91\x00\x00\xfd\xfa\x00")
'0x3FFD910000FDFA00'
Hello, I have got some settings running on 2 servers, they are both identical apart from one running 4.0.5 and the other one running 4.0.6 of exabgp.
Now the issue I am having is related to my log collector, the files are exactly the same for both versions: The only difference is that version 4.0.5 gets a pprint which is a normal format for tag rd, as followed: "rd": "XXXXX:XXXXX" The 4.0.6 gets a pprint which is as followd : "rd": "?\xfd\x91\x00\x00\xfd\xfa\x00". This stops my exabgp session and I can't log the files.
Script I'm using is as followed:
I'm guessing there ain't anything wrong with the script, since I get the error befor it even goes through it. I'm checking further for errors but my environment is the same in both and is as followed:
I run the following file with exabgp:
This is the error I get for the VPN-RR ( the others work ):
this is what char 994 looks like:
"rd": "?\xfd\x91\x00\x00\xfd\xfa\x00"
and it should be (X=digit 0-9):
"rd": "XXXXX:XXXXX"