Patch subject prefix is wrong (actually, it is missing).
On Montag, 16. Januar 2017 12:49:34 CET Jonathan Haws wrote:
+int ipv4_to_mac(const alfred_addr *addr, struct ether_addr *mac) +{
- mac->ether_addr_octet[0] = 0;
- mac->ether_addr_octet[1] = 0;
- mac->ether_addr_octet[2] = (addr->ipv4.s_addr >> 24) & 0xFF;
- mac->ether_addr_octet[3] = (addr->ipv4.s_addr >> 16) & 0xFF;
- mac->ether_addr_octet[4] = (addr->ipv4.s_addr >> 8) & 0xFF;
- mac->ether_addr_octet[5] = (addr->ipv4.s_addr >> 0) & 0xFF;
- if (!is_valid_ether_addr(mac->ether_addr_octet))
- return -EINVAL;
- return 0;
+}
This will not return the mac address of the device. It will therefore break the synchronization code. see SOURCE_FIRST_HAND in sync_data and the code which sets data_source in finish_alfred_push_data.
On Montag, 16. Januar 2017 12:49:34 CET Jonathan Haws wrote:
@@ -61,6 +62,7 @@ static void alfred_usage(void) printf(" other masters\n"); printf(" -p, --sync-period [period] set synchronization period, in seconds\n"); printf(" fractional seconds are supported (i.e. 0.2 = 5 Hz)\n");
printf(" -4 specify IPv4 multicast address and operate in IPv4 mode"); printf("\n"); printf(" -u, --unix-path [path] path to unix socket used for client-server\n"); printf(" communication (default: \""ALFRED_SOCK_PATH_DEFAULT"\")\n");
The documentation is wrong. It requires an argument but the argument is not shown.
Same problem in the manpage.
On Montag, 16. Januar 2017 19:52:41 CET Jonathan Haws wrote:
I realize that the code in this patch is not formatted properly, but I was unable to get checkpatch.pl to scan this right - it needs a full kernel tree. Is there another formatting script I can run?
What is the problem with downloading the kernel sources? And auto-formatting scripts tend to not get everything right and make things worse in some cases. checkpatch.pl is therefore only to point out some obvious problems.
For example that you are replace tabs (8 spaces wide in alfred code) sometimes with 2 spaces.
Kind regards, Sven