summaryrefslogtreecommitdiffstats
path: root/ipv6rs.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2013-07-02 13:45:27 +0000
committerRoy Marples <roy@marples.name>2013-07-02 13:45:27 +0000
commitee70f4ab00ebe69c32e4af0c6d1dbfa20022f10f (patch)
treeefaeb0063af96ac4dc91dc9456a94efc7a233d38 /ipv6rs.c
parent302025a6b91f7643b0e56f05676ef9ab25180350 (diff)
downloaddhcpcd-ee70f4ab00ebe69c32e4af0c6d1dbfa20022f10f.tar.xz
Only start DHCPv6 if the RA is new or has changed.
Diffstat (limited to 'ipv6rs.c')
-rw-r--r--ipv6rs.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/ipv6rs.c b/ipv6rs.c
index 5969f627..9601370b 100644
--- a/ipv6rs.c
+++ b/ipv6rs.c
@@ -605,8 +605,7 @@ ipv6rs_handledata(__unused void *arg)
/* We don't want to spam the log with the fact we got an RA every
* 30 seconds or so, so only spam the log if it's different. */
- if (options & DHCPCD_DEBUG || rap == NULL ||
- (rap->data_len != len ||
+ if (rap == NULL || (rap->data_len != len ||
memcmp(rap->data, (unsigned char *)icp, rap->data_len) != 0))
{
if (rap) {
@@ -617,10 +616,11 @@ ipv6rs_handledata(__unused void *arg)
rap->nslen = 0;
}
new_data = 1;
- syslog(LOG_INFO, "%s: Router Advertisement from %s",
- ifp->name, sfrom);
} else
new_data = 0;
+ if (new_data || ifp->options->options & DHCPCD_DEBUG)
+ syslog(LOG_INFO, "%s: Router Advertisement from %s",
+ ifp->name, sfrom);
if (rap == NULL) {
rap = calloc(1, sizeof(*rap));
@@ -935,10 +935,12 @@ ipv6rs_handledata(__unused void *arg)
handle_flag:
if (rap->flags & ND_RA_FLAG_MANAGED) {
- if (rap->lifetime && dhcp6_start(ifp, DH6S_INIT) == -1)
+ if (rap->lifetime && new_data &&
+ dhcp6_start(ifp, DH6S_INIT) == -1)
syslog(LOG_ERR, "dhcp6_start: %s: %m", ifp->name);
} else if (rap->flags & ND_RA_FLAG_OTHER) {
- if (rap->lifetime && dhcp6_start(ifp, DH6S_INFORM) == -1)
+ if (rap->lifetime && new_data &&
+ dhcp6_start(ifp, DH6S_INFORM) == -1)
syslog(LOG_ERR, "dhcp6_start: %s: %m", ifp->name);
} else {
if (rap->lifetime && new_data)