diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /net-misc/dhcpcd/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'net-misc/dhcpcd/files')
-rw-r--r-- | net-misc/dhcpcd/files/dhcpcd-6.11.1-arp-conflict.patch | 61 | ||||
-rw-r--r-- | net-misc/dhcpcd/files/dhcpcd.initd | 17 | ||||
-rw-r--r-- | net-misc/dhcpcd/files/dhcpcd.service | 12 |
3 files changed, 90 insertions, 0 deletions
diff --git a/net-misc/dhcpcd/files/dhcpcd-6.11.1-arp-conflict.patch b/net-misc/dhcpcd/files/dhcpcd-6.11.1-arp-conflict.patch new file mode 100644 index 000000000000..ae7da3fbd8a9 --- /dev/null +++ b/net-misc/dhcpcd/files/dhcpcd-6.11.1-arp-conflict.patch @@ -0,0 +1,61 @@ +Index: ipv4ll.c +================================================================== +--- a/ipv4ll.c ++++ b/ipv4ll.c +@@ -242,31 +242,33 @@ + assert(astate != NULL); + assert(astate->iface != NULL); + ifp = astate->iface; + state = IPV4LL_STATE(ifp); + assert(state != NULL); +- assert(state->addr != NULL); + + fail = 0; + /* RFC 3927 2.2.1, Probe Conflict Detection */ + if (amsg == NULL || + (amsg->sip.s_addr == astate->addr.s_addr || + (amsg->sip.s_addr == 0 && amsg->tip.s_addr == astate->addr.s_addr))) + fail = astate->addr.s_addr; + + /* RFC 3927 2.5, Conflict Defense */ +- if (IN_LINKLOCAL(ntohl(state->addr->addr.s_addr)) && ++ if (state->addr != NULL && ++ IN_LINKLOCAL(ntohl(state->addr->addr.s_addr)) && + amsg && amsg->sip.s_addr == state->addr->addr.s_addr) + fail = state->addr->addr.s_addr; + + if (fail == 0) + return; + + astate->failed.s_addr = fail; + arp_report_conflicted(astate, amsg); + +- if (astate->failed.s_addr == state->addr->addr.s_addr) { ++ if (state->addr != NULL && ++ astate->failed.s_addr == state->addr->addr.s_addr) ++ { + struct timespec now, defend; + + /* RFC 3927 Section 2.5 says a defence should + * broadcast an ARP announcement. + * Because the kernel will also unicast a reply to the +@@ -378,16 +380,18 @@ + astate->conflicted_cb = ipv4ll_conflicted; + astate->free_cb = ipv4ll_arpfree; + + /* Find an existing IPv4LL address and ensure we can work with it. */ + ia = ipv4_iffindlladdr(ifp); ++ + #ifdef IN_IFF_TENTATIVE + if (ia != NULL && ia->addr_flags & IN_IFF_DUPLICATED) { + ipv4_deladdr(ia, 0); + ia = NULL; + } + #endif ++ + if (ia != NULL) { + astate->addr = ia->addr; + #ifdef IN_IFF_TENTATIVE + if (ia->addr_flags & (IN_IFF_TENTATIVE | IN_IFF_DETACHED)) { + logger(ifp->ctx, LOG_INFO, + diff --git a/net-misc/dhcpcd/files/dhcpcd.initd b/net-misc/dhcpcd/files/dhcpcd.initd new file mode 100644 index 000000000000..d3f4d76b4c90 --- /dev/null +++ b/net-misc/dhcpcd/files/dhcpcd.initd @@ -0,0 +1,17 @@ +#!/sbin/openrc-run +# Copyright 2007-2008 Roy Marples <roy@marples.name> +# All rights reserved. Released under the 2-clause BSD license. + +command=/sbin/dhcpcd +pidfile=/var/run/dhcpcd.pid +command_args=-q +name="DHCP Client Daemon" + +depend() +{ + provide net + need localmount + use logger network + after bootmisc modules + before dns +} diff --git a/net-misc/dhcpcd/files/dhcpcd.service b/net-misc/dhcpcd/files/dhcpcd.service new file mode 100644 index 000000000000..8430214d59b4 --- /dev/null +++ b/net-misc/dhcpcd/files/dhcpcd.service @@ -0,0 +1,12 @@ +[Unit] +Description=Lightweight DHCP client daemon +Wants=network.target +Before=network.target network-online.target + +[Service] +Type=forking +ExecStart=/sbin/dhcpcd -q +PIDFile=/run/dhcpcd.pid + +[Install] +WantedBy=multi-user.target |