projects
/
project
/
relayd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
route: Fix compile warning with glibc
[project/relayd.git]
/
main.c
diff --git
a/main.c
b/main.c
index edd10b8b064f26fc0d6e175de09f5617d24d5cac..b3c13f7f7a49f3693df2efa1adfcae8dbaba56cf 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-165,7
+165,7
@@
static void send_arp_request(struct relayd_interface *rif, const uint8_t *ipaddr
fill_arp_packet(&pkt, rif, rif->src_ip, ipaddr);
pkt.arp.arp_op = htons(ARPOP_REQUEST);
fill_arp_packet(&pkt, rif, rif->src_ip, ipaddr);
pkt.arp.arp_op = htons(ARPOP_REQUEST);
- memcpy(pkt.arp.arp_spa, rif->src_ip,
ETH_ALEN
);
+ memcpy(pkt.arp.arp_spa, rif->src_ip,
sizeof(pkt.arp.arp_spa)
);
memset(pkt.arp.arp_tha, 0, ETH_ALEN);
memset(pkt.eth.ether_dhost, 0xff, ETH_ALEN);
memset(pkt.arp.arp_tha, 0, ETH_ALEN);
memset(pkt.eth.ether_dhost, 0xff, ETH_ALEN);
@@
-653,6
+653,11
@@
static struct relayd_interface *alloc_interface(const char *ifname, bool managed
if (strlen(ifname) >= IFNAMSIZ)
return NULL;
if (strlen(ifname) >= IFNAMSIZ)
return NULL;
+ list_for_each_entry(rif, &interfaces, list) {
+ if (!strncmp(rif->ifname, ifname, IFNAMSIZ))
+ return rif;
+ }
+
rif = calloc(1, sizeof(*rif));
if (!rif)
return NULL;
rif = calloc(1, sizeof(*rif));
if (!rif)
return NULL;
@@
-703,7
+708,7
@@
int main(int argc, char **argv)
struct relayd_interface *rif = NULL;
struct in_addr addr, addr2;
bool local_addr_valid = false;
struct relayd_interface *rif = NULL;
struct in_addr addr, addr2;
bool local_addr_valid = false;
- bool managed;
+ bool managed
= false
;
int ifnum = 0;
char *s, *s2;
int mask;
int ifnum = 0;
char *s, *s2;
int mask;