mirror of
https://github.com/rtr7/router7.git
synced 2024-05-06 15:54:52 +00:00
dhcp6: inspect server advertisment IAPD and report error, if any
The fiber7 DHCPv6 servers (sometimes?) use this field for reporting errors.
This commit is contained in:
@ -266,6 +266,14 @@ func (c *Client) ObtainOrRenew() bool {
|
||||
}
|
||||
|
||||
c.advertise = advertise
|
||||
|
||||
if iapd := advertise.Options.OneIAPD(); iapd != nil {
|
||||
if status := iapd.Options.Status(); status != nil && status.StatusCode != iana.StatusSuccess {
|
||||
c.err = fmt.Errorf("IAPD error: %v (%v)", status.StatusCode, status.StatusMessage)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
_, reply, err := c.request(advertise)
|
||||
if err != nil {
|
||||
c.err = err
|
||||
|
Reference in New Issue
Block a user