Commit Message
Copy & paste is not allways the right way.
The previous patch for netlink.c what not OK. The right patch is:
+ return 0;
+}
Comments
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
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
@@ -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;