Mercurial > hg > dhcpcd
changeset 2517:1d4beca0771f draft
Don't set local-link addresses as no prefix route.
Disable autoconf if we're owning IPv6.
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Wed, 04 Jun 2014 23:34:39 +0000 |
| parents | 88bbfcbd9ec4 |
| children | 28182250f3a0 |
| files | if-linux.c |
| diffstat | 1 files changed, 14 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/if-linux.c Wed Jun 04 20:27:40 2014 +0000 +++ b/if-linux.c Wed Jun 04 23:34:39 2014 +0000 @@ -1088,8 +1088,10 @@ } #ifdef IFA_F_NOPREFIXROUTE - flags = IFA_F_NOPREFIXROUTE; - add_attr_32(&nlm.hdr, sizeof(nlm), IFA_FLAGS, flags); + if (!IN6_IS_ADDR_LINKLOCAL(&ap->addr)) { + flags = IFA_F_NOPREFIXROUTE; + add_attr_32(&nlm.hdr, sizeof(nlm), IFA_FLAGS, flags); + } #endif if (send_netlink(ap->iface->ctx, &nlm.hdr) == -1) @@ -1254,9 +1256,16 @@ snprintf(path, sizeof(path), "%s/%s/autoconf", prefix, ifname); ra = check_proc_int(path); if (ra != 1) { - syslog(LOG_WARNING, "%s: IPv6 kernel autoconf disabled", - ifname); - return -1; + if (!own) { + syslog(LOG_WARNING, + "%s: IPv6 kernel autoconf disabled", ifname); + return -1; + } + } else if (ra != -1 && own) { + if (write_path(path, "0") == -1) { + syslog(LOG_ERR, "write_path: %s: %m", path); + return -1; + } } snprintf(path, sizeof(path), "%s/%s/accept_ra", prefix, ifname);
