- if ether['IPv6']['UDP']\
- ['DHCPv6 Relay Forward Message (Relay Agent/Server Message)']:
- print "Relay Agent/Server Message: OK."
- else:
- raise RuntimeError("Relay Agent/Server Message error.")
-
- if ether['IPv6']['UDP']\
- ['DHCPv6 Relay Forward Message (Relay Agent/Server Message)']\
- .linkaddr != proxy_ip:
- raise RuntimeError("Proxy IP address error!")
+ msgtype = _get_dhcpv6_msgtype(ether['IPv6']['UDP']
+ ['DHCPv6 Relay Forward Message (Relay Agent/Server Message)'].msgtype)
+ if msgtype != 'RELAY-FORW':
+ raise RuntimeError("Message type error: {} != RELAY-FORW".format(
+ msgtype))
+ print "Message type: OK."
+
+ linkaddr = ether['IPv6']['UDP']\
+ ['DHCPv6 Relay Forward Message (Relay Agent/Server Message)'].linkaddr
+ if linkaddr != proxy_ip:
+ raise RuntimeError("Proxy IP address error: {} != {}".format(
+ linkaddr, proxy_ip))