diff options
-rw-r--r-- | gre.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -282,7 +282,7 @@ static int gre_ipv4(uint8_t **bufp, int *np) } // check source IPv4 address const struct sockaddr_in *remote_in = (const struct sockaddr_in *)&remote; - if (*(uint32_t *)(buf + 12) != remote_in->sin_addr.s_addr) + if (!remote_any && *(uint32_t *)(buf + 12) != remote_in->sin_addr.s_addr) { printf("Wrong IPv4 source\n"); return -1; @@ -328,7 +328,7 @@ static int gre_any(const uint8_t *buf, int n) return -1; } uint16_t protocol = ntohs(*(uint16_t *)(buf + 2)); - if (type == IFF_TUN) + if (type == IFF_TUN || remote_any) { switch (protocol) { case ETHERTYPE_IP: |