batctl: Debian patches for 2013.3.0-2
Hi,
different patches [1] were aggregated in the Debian package of batctl 2013.3.0-2. These were not made against the current master but rebased versions are included in this thread.
Kind regards,
Sven
PATCH 1/11 batctl: Fix possible buffer overflow when using strncat
The length field (n) of strncat is used to specify the length of the buffer without the \0 delimiter. strncat will add it even when it will write it to the limit of n bytes was written.
--- bat-hosts.c | 2 +- functions.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
bat-hosts.c +1 -1
@@ -194,7 +194,7 @@ void bat_hosts_init(int read_opt)strncpy (confdir, homedir,CONF_DIR_LEN ); confdir[CONF_DIR_LEN -1 ] ='\0' ; -strncat (confdir, &bat_hosts_path[i][1 ],CONF_DIR_LEN -strlen (confdir)); +strncat (confdir, &bat_hosts_path[i][1 ],CONF_DIR_LEN -strlen (confdir) -1 ); }else {strncpy (confdir, bat_hosts_path[i],CONF_DIR_LEN ); confdir[CONF_DIR_LEN -1 ] ='\0' ;
functions.c +2 -2
@@ -180,7 +180,7 @@ int read_file(char *dir, char *fname, int read_opt,strncpy (full_path, dir,strlen (dir)); full_path[strlen (dir)] ='\0' ; -strncat (full_path, fname,sizeof (full_path) -strlen (full_path)); +strncat (full_path, fname,sizeof (full_path) -strlen (full_path) -1 ); open: line =0 ;
@@ -305,7 +305,7 @@ int write_file(char *dir, char *fname, char *arg1, char *arg2)strncpy (full_path, dir,strlen (dir)); full_path[strlen (dir)] ='\0' ; -strncat (full_path, fname,sizeof (full_path) -strlen (full_path)); +strncat (full_path, fname,sizeof (full_path) -strlen (full_path) -1 ); fd =open (full_path,O_WRONLY );
Signature · 1 line
1.8.4.rc3
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCH 01/11] batctl: Fix possible buffer overflow when using strncat
Quoted 9 lines · Sven Eckelmann
The length field (n) of strncat is used to specify the length of the buffer without the \0 delimiter. strncat will add it even when it will write it to the limit of n bytes was written.
Signed-off-by Sven Eckelmann <[email protected]>--- bat-hosts.c | 2 +- functions.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Applied in revision f1e262c.
Thanks,
Marek
PATCH 2/11 batctl: Fix inconsistent use of _GNU_SOURCE
In reply to Sven EckelmannEither all or no source file should define _GNU_SOURCE to avoid incompatible types or function declarations.
--- Makefile | 1 + bat-hosts.c | 1 - functions.c | 1 - 3 files changed, 1 insertion(+), 2 deletions(-)
Makefile +1 -0
@@ -30,6 +30,7 @@ MANPAGE = man/batctl.8 # batctl flags and options CFLAGS += -Wall -W -std=gnu99 -fno-strict-aliasing -MD +CPPFLAGS += -D_GNU_SOURCE LDLIBS += -lm # disable verbose output
bat-hosts.c +0 -1
@@ -21,7 +21,6 @@ -#define _GNU_SOURCE#include <stdio.h> #include <stdint.h> #include <limits.h>
functions.c +0 -1
@@ -20,7 +20,6 @@*/ -#define _GNU_SOURCE#include <netinet/ether.h> #include <arpa/inet.h> #include <sys/socket.h>
Signature · 1 line
1.8.4.rc3
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCH 02/11] batctl: Fix inconsistent use of _GNU_SOURCE
Quoted 9 lines · Sven Eckelmann
Either all or no source file should define
_GNU_SOURCEto avoid incompatible types or function declarations.Signed-off-by Sven Eckelmann <[email protected]>--- Makefile | 1 + bat-hosts.c | 1 - functions.c | 1 - 3 files changed, 1 insertion(+), 2 deletions(-)
Applied in revision db34e02.
Thanks,
Marek
PATCH 3/11 batctl: Avoid assigning const buffer to non-const pointer
In reply to Sven EckelmannStrings in C are tried to be saved in the .rodata by the compiler/linker. This section is readonly as the name suggests. Pointer to these strings should therefore be const.
--- functions.c | 8 +++++--- functions.h | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-)
functions.c +5 -3
@@ -124,7 +124,8 @@ int file_exists(const char *fpath)return stat (fpath, &st) ==0 ; } -static void file_open_problem_dbg (char *dir,char *fname,char *full_path) +static void file_open_problem_dbg (const char *dir,const char *fname, +const char *full_path) {const char **ptr;struct stat st;
@@ -162,7 +163,7 @@ static void file_open_problem_dbg(char *dir, char *fname, char *full_path) } } -int read_file (char *dir,char *fname,int read_opt, +int read_file (const char *dir,const char *fname,int read_opt,float orig_timeout,float watch_interval,size_t header_lines) {struct ether_addr *mac_addr;
@@ -296,7 +297,8 @@ out:return res; } -int write_file (char *dir,char *fname,char *arg1,char *arg2) +int write_file (const char *dir,const char *fname,const char *arg1, +const char *arg2) {int fd =0 , res =EXIT_FAILURE ;char full_path[500 ];
functions.h +3 -2
@@ -34,9 +34,10 @@ char *ether_ntoa_long(const struct ether_addr *addr);char *get_name_by_macaddr (struct ether_addr *mac_addr,int read_opt);char *get_name_by_macstr (char *mac_str,int read_opt);int file_exists (const char *fpath); -int read_file (char *dir,char *path,int read_opt, +int read_file (const char *dir,const char *path,int read_opt,float orig_timeout,float watch_interval,size_t header_lines); -int write_file (char *dir,char *fname,char *arg1,char *arg2); +int write_file (const char *dir,const char *fname,const char *arg1, +const char *arg2);struct ether_addr *translate_mac (char *mesh_iface,struct ether_addr *mac);struct ether_addr *resolve_mac (const char *asc);
Signature · 1 line
1.8.4.rc3
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCH 03/11] batctl: Avoid assigning const buffer to non-const pointer
Quoted 9 lines · Sven Eckelmann
Strings in C are tried to be saved in the .rodata by the compiler/linker. This section is readonly as the name suggests. Pointer to these strings should therefore be const.
Signed-off-by Sven Eckelmann <[email protected]>--- functions.c | 8 +++++--- functions.h | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-)
Applied in revision 55509e5.
Thanks,
Marek
PATCH 4/11 batctl: Mark all local functions as static
In reply to Sven Eckelmann--- debug.c | 2 +- main.c | 2 +- ping.c | 4 ++-- traceroute.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
debug.c +1 -1
@@ -84,7 +84,7 @@ const struct debug_table_data batctl_debug_tables[BATCTL_TABLE_NUM] = { }, }; -void debug_table_usage (int debug_table) +static void debug_table_usage (int debug_table) {fprintf (stderr,"Usage: batctl [options] %s|%s [parameters]\n" , batctl_debug_tables[debug_table].opt_long, batctl_debug_tables[debug_table].opt_short);
main.c +1 -1
@@ -43,7 +43,7 @@char mesh_dfl_iface[] ="bat0" ;char module_ver_path[] ="/sys/module/batman_adv/version" ; -void print_usage (void ) +static void print_usage (void ) {int i, opt_indent;
ping.c +2 -2
@@ -42,7 +42,7 @@char is_aborted =0 ; -void ping_usage (void ) +static void ping_usage (void ) {fprintf (stderr,"Usage: batctl [options] ping [parameters] mac|bat-host|host_name|IPv4_address \n" );fprintf (stderr,"parameters:\n" );
@@ -54,7 +54,7 @@ void ping_usage(void)fprintf (stderr," \t -T don't try to translate mac to originator address\n" ); } -void sig_handler (int sig) +static void sig_handler (int sig) {switch (sig) {case SIGINT :
traceroute.c +1 -1
@@ -41,7 +41,7 @@#define NUM_PACKETS 3 -void traceroute_usage (void ) +static void traceroute_usage (void ) {fprintf (stderr,"Usage: batctl [options] traceroute [parameters] mac|bat-host|host_name|IPv4_address \n" );fprintf (stderr,"parameters:\n" );
Signature · 1 line
1.8.4.rc3
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCH 04/11] batctl: Mark all local functions as static
Quoted 7 lines · Sven Eckelmann
Signed-off-by Sven Eckelmann <[email protected]>--- debug.c | 2 +- main.c | 2 +- ping.c | 4 ++-- traceroute.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
Applied in revision aad6168.
Thanks,
Marek
PATCH 5/11 batctl: Add include guards to avoid redundant declarations or include loops
In reply to Sven Eckelmann--- allocate.h | 4 ++-- bat-hosts.h | 4 ++-- bisect_iv.h | 5 +++++ debug.h | 4 ++++ functions.h | 5 ++++- ioctl.h | 4 ++++ main.h | 5 +++++ ping.h | 5 ++++- sys.h | 4 ++++ tcpdump.h | 4 ++++ traceroute.h | 5 ++++- translate.h | 5 ++++- 12 files changed, 46 insertions(+), 8 deletions(-)
allocate.h +2 -2
@@ -20,8 +20,8 @@*/ -#ifndef _ALLOCATE_H -#define _ALLOCATE_H 1 +#ifndef _BATCTL_ALLOCATE_H +#define _BATCTL_ALLOCATE_H/* debug allocate wrapper to keep hash.c happy */
bat-hosts.h +2 -2
@@ -21,8 +21,8 @@ -#ifndef _BAT_HOSTS_H -#define _BAT_HOSTS_H 1 +#ifndef _BATCTL_BAT_HOSTS_H +#define _BATCTL_BAT_HOSTS_H#include <netinet/ether.h>
bisect_iv.h +5 -0
@@ -19,6 +19,9 @@* */ +#ifndef _BATCTL_BISECT_IV_H +#define _BATCTL_BISECT_IV_H +#include "list-batman.h" #define NAME_LEN 18
@@ -95,3 +98,5 @@ struct seqno_trace {char print; struct seqno_trace_neigh seqno_trace_neigh; }; + +#endif
debug.h +4 -0
@@ -19,6 +19,8 @@* */ +#ifndef _BATCTL_DEBUG_H +#define _BATCTL_DEBUG_H#define DEBUG_BATIF_PATH_FMT "%s/batman_adv/%s"#define DEBUG_TRANSTABLE_GLOBAL "transtable_global"
@@ -48,3 +50,5 @@ extern const struct debug_table_data batctl_debug_tables[BATCTL_TABLE_NUM];int handle_debug_table (char *mesh_iface,int debug_table,int argc,char **argv);int log_print (char *mesh_iface,int argc,char **argv);int print_vis_info (char *mesh_iface); + +#endif
functions.h +4 -1
@@ -19,7 +19,8 @@* */ - +#ifndef _BATCTL_FUNCTIONS_H +#define _BATCTL_FUNCTIONS_H#include <netinet/if_ether.h>
@@ -55,3 +56,5 @@ enum {COMPAT_FILTER =0x80 , SKIP_HEADER = 0x100, }; + +#endif
ioctl.h +4 -0
@@ -19,5 +19,9 @@* */ +#ifndef _BATCTL_IOCTL_H +#define _BATCTL_IOCTL_Hint ioctl_statistics_get (char *mesh_iface); + +#endif
main.h +5 -0
@@ -19,6 +19,9 @@* */ +#ifndef _BATCTL_MAIN_H +#define _BATCTL_MAIN_H +#ifndef SOURCE_VERSION #define SOURCE_VERSION "2013.3.0"#endif
@@ -45,3 +48,5 @@#define BIT (nr) (1UL << (nr))/* linux kernel compat */ extern char module_ver_path[]; + +#endif
ping.h +4 -1
@@ -19,6 +19,9 @@* */ - +#ifndef _BATCTL_PING_H +#define _BATCTL_PING_Hint ping (char *mesh_iface,int argc,char **argv); + +#endif
sys.h +4 -0
@@ -19,6 +19,8 @@* */ +#ifndef _BATCTL_SYS_H +#define _BATCTL_SYS_H#define SYS_BATIF_PATH_FMT "/sys/class/net/%s/mesh/"#define SYS_LOG_LEVEL "log_level"
@@ -64,3 +66,5 @@ int interface(char *mesh_iface, int argc, char **argv);int handle_loglevel (char *mesh_iface,int argc,char **argv);int handle_sys_setting (char *mesh_iface,int setting,int argc,char **argv);int handle_gw_setting (char *mesh_iface,int argc,char **argv); + +#endif
tcpdump.h +4 -0
@@ -19,6 +19,8 @@* */ +#ifndef _BATCTL_TCPDUMP_H +#define _BATCTL_TCPDUMP_H#include <netpacket/packet.h> #include <net/ethernet.h>
@@ -105,3 +107,5 @@ struct prism_header {#define RADIOTAP_HEADER_LEN sizeof(struct radiotap_header)int tcpdump (int argc,char **argv); + +#endif
traceroute.h +4 -1
@@ -19,6 +19,9 @@* */ - +#ifndef _BATCTL_TRACEROUTE_H +#define _BATCTL_TRACEROUTE_Hint traceroute (char *mesh_iface,int argc,char **argv); + +#endif
translate.h +4 -1
@@ -19,6 +19,9 @@* */ - +#ifndef _BATCTL_TRANSLATE_H +#define _BATCTL_TRANSLATE_Hint translate (char *mesh_iface,int argc,char **argv); + +#endif
Signature · 1 line
1.8.4.rc3
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCH 05/11] batctl: Add include guards to avoid redundant declarations or include loops
Quoted 15 lines · Sven Eckelmann
Signed-off-by Sven Eckelmann <[email protected]>--- allocate.h | 4 ++-- bat-hosts.h | 4 ++-- bisect_iv.h | 5 +++++ debug.h | 4 ++++ functions.h | 5 ++++- ioctl.h | 4 ++++ main.h | 5 +++++ ping.h | 5 ++++- sys.h | 4 ++++ tcpdump.h | 4 ++++ traceroute.h | 5 ++++- translate.h | 5 ++++- 12 files changed, 46 insertions(+), 8 deletions(-)
Applied in revision 2e15205.
Thanks,
Marek
PATCH 6/11 batctl: Remove legacy types u64 and caddr_t
In reply to Sven EckelmannThe definition of u64 was not obtained from the correct source to always use 64 bit. Instead uint64_t can be used.
Also caddr_t is obsolete BSDism and void* should be used instead.
--- ioctl.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
ioctl.c +5 -6
@@ -30,13 +30,12 @@#include <linux/if.h> #include <linux/sockios.h> #include <linux/ethtool.h> +#include <stdint.h> #include "main.h" #include "ioctl.h" #include "debugfs.h" -typedef unsigned long long u64 ; -/* code borrowed from ethtool */ static int statistics_custom_get (int fd,struct ifreq *ifr) {
@@ -47,7 +46,7 @@ static int statistics_custom_get(int fd, struct ifreq *ifr)int err, ret =EXIT_FAILURE ; drvinfo.cmd =ETHTOOL_GDRVINFO ; - ifr->ifr_data = (caddr_t)&drvinfo; + ifr->ifr_data = (void *)&drvinfo; err =ioctl (fd,SIOCETHTOOL , ifr);if (err <0 ) {fprintf (stderr,"Error - can't open driver information: %s\n" ,strerror (errno));
@@ -59,7 +58,7 @@ static int statistics_custom_get(int fd, struct ifreq *ifr) goto success; sz_str = n_stats *ETH_GSTRING_LEN ; - sz_stats = n_stats *sizeof (u64); + sz_stats = n_stats *sizeof (uint64_t ); strings =calloc (1 , sz_str +sizeof (struct ethtool_gstrings )); stats =calloc (1 , sz_stats +sizeof (struct ethtool_stats ));
@@ -71,7 +70,7 @@ static int statistics_custom_get(int fd, struct ifreq *ifr) strings->cmd =ETHTOOL_GSTRINGS ; strings->string_set =ETH_SS_STATS ; strings->len = n_stats; - ifr->ifr_data = (caddr_t )strings; + ifr->ifr_data = (void *)strings; err =ioctl (fd,SIOCETHTOOL , ifr);if (err <0 ) {fprintf (stderr,"Error - can't get stats strings information: %s\n" ,strerror (errno));
@@ -80,7 +79,7 @@ static int statistics_custom_get(int fd, struct ifreq *ifr) stats->cmd =ETHTOOL_GSTATS ; stats->n_stats = n_stats; - ifr->ifr_data = (caddr_t ) stats; + ifr->ifr_data = (void *) stats; err =ioctl (fd,SIOCETHTOOL , ifr);if (err <0 ) {fprintf (stderr,"Error - can't get stats information: %s\n" ,strerror (errno));
Signature · 1 line
1.8.4.rc3
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCH 06/11] batctl: Remove legacy types u64 and caddr_t
Quoted 9 lines · On Tuesday 10 September 2013 23:11:57 Sven Eckelmann wrote:
The definition of u64 was not obtained from the correct source to always use 64 bit. Instead
uint64_tcan be used.Also
caddr_tis obsolete BSDism and void* should be used instead.Signed-off-by Sven Eckelmann <[email protected]>--- ioctl.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
Applied in revision 0a88d31.
Thanks,
Marek
PATCH 7/11 batctl: Add missing includes and remove unused includes
In reply to Sven Eckelmann--- bat-hosts.c | 5 +++-- bat-hosts.h | 2 +- bisect_iv.c | 7 ++++--- debug.c | 5 ----- debug.h | 3 +++ debugfs.c | 10 ++++------ debugfs.h | 3 --- functions.c | 2 ++ functions.h | 3 ++- ioctl.c | 3 +-- list-batman.h | 3 --- main.c | 3 --- ping.c | 5 +++++ sys.c | 1 - sys.h | 2 ++ tcpdump.c | 6 +++++- tcpdump.h | 5 ++++- traceroute.c | 4 ++++ translate.c | 1 - 19 files changed, 40 insertions(+), 33 deletions(-)
bat-hosts.c +3 -2
@@ -21,14 +21,15 @@ -#include <stdio.h> #include <stdint.h> +#include <stdio.h> #include <limits.h> #include <stdlib.h> #include <errno.h> #include <string.h> +#include <stddef.h> +#include <netinet/ether.h> -#include "main.h" #include "bat-hosts.h" #include "hash.h" #include "functions.h"
bat-hosts.h +1 -1
@@ -24,7 +24,7 @@#ifndef _BATCTL_BAT_HOSTS_H#define _BATCTL_BAT_HOSTS_H -#include <netinet/ether.h> +#include <net/ethernet.h> #define HOST_NAME_MAX_LEN 50#define CONF_DIR_LEN 256
bisect_iv.c +4 -3
@@ -19,14 +19,15 @@* */ +#include <stdint.h> #include <stdio.h> #include <stdlib.h> -#include <stdint.h> -#include <unistd.h> #include <string.h> #include <errno.h> +#include <unistd.h> +#include <stddef.h> +#include <netinet/ether.h> -#include "main.h" #include "bisect_iv.h" #include "bat-hosts.h" #include "hash.h"
debug.c +0 -5
@@ -23,12 +23,7 @@#include <unistd.h> #include <stdio.h> #include <stdlib.h> -#include <string.h> -#include <errno.h> -#include <sys/types.h> -#include <dirent.h> -#include "main.h" #include "debug.h" #include "debugfs.h" #include "functions.h"
debug.h +3 -0
@@ -22,6 +22,9 @@#ifndef _BATCTL_DEBUG_H#define _BATCTL_DEBUG_H +#include <stddef.h> +#include "main.h" +#define DEBUG_BATIF_PATH_FMT "%s/batman_adv/%s"#define DEBUG_TRANSTABLE_GLOBAL "transtable_global"#define DEBUG_LOG "log"
debugfs.c +4 -6
@@ -19,14 +19,12 @@*/ #include "debugfs.h" -#include <stdio.h> -#include <stdlib.h> #include <errno.h> -#include <sys/vfs.h> -#include <sys/types.h> +#include <stdio.h> +#include <string.h> +#include <sys/mount.h> #include <sys/stat.h> -#include <fcntl.h> -#include <unistd.h> +#include <sys/statfs.h> #ifndef DEBUGFS_MAGIC #define DEBUGFS_MAGIC 0x64626720
debugfs.h +0 -3
@@ -21,9 +21,6 @@#ifndef __DEBUGFS_H__#define __DEBUGFS_H__ -#include <sys/mount.h> -#include <string.h> -#ifndef MAX_PATH # define MAX_PATH 256#endif
functions.c +2 -0
@@ -33,6 +33,8 @@#include <errno.h> #include <fcntl.h> #include <sys/time.h> +#include <netinet/in.h> +#include <stdint.h> #include "main.h" #include "functions.h"
functions.h +2 -1
@@ -22,7 +22,8 @@#ifndef _BATCTL_FUNCTIONS_H#define _BATCTL_FUNCTIONS_H -#include <netinet/if_ether.h> +#include <net/ethernet.h> +#include <stddef.h> #define ETH_STR_LEN 17
ioctl.c +1 -2
@@ -26,15 +26,14 @@#include <string.h> #include <unistd.h> #include <sys/ioctl.h> +#include <sys/types.h> #include <sys/socket.h> #include <linux/if.h> #include <linux/sockios.h> #include <linux/ethtool.h> #include <stdint.h> -#include "main.h" #include "ioctl.h" -#include "debugfs.h" /* code borrowed from ethtool */ static int statistics_custom_get (int fd,struct ifreq *ifr)
list-batman.h +0 -3
@@ -19,9 +19,6 @@* */ - -#include <stddef.h> /* offsetof() */ -#ifndef _LINUX_LIST_H#define _LINUX_LIST_H
main.c +0 -3
@@ -21,9 +21,7 @@ -#include <sys/types.h> #include <stdio.h> -#include <stdint.h> #include <stdlib.h> #include <unistd.h> #include <string.h>
@@ -38,7 +36,6 @@#include "bisect_iv.h" #include "ioctl.h" #include "functions.h" -#include <err.h> char mesh_dfl_iface[] ="bat0" ;char module_ver_path[] ="/sys/module/batman_adv/version" ;
ping.c +5 -0
@@ -30,6 +30,11 @@#include <fcntl.h> #include <string.h> #include <math.h> +#include <stddef.h> +#include <stdint.h> +#include <sys/select.h> +#include <sys/time.h> +#include <linux/if_ether.h> #include "main.h" #include "ping.h"
sys.c +0 -1
@@ -25,7 +25,6 @@#include <stdlib.h> #include <string.h> #include <errno.h> -#include <sys/types.h> #include <dirent.h> #include "main.h"
sys.h +2 -0
@@ -22,6 +22,8 @@#ifndef _BATCTL_SYS_H#define _BATCTL_SYS_H +#include "main.h" +#define SYS_BATIF_PATH_FMT "/sys/class/net/%s/mesh/"#define SYS_LOG_LEVEL "log_level"#define SYS_LOG "log"
tcpdump.c +5 -1
@@ -36,8 +36,12 @@#include <netinet/udp.h> #include <netinet/ip_icmp.h> #include <netinet/if_ether.h> +#include <net/ethernet.h> +#include <stddef.h> +#include <stdint.h> +#include <sys/select.h> +#include <sys/socket.h> -#include "main.h" #include "tcpdump.h" #include "packet.h" #include "bat-hosts.h"
tcpdump.h +4 -1
@@ -23,7 +23,10 @@#define _BATCTL_TCPDUMP_H#include <netpacket/packet.h> -#include <net/ethernet.h> +#include <linux/if_ether.h> +#include <net/if_arp.h> +#include <sys/types.h> +#include "main.h" #include "list-batman.h" #ifndef ARPHRD_IEEE80211_PRISM
traceroute.c +4 -0
@@ -28,6 +28,10 @@#include <unistd.h> #include <fcntl.h> #include <string.h> +#include <linux/if_ether.h> +#include <stddef.h> +#include <sys/select.h> +#include <sys/time.h> #include "main.h" #include "traceroute.h"
translate.c +0 -1
@@ -19,7 +19,6 @@* */ -#include <netinet/in.h> #include <stdio.h> #include <stdlib.h>
Signature · 1 line
1.8.4.rc3
PATCH 8/11 batctl: Fix error handling jump in interface when batadv not loaded
In reply to Sven EckelmannThe jump to the path_buffer free must be taken when batman-adv was not loaded because it has to free path_buff which was allocated earlier
--- sys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sys.c +1 -1
@@ -230,7 +230,7 @@ int interface(char *mesh_iface, int argc, char **argv)if (!file_exists (module_ver_path)) {fprintf (stderr,"Error - batman-adv module has not been loaded\n" ); - goto err; + goto err_buff; }fprintf (stderr,"Error - interface type not supported by batman-adv: %s\n" , argv[i]);
Signature · 1 line
1.8.4.rc3
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCH 08/11] batctl: Fix error handling jump in interface when batadv not loaded
Quoted 7 lines · On Tuesday 10 September 2013 23:11:59 Sven Eckelmann wrote:
The jump to the
path_bufferfree must be taken when batman-adv was not loaded because it has to freepath_buffwhich was allocated earlierSigned-off-by Sven Eckelmann <[email protected]>--- sys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied in revision 2b8d81c.
Thanks,
Marek
PATCH 9/11 batctl: Fix type of new neighbor buffer in _seqno_trace_neigh_add
In reply to Sven Eckelmann--- bisect_iv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
bisect_iv.c +2 -2
@@ -1041,7 +1041,7 @@ static void seqno_trace_print(struct list_head_first *trace_list, char *trace_orstatic int _seqno_trace_neigh_add (struct seqno_trace_neigh *seqno_trace_mom,struct seqno_trace_neigh *seqno_trace_child) { -struct seqno_trace_neigh *data_ptr; +struct seqno_trace_neigh **data_ptr; data_ptr =malloc ((seqno_trace_mom->num_neighbors +1 ) *sizeof (struct seqno_trace_neigh *));if (!data_ptr)
@@ -1054,7 +1054,7 @@ static int _seqno_trace_neigh_add(struct seqno_trace_neigh *seqno_trace_mom, } seqno_trace_mom->num_neighbors++; - seqno_trace_mom->seqno_trace_neigh = (void *)data_ptr; + seqno_trace_mom->seqno_trace_neigh = data_ptr; seqno_trace_mom->seqno_trace_neigh[seqno_trace_mom->num_neighbors -1 ] = seqno_trace_child;return 1 ; }
Signature · 1 line
1.8.4.rc3
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCH 09/11] batctl: Fix type of new neighbor buffer in _seqno_trace_neigh_add
Quoted 4 lines · On Tuesday 10 September 2013 23:12:00 Sven Eckelmann wrote:
Signed-off-by Sven Eckelmann <[email protected]>--- bisect_iv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Applied in revision 2091ab8.
Thanks,
Marek
PATCH 10/11 batctl: Don't fail rebuild when header is removed
In reply to Sven EckelmannThe *.d depends files for make just list the files used when building an object file. Removing a file listed in such a dependency file causes make to search for a way to recreate it. This usually cannot work because these files aren't autogenerated.
The gcc option -MP can be used to generate empty rule for these files. Removing a file in a dependency list will then execute this empty rule and continue with the execution of the creation of the object file. This compilation process will then automatically correct the dependency file.
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -29,7 +29,7 @@ OBJ_BISECT = bisect_iv.o MANPAGE = man/batctl.8 # batctl flags and options -CFLAGS += -Wall -W -std=gnu99 -fno-strict-aliasing -MD +CFLAGS += -Wall -W -std=gnu99 -fno-strict-aliasing -MD -MP CPPFLAGS += -D_GNU_SOURCE LDLIBS += -lm
Signature · 1 line
1.8.4.rc3
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCH 10/11] batctl: Don't fail rebuild when header is removed
Quoted 10 lines · On Tuesday 10 September 2013 23:12:01 Sven Eckelmann wrote:
The *.d depends files for make just list the files used when building an object file. Removing a file listed in such a dependency file causes make to search for a way to recreate it. This usually cannot work because these files aren't autogenerated.
The gcc option -MP can be used to generate empty rule for these files. Removing a file in a dependency list will then execute this empty rule and continue with the execution of the creation of the object file. This compilation process will then automatically correct the dependency file.
Quoted 4 lines
Signed-off-by Sven Eckelmann <[email protected]>--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied in revision 4c5c86e.
Thanks,
Marek
PATCH 11/11 batctl: Don't use hyphen for parameter in manpage
In reply to Sven EckelmannBy default, "-" chars are interpreted as hyphens (U+2010) by groff, not as minus signs (U+002D). Since options to programs use minus signs (U+002D), this means for example in UTF-8 locales that you cannot cut and paste options, nor search for them easily.
--- man/batctl.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
man/batctl.8 +1 -1
@@ -269,7 +269,7 @@ except specified). The following packet types are available: 128 - non batman packets .RE .RS 7 -Example: batctl td <interface> -p 129 \-> only display batman ogm packets and non batman packets +Example: batctl td <interface> \-p 129 \-> only display batman ogm packets and non batman packets .RE .br .IP "\fBbisect_iv\fP [\fB\-l MAC\fP][\fB\-t MAC\fP][\fB\-r MAC\fP][\fB\-s min\fP [\fB\- max\fP]][\fB\-o MAC\fP][\fB\-n\fP] \fBlogfile1\fP [\fBlogfile2\fP ... \fBlogfileN\fP]"
Signature · 1 line
1.8.4.rc3
Marek Lindner
AppliedRe: [B.A.T.M.A.N.] [PATCH 11/11] batctl: Don't use hyphen for parameter in manpage
Quoted 9 lines · On Tuesday 10 September 2013 23:12:02 Sven Eckelmann wrote:
By default, "-" chars are interpreted as hyphens (U+2010) by groff, not as minus signs (U+002D). Since options to programs use minus signs (U+002D), this means for example in UTF-8 locales that you cannot cut and paste options, nor search for them easily.
Signed-off-by Sven Eckelmann <[email protected]>--- man/batctl.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied in revision b64f1c8.
Thanks,
Marek