mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-08 22:06:10 +02:00
rest_router: avoid assertion when ip_text is 0
Signed-off-by: Wataru ISHIDA <ishida.wataru@lab.ntt.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
667e41cccb
commit
d5c4d774bc
@ -1831,6 +1831,8 @@ def ipv4_int_to_text(ip_int):
|
||||
|
||||
|
||||
def ipv4_text_to_int(ip_text):
|
||||
if ip_text == 0:
|
||||
return ip_text
|
||||
assert isinstance(ip_text, str)
|
||||
return struct.unpack('!I', addrconv.ipv4.text_to_bin(ip_text))[0]
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user