Skip to contentSkip to conversation

PATCH alfred

B.A.T.M.A.N. Jean-Jacques Sarton 2 participants 2 messages Nov 1, 2016

lore
Share & tools
lore
#0 lore raw

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 [email protected]
batadv_query.c +0 -0
index a671b79..c8732ef 100644
@@ -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)

netlink.c +0 -0
index 1b5695c..ca311e7 100644
@@ -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;
+}

netlink.h +0 -0
index b08e872..9bc75a1 100644
@@ -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[];

#1 lore raw
Quoted 8 lines · 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 [email protected]

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=

[...]

Quoted 24 lines
netlink.c +15 -0
index 1b5695c..ca311e7 100644
@@ -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,

netlink.c int get_tq_netlink(const char *mesh_iface, const

Quoted 10 lines
netlink.c +10 -0
+                                  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