b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] PATCH alfred
@ 2016-11-01 14:38 Jean-Jacques Sarton
  2016-11-01 14:57 ` Simon Wunderlich
  2016-11-01 14:59 ` Sven Eckelmann
  0 siblings, 2 replies; 5+ messages in thread
From: Jean-Jacques Sarton @ 2016-11-01 14:38 UTC (permalink / raw)
  To: b.a.t.m.a.n


[-- Attachment #1.1: Type: text/plain, Size: 1163 bytes --]

Copy & paste is not allways the right way.
The previous patch for  netlink.c what not OK. The right patch is:



diff --git a/netlink.c b/netlink.c
index 1b5695c..445161d 100644
--- a/netlink.c
+++ b/netlink.c
@@ -365,3 +365,30 @@ int get_tq_netlink(const char *mesh_iface, const
struct ether_addr *mac,

        return 0;
 }
+
+int batadv_interface_check_netlink(const char *mesh_iface)
+{
+       struct get_tq_netlink_opts opts = {
+               .tq = 0,
+               .found = false,
+               .query_opts = {
+                       .err = 0,
+               },
+       };
+       int ret = 0;
+
+       memset(&opts.mac, 0, ETH_ALEN);
+
+       ret = netlink_query_common(mesh_iface,  BATADV_CMD_GET_ORIGINATORS,
+                                  get_tq_netlink_cb, &opts.query_opts);
+       if (ret < 0)
+               return ret;
+
+       memset(&opts.mac, 0, ETH_ALEN);
+       ret = netlink_query_common(mesh_iface,
BATADV_CMD_GET_TRANSTABLE_GLOBAL,
+                                  get_tq_netlink_cb, &opts.query_opts);
+
+       if (ret < 0)
+               return ret;
+       return 0;
+}


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [B.A.T.M.A.N.] PATCH alfred
  2016-11-01 14:38 [B.A.T.M.A.N.] PATCH alfred Jean-Jacques Sarton
@ 2016-11-01 14:57 ` Simon Wunderlich
  2016-11-01 14:59 ` Sven Eckelmann
  1 sibling, 0 replies; 5+ messages in thread
From: Simon Wunderlich @ 2016-11-01 14:57 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Jean-Jacques Sarton

[-- Attachment #1: Type: text/plain, Size: 468 bytes --]

On Tuesday, November 1, 2016 3:38:48 PM CET Jean-Jacques Sarton wrote:
> Copy & paste is not allways the right way.
> The previous patch for  netlink.c what not OK. The right patch is:

This is not a patch we can apply.

Please read here how to submit patches:

https://www.open-mesh.org/projects/open-mesh/wiki/Contribute#Submitting-patches

For starters, you need a proper subject and commit message describing what you 
do, a signed-off line, ...

Thanks,
    Simon

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [B.A.T.M.A.N.] PATCH alfred
  2016-11-01 14:38 [B.A.T.M.A.N.] PATCH alfred Jean-Jacques Sarton
  2016-11-01 14:57 ` Simon Wunderlich
@ 2016-11-01 14:59 ` Sven Eckelmann
  1 sibling, 0 replies; 5+ messages in thread
From: Sven Eckelmann @ 2016-11-01 14:59 UTC (permalink / raw)
  To: Jean-Jacques Sarton; +Cc: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 2131 bytes --]

On Dienstag, 1. November 2016 15:38:48 CET Jean-Jacques Sarton wrote:
> Copy & paste is not allways the right way.
> The previous patch for  netlink.c what not OK. The right patch is:
> 

Same problems as before and patch is also corrupt:

    Applying patch #16799 using 'git am'
    Description: PATCH alfred
    Applying: PATCH alfred
    fatal: corrupt patch at line 6
    Patch failed at 0001 PATCH alfred
    The copy of the patch that failed is found in: .git/rebase-apply/patch
    When you have resolved this problem, run "git am --continue".
    If you prefer to skip this patch, run "git am --skip" instead.
    To restore the original branch and stop patching, run "git am --abort".
    'git am' failed with exit status 128


> 
> 
> +       return 0;
> +}
> 
> diff --git a/netlink.c b/netlink.c
> index 1b5695c..445161d 100644
> --- a/netlink.c
> +++ b/netlink.c
> @@ -365,3 +365,30 @@ int get_tq_netlink(const char *mesh_iface, const
> struct ether_addr *mac,
> 
>         return 0;
>  }
> +
> +int batadv_interface_check_netlink(const char *mesh_iface)
> +{
> +       struct get_tq_netlink_opts opts = {
> +               .tq = 0,
> +               .found = false,
> +               .query_opts = {
> +                       .err = 0,
> +               },
> +       };
> +       int ret = 0;
> +
> +       memset(&opts.mac, 0, ETH_ALEN);
> +
> +       ret = netlink_query_common(mesh_iface,  BATADV_CMD_GET_ORIGINATORS,
> +                                  get_tq_netlink_cb, &opts.query_opts);
> +       if (ret < 0)
> +               return ret;
> +
> +       memset(&opts.mac, 0, ETH_ALEN);
> +       ret = netlink_query_common(mesh_iface,
> BATADV_CMD_GET_TRANSTABLE_GLOBAL,
> +                                  get_tq_netlink_cb, &opts.query_opts);
> +
> +       if (ret < 0)
> +               return ret;
> 

This is wrong BATADV_CMD_GET_TRANSTABLE_GLOBAL will not work with
get_tq_netlink_cb. And translate_mac_netlink will use
translate_mac_netlink_opts. Better create a dummy function which
only operates on "struct nlquery_opts" and returns NL_STOP on the
first call of this function.

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [B.A.T.M.A.N.] PATCH alfred
  2016-11-01 14:17 Jean-Jacques Sarton
@ 2016-11-01 14:27 ` Sven Eckelmann
  0 siblings, 0 replies; 5+ messages in thread
From: Sven Eckelmann @ 2016-11-01 14:27 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Jean-Jacques Sarton

[-- Attachment #1: Type: text/plain, Size: 2499 bytes --]

On Dienstag, 1. November 2016 15:17:58 CET Jean-Jacques Sarton wrote:
> I had problem with alfre which don't start. I'am using netfs.
> 
> Swen has proposed a patch which remove the batadv_interface_check()
> function.
> May way is an other regarding the transitional period where the
> old an new feature are to be supported.
> 
> Signed-off-by: jj.sarton@t-online.de

Patch is corrupt:

    Description: PATCH alfred
    Applying: PATCH alfred
    fatal: corrupt patch at line 6
    Patch failed at 0001 PATCH alfred
    The copy of the patch that failed is found in: .git/rebase-apply/patch
    When you have resolved this problem, run "git am --continue".
    If you prefer to skip this patch, run "git am --skip" instead.
    To restore the original branch and stop patching, run "git am --abort".
    'git am' failed with exit status 128

Please check http://lxr.free-electrons.com/source/Documentation/email-clients.txt to
understand what your email client has done to the patch..

And you patch subject is bogus. Please use something more specific
than "alfred". Check following examples:

   https://patchwork.open-mesh.org/project/b.a.t.m.a.n./list/?submitter=&state=3&q=alfred%3A&archive=true&delegate=


[...]
> diff --git a/netlink.c b/netlink.c
> index 1b5695c..ca311e7 100644
> --- a/netlink.c
> +++ b/netlink.c
> @@ -365,3 +365,30 @@ int get_tq_netlink(const char *mesh_iface, const
> struct ether_addr *mac,
> 
>         return 0;
>  }
> +
> +int batadv_interface_check_netlink(const char *mesh_iface)
> +{
> +       struct get_tq_netlink_opts opts = {
> +               .tq = 0,
> +               .found = false,
> +               .query_opts = {
> +                       .err = 0,
> +               },
> +       };
> +       int ret = 0;
> +
> +       memset(&opts.mac, 0, ETH_ALEN);
> +
> +       ret = netlink_query_common(mesh_iface,  BATADV_CMD_GET_ORIGINATORS,
> +                                  get_tq_netlink_cb, &opts.query_opts);
> +       if (ret < 0)
> +               return ret;
> +
> +       memset(&opts.mac, 0, ETH_ALEN);
> +       ret = netlink_query_common(mesh_iface,  BATADV_CMD_GET_ORIGINATORS,
> +                                  get_tq_netlink_cb, &opts.query_opts);
> +
> +       if (ret < 0)
> +               return ret;

The formatting + spaces of this function seems to be quite wild.
Please clean that up.

It seems to be wrong to me that you try to query BATADV_CMD_GET_ORIGINATORS
twice but not the global translation table.

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [B.A.T.M.A.N.] PATCH alfred
@ 2016-11-01 14:17 Jean-Jacques Sarton
  2016-11-01 14:27 ` Sven Eckelmann
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Jacques Sarton @ 2016-11-01 14:17 UTC (permalink / raw)
  To: b.a.t.m.a.n

I had problem with alfre which don't start. I'am using netfs.

Swen has proposed a patch which remove the batadv_interface_check()
function.
May way is an other regarding the transitional period where the
old an new feature are to be supported.

Signed-off-by: jj.sarton@t-online.de


diff --git a/batadv_query.c b/batadv_query.c
index a671b79..c8732ef 100644
--- a/batadv_query.c
+++ b/batadv_query.c
@@ -136,7 +136,7 @@ int ipv6_to_mac(const struct in6_addr *addr, struct
ether_addr *mac)
        return 0;
 }

-int batadv_interface_check(const char *mesh_iface)
+int batadv_interface_check_debugfs(const char *mesh_iface)
 {
        char full_path[MAX_PATH + 1];
        FILE *f;
@@ -166,6 +166,18 @@ int batadv_interface_check(const char *mesh_iface)
        return 0;
 }

+int batadv_interface_check(const char *mesh_iface)
+{
+       int ret = 0;
+       enable_net_admin_capability(1);
+       ret = batadv_interface_check_netlink(mesh_iface);
+       enable_net_admin_capability(0);
+
+       if ( ret < 0 )
+               return batadv_interface_check_debugfs(mesh_iface);
+       return 0;
+}
+
 static int translate_mac_debugfs(const char *mesh_iface,
                                 const struct ether_addr *mac,
                                 struct ether_addr *mac_out)
diff --git a/netlink.c b/netlink.c
index 1b5695c..ca311e7 100644
--- a/netlink.c
+++ b/netlink.c
@@ -365,3 +365,30 @@ int get_tq_netlink(const char *mesh_iface, const
struct ether_addr *mac,

        return 0;
 }
+
+int batadv_interface_check_netlink(const char *mesh_iface)
+{
+       struct get_tq_netlink_opts opts = {
+               .tq = 0,
+               .found = false,
+               .query_opts = {
+                       .err = 0,
+               },
+       };
+       int ret = 0;
+
+       memset(&opts.mac, 0, ETH_ALEN);
+
+       ret = netlink_query_common(mesh_iface,  BATADV_CMD_GET_ORIGINATORS,
+                                  get_tq_netlink_cb, &opts.query_opts);
+       if (ret < 0)
+               return ret;
+
+       memset(&opts.mac, 0, ETH_ALEN);
+       ret = netlink_query_common(mesh_iface,  BATADV_CMD_GET_ORIGINATORS,
+                                  get_tq_netlink_cb, &opts.query_opts);
+
+       if (ret < 0)
+               return ret;
+       return 0;
+}
diff --git a/netlink.h b/netlink.h
index b08e872..9bc75a1 100644
--- a/netlink.h
+++ b/netlink.h
@@ -49,6 +49,7 @@ int translate_mac_netlink(const char *mesh_iface,
const struct ether_addr *mac,
                          struct ether_addr *mac_out);
 int get_tq_netlink(const char *mesh_iface, const struct ether_addr *mac,
                   uint8_t *tq);
+int batadv_interface_check_netlink(const char *mesh_iface);

 extern struct nla_policy batadv_netlink_policy[];


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-01 14:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-01 14:38 [B.A.T.M.A.N.] PATCH alfred Jean-Jacques Sarton
2016-11-01 14:57 ` Simon Wunderlich
2016-11-01 14:59 ` Sven Eckelmann
  -- strict thread matches above, loose matches on Subject: below --
2016-11-01 14:17 Jean-Jacques Sarton
2016-11-01 14:27 ` Sven Eckelmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).