From: Antonio Quartulli <ordex@autistici.org>
To: The list for a Better Approach To Mobile Ad-hoc Networking
<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCHv2] batman-adv: refine API calls for unicast transmissions of SKBs
Date: Wed, 3 Jul 2013 08:31:04 +0200 [thread overview]
Message-ID: <20130703063104.GE2325@ritirata.org> (raw)
In-Reply-To: <1372809377-32042-1-git-send-email-linus.luessing@web.de>
[-- Attachment #1: Type: text/plain, Size: 2442 bytes --]
Hi Linus,
On Wed, Jul 03, 2013 at 01:56:17AM +0200, Linus Lüssing wrote:
> diff --git a/distributed-arp-table.c b/distributed-arp-table.c
> index f2543c2..12e84f7 100644
> --- a/distributed-arp-table.c
> +++ b/distributed-arp-table.c
> @@ -1026,11 +1026,11 @@ bool batadv_dat_snoop_incoming_arp_request(struct batadv_priv *bat_priv,
> * that a node not using the 4addr packet format doesn't support it.
> */
> if (hdr_size == sizeof(struct batadv_unicast_4addr_packet))
> - err = batadv_send_skb_unicast_4addr(bat_priv, skb_new,
> - BATADV_P_DAT_CACHE_REPLY,
> - vid);
> + err = batadv_send_skb_via_tt_4addr(bat_priv, skb_new,
> + BATADV_P_DAT_CACHE_REPLY,
> + vid);
> else
> - err = batadv_send_skb_unicast(bat_priv, skb_new, vid);
> + err = batadv_send_skb_via_tt(bat_priv, skb_new, vid);
>
> if (!err) {
now that the functions do not return 0 or 1 anymore this check should be changed
to "ret != DROP". We can't assume that the SUCCESS define is 0.
> batadv_inc_counter(bat_priv, BATADV_CNT_DAT_CACHED_REPLY_TX);
> diff --git a/send.c b/send.c
> index b631355..29b42fe 100644
> --- a/send.c
> +++ b/send.c
> @@ -235,36 +235,32 @@ out:
> }
>
> /**
> - * batadv_send_generic_unicast_skb - send an skb as unicast
> + * batadv_send_skb_unicast - encapsulate and send an skb via unicast
> * @bat_priv: the bat priv with all the soft interface information
> * @skb: payload to send
> * @packet_type: the batman unicast packet type to use
> * @packet_subtype: the unicast 4addr packet subtype (only relevant for unicast
> * 4addr packets)
> + * @orig_node: the originator to send the packet to
> * @vid: the vid to be used to search the translation table
> *
> - * Returns 1 in case of error or 0 otherwise.
> + * Wrap the given skb into a batman-adv unicast or unicast-4addr header
> + * depending on whether BATADV_UNICAST or BATADV_UNICAST_4ADDR was supplied
> + * as packet_type. Then send this frame to the given orig_node and release a
> + * reference to this orig_node.
> + *
> + * Return NET_RX_DROP in case of error or NET_RX_SUCCESS otherwise.
This function is in the TX path, therefore you should use NET_XMIT_SUCCESS/DROP
rather than their RX version.
Same comments apply to the other functions.
Cheers,
--
Antonio Quartulli
..each of us alone is worth nothing..
Ernesto "Che" Guevara
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2013-07-03 6:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-02 23:56 [B.A.T.M.A.N.] [PATCHv2] batman-adv: refine API calls for unicast transmissions of SKBs Linus Lüssing
2013-07-03 6:31 ` Antonio Quartulli [this message]
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=20130703063104.GE2325@ritirata.org \
--to=ordex@autistici.org \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/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