]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
dhcpcd CAN work on IEEE FireWire interfaces.
authorRoy Marples <roy@marples.name>
Mon, 23 Mar 2009 10:09:10 +0000 (10:09 +0000)
committerRoy Marples <roy@marples.name>
Mon, 23 Mar 2009 10:09:10 +0000 (10:09 +0000)
However, BPF does not appear to operate on these, so we report the error
and continue.
When BPF supports FireWire for DHCP, dhcpcd will magically start to work.

dhcpcd-run-hooks.8.in
dhcpcd.c
if-bsd.c

index 89525697b46d97fea37eafec275229f74abed4ed..ef95590f5a761e7c5f2a4fa6e1dd687b28fc90a9 100644 (file)
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd March 19, 2009
+.Dd March 23, 2009
 .Dt DHCPCD.SH 8 SMM
 .Os
 .Sh NAME
@@ -104,9 +104,12 @@ This should be treated as EXPIRE.
 dhcpcd lost the carrier.
 The cable may have been unplugged or association to the wireless point lost.
 .It Dv FAIL
-dhcpcd failed to contact any DHCP servers or use an old lease.
+dhcpcd failed to operate on the interface.
+This normally happens when dhcpcd does not support the raw interface, which
+means it cannot work as a DHCP or ZeroConf client.
+Static configuration is still allowed.
 .It Dv STOP
-dhcpcd will stop running on the interface.
+dhcpcd stopped running on the interface.
 .It Dv TEST
 dhcpcd received an OFFER from a DHCP server but will not configure the
 interface.
index e19dfbd83a30d54d274e10827bf7aac6b9ae8a00..1fe5cdbf9f64abfcbd68288c31d97cee6ab9327c 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -310,8 +310,18 @@ send_message(struct interface *iface, int type,
                len = make_udp_packet(&udp, (uint8_t *)dhcp, len, from, to);
                r = send_raw_packet(iface, ETHERTYPE_IP, udp, len);
                free(udp);
-               if (r == -1)
+               /* If we failed to send a raw packet this normally means
+                * we don't have the ability to work beneath the IP layer
+                * for this interface.
+                * As such we remove it from consideration without actually
+                * stopping the interface. */
+               if (r == -1) {
                        syslog(LOG_ERR, "%s: send_raw_packet: %m", iface->name);
+                       drop_config(iface, "FAIL");
+                       close_sockets(iface);
+                       delete_timeout(NULL, iface);
+                       callback = NULL;
+               }
        }
        free(dhcp);
        /* Even if we fail to send a packet we should continue as we are
index 0db8b30430cf5d6bf23a30ea8a5b4f6c4718ee89..2b8b93758649f96a318d71aa50731e81e3c78c0e 100644 (file)
--- a/if-bsd.c
+++ b/if-bsd.c
@@ -408,7 +408,10 @@ discover_link(struct interface **ifs, int argc, char * const *argv,
        case IFT_ETHER:
                ifp->family = ARPHRD_ETHER;
                ifp->hwlen = sdl->sdl_alen;
-               memcpy(ifp->hwaddr, LLADDR(sdl), sdl->sdl_alen);
+               break;
+       case IFT_IEEE1394:
+               ifp->family = ARPHRD_IEEE1394;
+               ifp->hwlen = sdl->sdl_alen;
                break;
        case IFT_LOOP:
                /* We don't allow loopback unless requested */
@@ -418,6 +421,8 @@ discover_link(struct interface **ifs, int argc, char * const *argv,
                }
                break;
        }
+       if (ifp && ifp->hwlen)
+               memcpy(ifp->hwaddr, LLADDR(sdl), ifp->hwlen);
        if (ifl)
                ifl->next = ifp;
        else