Search
SailfishOS Open Build Service
>
Projects
>
home:plfiorini
:
maui:devel
:
armv6l
>
dhcp
> _service:gitpkg:0001-Missing-IPv6-support.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File _service:gitpkg:0001-Missing-IPv6-support.patch of Package dhcp
From 2ec274662126f0d8ea6a71b4b0a5f7ecbc706571 Mon Sep 17 00:00:00 2001 From: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Date: Sun, 3 Aug 2014 08:50:52 +0000 Subject: [PATCH] Missing IPv6 support --- common/discover.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/discover.c b/common/discover.c index 4b40a70..413ea13 100644 --- a/common/discover.c +++ b/common/discover.c @@ -446,7 +446,7 @@ begin_iface_scan(struct iface_conf_list *ifaces) { } #ifdef DHCPv6 - if (local_family == AF_INET6) { + if ((local_family == AF_INET6) && !access("/proc/net/if_inet6", R_OK)) { ifaces->fp6 = fopen("/proc/net/if_inet6", "r"); if (ifaces->fp6 == NULL) { log_error("Error opening '/proc/net/if_inet6' to " @@ -457,6 +457,8 @@ begin_iface_scan(struct iface_conf_list *ifaces) { ifaces->fp = NULL; return 0; } + } else { + ifaces->fp6 = NULL; } #endif @@ -724,7 +726,7 @@ next_iface(struct iface_info *info, int *err, struct iface_conf_list *ifaces) { return 1; } #ifdef DHCPv6 - if (!(*err)) { + if (!(*err) && ifaces->fp6) { if (local_family == AF_INET6) return next_iface6(info, err, ifaces); } @@ -743,7 +745,8 @@ end_iface_scan(struct iface_conf_list *ifaces) { ifaces->sock = -1; #ifdef DHCPv6 if (local_family == AF_INET6) { - fclose(ifaces->fp6); + if (ifaces->fp6) + fclose(ifaces->fp6); ifaces->fp6 = NULL; } #endif -- 1.8.4.5