From a76b87305aa2a3fa83fddbb55ede279fe6f66c54 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 30 Jan 2015 08:54:40 -0600 Subject: [PATCH] Networking: Should fix a few compile errors/warnings reported by Travis --- net/udp/udp_callback.c | 3 ++- net/udp/udp_sendto.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/net/udp/udp_callback.c b/net/udp/udp_callback.c index ab06e25220b..debc76289e1 100644 --- a/net/udp/udp_callback.c +++ b/net/udp/udp_callback.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/udp/udp_callback.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -45,6 +45,7 @@ #include #include +#include #include #include "devif/devif.h" diff --git a/net/udp/udp_sendto.c b/net/udp/udp_sendto.c index c3a53cf8bc0..8732e4bbe56 100644 --- a/net/udp/udp_sendto.c +++ b/net/udp/udp_sendto.c @@ -378,14 +378,15 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf, socklen_t tolen) { FAR struct udp_conn_s *conn; - FAR const struct sockaddr_in *into; struct sendto_s state; net_lock_t save; int ret; +#ifdef CONFIG_NET_ARP_SEND + FAR const struct sockaddr_in *into; + /* Make sure that the IP address mapping is in the ARP table */ -#ifdef CONFIG_NET_ARP_SEND into = (FAR const struct sockaddr_in *)to; ret = arp_send(into->sin_addr.s_addr); if (ret < 0)