From: Roy Marples Date: Wed, 22 Jan 2014 10:39:30 +0000 (+0000) Subject: RFC 3927 2.5 only metions the senders IP, not the targets. X-Git-Tag: v6.3.0~93 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e882d2b76b0d180f46dc78566a52837d22247dae;p=thirdparty%2Fdhcpcd.git RFC 3927 2.5 only metions the senders IP, not the targets. Clarify other comments and fix formatting a little. --- diff --git a/arp.c b/arp.c index 46230905..ca49e6a7 100644 --- a/arp.c +++ b/arp.c @@ -1,6 +1,6 @@ /* * dhcpcd - DHCP client daemon - * Copyright (c) 2006-2013 Roy Marples + * Copyright (c) 2006-2014 Roy Marples * All rights reserved * Redistribution and use in source and binary forms, with or without @@ -94,9 +94,9 @@ arp_failure(struct interface *ifp) /* If we failed without a magic cookie then we need to try * and defend our IPv4LL address. */ if ((state->offer != NULL && - state->offer->cookie != htonl(MAGIC_COOKIE)) || + state->offer->cookie != htonl(MAGIC_COOKIE)) || (state->new != NULL && - state->new->cookie != htonl(MAGIC_COOKIE))) + state->new->cookie != htonl(MAGIC_COOKIE))) { ipv4ll_handle_failure(ifp); return; @@ -167,8 +167,8 @@ arp_packet(void *arg) if (state->arping_index && state->arping_index <= opts->arping_len && (reply_s == opts->arping[state->arping_index - 1] || - (reply_s == 0 && - reply_t == opts->arping[state->arping_index - 1]))) + (reply_s == 0 && + reply_t == opts->arping[state->arping_index - 1]))) { ina.s_addr = reply_s; hwaddr = hwaddr_ntoa((unsigned char *)hw_s, @@ -185,16 +185,16 @@ arp_packet(void *arg) return; } - /* Check for conflict */ + /* RFC 2131 3.1.5, Client-server interaction + * RFC 3927 2.2.1, Probe Conflict Detection */ if (state->offer && (reply_s == state->offer->yiaddr || - (reply_s == 0 && reply_t == state->offer->yiaddr))) + (reply_s == 0 && reply_t == state->offer->yiaddr))) state->fail.s_addr = state->offer->yiaddr; - /* Handle IPv4LL conflicts */ + /* RFC 3927 2.5, Conflict Defense */ if (IN_LINKLOCAL(htonl(state->addr.s_addr)) && - (reply_s == state->addr.s_addr || - (reply_s == 0 && reply_t == state->addr.s_addr))) + reply_s == state->addr.s_addr) state->fail.s_addr = state->addr.s_addr; if (state->fail.s_addr) {