public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.net>
Cc: Marek Lindner <lindner_marek@yahoo.de>
Subject: Re: [B.A.T.M.A.N.] [PATCH 3/3] batman-adv: send DHCP requests directly to the chosen gw
Date: Tue, 5 Jan 2010 07:43:49 +0100	[thread overview]
Message-ID: <20100105064349.GF9585@lunn.ch> (raw)
In-Reply-To: <1262619976-5632-3-git-send-email-lindner_marek@yahoo.de>

> +bool gw_is_target(struct sk_buff *skb)
> +{
> +	struct ethhdr *ethhdr;
> +	struct iphdr *iphdr;
> +	struct udphdr *udphdr;
> +
> +	if (atomic_read(&gw_mode) != GW_MODE_CLIENT)
> +		return false;
> +
> +	if (!curr_gateway)
> +		return false;
> +
> +	ethhdr = (struct ethhdr *)skb->data;
> +	if (ntohs(ethhdr->h_proto) != ETH_P_IP)
> +		return false;
> +
> +	iphdr = (struct iphdr *)(skb->data + ETH_HLEN);
> +
> +	if (iphdr->protocol != IPPROTO_UDP)
> +		return false;
> +
> +	udphdr = (struct udphdr *)(skb->data + ETH_HLEN + (iphdr->ihl * 4));
> +
> +	if (ntohs(udphdr->dest) != 67)
> +		return false;
> +
> +	return true;
> +}
> -	/* ethernet packet should be broadcasted */
> -	if (is_bcast(ethhdr->h_dest) || is_mcast(ethhdr->h_dest)) {
> +	if (is_bcast(ethhdr->h_dest) || is_mcast(ethhdr->h_dest))
> +		bcast_dst = true;
> +
> +	if ((bcast_dst) && gw_is_target(skb))
> +		do_bcast = false;

Say the DHCP server is running in client mode. It has also been
requested to broadcast its replies, not unicast the replies.

http://blogs.technet.com/teamdhcp/archive/2009/02/12/dhcp-broadcast-flag-handling-in-windows-7.aspx

If i'm reading this code correctly, it will end up sending the DHCP
reply messages by unicast to the best gateway, not the DHCP client?

      Andrew

  reply	other threads:[~2010-01-05  6:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-04 15:44 [B.A.T.M.A.N.] batman-adv gateway support Marek Lindner
2010-01-04 15:46 ` [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: adding gateway functionality Marek Lindner
2010-01-04 15:46   ` [B.A.T.M.A.N.] [PATCH 2/3] batctl: add support for gateway mode Marek Lindner
2010-01-04 15:46     ` [B.A.T.M.A.N.] [PATCH 3/3] batman-adv: send DHCP requests directly to the chosen gw Marek Lindner
2010-01-05  6:43       ` Andrew Lunn [this message]
2010-01-05 10:00         ` Marek Lindner
2010-01-05 11:09           ` Andrew Lunn
2010-01-04 16:48 ` [B.A.T.M.A.N.] batman-adv gateway support predrag balorda
2010-01-04 16:55   ` Sven Eckelmann
     [not found]     ` <de7865071001040856u1b661bdcxb319ffe60b2b367b@mail.gmail.com>
2010-01-04 17:02       ` Sven Eckelmann
2010-01-04 20:23 ` Donald Gordon
2010-01-04 20:58   ` Andrew Lunn
2010-01-04 21:20     ` Donald Gordon
2010-01-04 21:45   ` Linus Lüssing
2010-01-04 22:27     ` Donald Gordon
2010-01-05  6:31 ` Andrew Lunn
2010-01-05  9:50   ` Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100105064349.GF9585@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=b.a.t.m.a.n@lists.open-mesh.net \
    --cc=lindner_marek@yahoo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox