Patchwork [slirp] Accept packets with TTL=1

login
register
mail settings
Submitter Hervé Poussineau
Date Sept. 13, 2010, 9:01 p.m.
Message ID <1284411690-3557-1-git-send-email-hpoussin@reactos.org>
Download mbox | patch
Permalink /patch/64655/
State New
Headers show

Comments

Hervé Poussineau - Sept. 13, 2010, 9:01 p.m.
Packets with TTL=1 may be directed to local network (DHCP/DNS servers for example), so don't discard them
This is required by old versions of NetBSD which send DHCP DISCOVER packets with TTL=1

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 slirp/ip_input.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Edgar Iglesias - Sept. 14, 2010, 3:47 p.m.
On Mon, Sep 13, 2010 at 11:01:30PM +0200, Hervé Poussineau wrote:
> Packets with TTL=1 may be directed to local network (DHCP/DNS servers for example), so don't discard them
> This is required by old versions of NetBSD which send DHCP DISCOVER packets with TTL=1


Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>


> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
> ---
>  slirp/ip_input.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/slirp/ip_input.c b/slirp/ip_input.c
> index 0fe0ff7..768ab0c 100644
> --- a/slirp/ip_input.c
> +++ b/slirp/ip_input.c
> @@ -144,7 +144,7 @@ ip_input(struct mbuf *m)
>  	   m_adj(m, ip->ip_len - m->m_len);
>  
>  	/* check ip_ttl for a correct ICMP reply */
> -	if(ip->ip_ttl==0 || ip->ip_ttl==1) {
> +	if(ip->ip_ttl==0) {
>  	  icmp_error(m, ICMP_TIMXCEED,ICMP_TIMXCEED_INTRANS, 0,"ttl");
>  	  goto bad;
>  	}
> -- 
> 1.7.1.GIT
> 
>
Edgar Iglesias - Sept. 17, 2010, 10:52 a.m.
On Mon, Sep 13, 2010 at 11:01:30PM +0200, Hervé Poussineau wrote:
> Packets with TTL=1 may be directed to local network (DHCP/DNS servers for example), so don't discard them
> This is required by old versions of NetBSD which send DHCP DISCOVER packets with TTL=1
> 
> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>

Applied, thanks.


> ---
>  slirp/ip_input.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/slirp/ip_input.c b/slirp/ip_input.c
> index 0fe0ff7..768ab0c 100644
> --- a/slirp/ip_input.c
> +++ b/slirp/ip_input.c
> @@ -144,7 +144,7 @@ ip_input(struct mbuf *m)
>  	   m_adj(m, ip->ip_len - m->m_len);
>  
>  	/* check ip_ttl for a correct ICMP reply */
> -	if(ip->ip_ttl==0 || ip->ip_ttl==1) {
> +	if(ip->ip_ttl==0) {
>  	  icmp_error(m, ICMP_TIMXCEED,ICMP_TIMXCEED_INTRANS, 0,"ttl");
>  	  goto bad;
>  	}
> -- 
> 1.7.1.GIT
> 
>

Patch

diff --git a/slirp/ip_input.c b/slirp/ip_input.c
index 0fe0ff7..768ab0c 100644
--- a/slirp/ip_input.c
+++ b/slirp/ip_input.c
@@ -144,7 +144,7 @@  ip_input(struct mbuf *m)
 	   m_adj(m, ip->ip_len - m->m_len);
 
 	/* check ip_ttl for a correct ICMP reply */
-	if(ip->ip_ttl==0 || ip->ip_ttl==1) {
+	if(ip->ip_ttl==0) {
 	  icmp_error(m, ICMP_TIMXCEED,ICMP_TIMXCEED_INTRANS, 0,"ttl");
 	  goto bad;
 	}