lists.open-mesh.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
List overview
Download
commits
December 2017
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
commits@lists.open-mesh.org
1 participants
242 discussions
Start a n
N
ew thread
[batctl] master: batctl: tcpdump: Fix types for for TT v1 (15a1335)
by postmaster@open-mesh.org
01 Dec '17
01 Dec '17
Repository : ssh://git@open-mesh.org/batctl On branch : master >--------------------------------------------------------------- commit 15a1335cadacc7c3bb4723a30617d123a961a311 Author: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Date: Thu Nov 23 15:04:43 2017 +0100 batctl: tcpdump: Fix types for for TT v1 The num_entry and num_vlan variables are accessed (printed) as u16 variables and not like integers. They should therefore also be stored like that.
…
[View More]
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de> >--------------------------------------------------------------- 15a1335cadacc7c3bb4723a30617d123a961a311 tcpdump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tcpdump.c b/tcpdump.c index 5eb99cf..a1b057b 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -158,7 +158,8 @@ static void batctl_tvlv_parse_tt_v1(void *buff, ssize_t buff_len) { struct batadv_tvlv_tt_data *tvlv = buff; struct batadv_tvlv_tt_vlan_data *vlan; - int i, num_vlan, num_entry; + int i; + unsigned short num_vlan, num_entry; const char *type; size_t vlan_len;
[View Less]
1
0
0
0
[batctl] master: batctl: Simplify concatenation of pathnames (cfaec23)
by postmaster@open-mesh.org
01 Dec '17
01 Dec '17
Repository : ssh://git@open-mesh.org/batctl On branch : master >--------------------------------------------------------------- commit cfaec23c5f6f2cf649f3e0673b2e0c61bc01969f Author: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Date: Thu Nov 23 15:04:44 2017 +0100 batctl: Simplify concatenation of pathnames The combination of strncpy and strncat is hard to read and it is rather easy to introduce some kind of problems when using that. The usage of snprintf
…
[View More]
simplifies it slightly. Signed-off-by: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de> >--------------------------------------------------------------- cfaec23c5f6f2cf649f3e0673b2e0c61bc01969f bat-hosts.c | 4 +--- functions.c | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/bat-hosts.c b/bat-hosts.c index b530243..54b0a18 100644 --- a/bat-hosts.c +++ b/bat-hosts.c @@ -194,9 +194,7 @@ void bat_hosts_init(int read_opt) if (!homedir) continue; - strncpy(confdir, homedir, CONF_DIR_LEN); - confdir[CONF_DIR_LEN - 1] = '\0'; - strncat(confdir, &bat_hosts_path[i][1], CONF_DIR_LEN - strlen(confdir) - 1); + snprintf(confdir, CONF_DIR_LEN, "%s%s", homedir, &bat_hosts_path[i][1]); } else { strncpy(confdir, bat_hosts_path[i], CONF_DIR_LEN); confdir[CONF_DIR_LEN - 1] = '\0'; diff --git a/functions.c b/functions.c index 868e0ae..8bcf52d 100644 --- a/functions.c +++ b/functions.c @@ -208,9 +208,7 @@ int read_file(const char *dir, const char *fname, int read_opt, if (read_opt & USE_BAT_HOSTS) bat_hosts_init(read_opt); - strncpy(full_path, dir, sizeof(full_path)); - full_path[sizeof(full_path) - 1] = '\0'; - strncat(full_path, fname, sizeof(full_path) - strlen(full_path) - 1); + snprintf(full_path, sizeof(full_path), "%s%s", dir, fname); open: line = 0; @@ -349,9 +347,7 @@ int write_file(const char *dir, const char *fname, const char *arg1, char full_path[500]; ssize_t write_len; - strncpy(full_path, dir, sizeof(full_path)); - full_path[sizeof(full_path) - 1] = '\0'; - strncat(full_path, fname, sizeof(full_path) - strlen(full_path) - 1); + snprintf(full_path, sizeof(full_path), "%s%s", dir, fname); fd = open(full_path, O_WRONLY);
[View Less]
1
0
0
0
[batctl] master: batctl: Free nl_sock on genl_ctrl_resolve error (cdac2f8)
by postmaster@open-mesh.org
01 Dec '17
01 Dec '17
Repository : ssh://git@open-mesh.org/batctl On branch : master >--------------------------------------------------------------- commit cdac2f843c616caaa2a0d3847aeec84c200c62d6 Author: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Date: Thu Nov 23 15:04:41 2017 +0100 batctl: Free nl_sock on genl_ctrl_resolve error genl_ctrl_resolve may return NULL on errors. The code must then free the socket which was used to start the genl_ctrl_resolve and stop the function
…
[View More]
with an error code. Fixes: d8dd1ff1a0fe ("batctl: Use netlink to replace some of debugfs") Signed-off-by: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de> >--------------------------------------------------------------- cdac2f843c616caaa2a0d3847aeec84c200c62d6 netlink.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/netlink.c b/netlink.c index b95063a..de81d08 100644 --- a/netlink.c +++ b/netlink.c @@ -301,8 +301,10 @@ static char *netlink_get_info(int ifindex, uint8_t nl_cmd, const char *header) genl_connect(sock); family = genl_ctrl_resolve(sock, BATADV_NL_NAME); - if (family < 0) + if (family < 0) { + nl_socket_free(sock); return NULL; + } msg = nlmsg_alloc(); if (!msg) { @@ -410,8 +412,10 @@ int netlink_print_routing_algos(void) genl_connect(sock); family = genl_ctrl_resolve(sock, BATADV_NL_NAME); - if (family < 0) - return -EOPNOTSUPP; + if (family < 0) { + last_err = -EOPNOTSUPP; + goto err_free_sock; + } msg = nlmsg_alloc(); if (!msg) { @@ -1125,8 +1129,10 @@ static int netlink_print_common(char *mesh_iface, char *orig_iface, genl_connect(sock); family = genl_ctrl_resolve(sock, BATADV_NL_NAME); - if (family < 0) - return -EOPNOTSUPP; + if (family < 0) { + last_err = -EOPNOTSUPP; + goto err_free_sock; + } ifindex = if_nametoindex(mesh_iface); if (!ifindex) {
[View Less]
1
0
0
0
[batctl] master: batctl: Free nl_sock when if_nametoindex failed (4361841)
by postmaster@open-mesh.org
01 Dec '17
01 Dec '17
Repository : ssh://git@open-mesh.org/batctl On branch : master >--------------------------------------------------------------- commit 4361841bf76ecd27dcfca6edc30c63b05854d415 Author: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Date: Thu Nov 23 15:04:42 2017 +0100 batctl: Free nl_sock when if_nametoindex failed The if_nametoindex can return an error. The code must then free the previously allocated nl_sock and stop the function with an error code.
…
[View More]
Fixes: d8dd1ff1a0fe ("batctl: Use netlink to replace some of debugfs") Signed-off-by: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de> >--------------------------------------------------------------- 4361841bf76ecd27dcfca6edc30c63b05854d415 netlink.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/netlink.c b/netlink.c index de81d08..7b97809 100644 --- a/netlink.c +++ b/netlink.c @@ -1137,7 +1137,8 @@ static int netlink_print_common(char *mesh_iface, char *orig_iface, ifindex = if_nametoindex(mesh_iface); if (!ifindex) { fprintf(stderr, "Interface %s is unknown\n", mesh_iface); - return -ENODEV; + last_err = -ENODEV; + goto err_free_sock; } if (orig_iface) { @@ -1145,7 +1146,8 @@ static int netlink_print_common(char *mesh_iface, char *orig_iface, if (!hardifindex) { fprintf(stderr, "Interface %s is unknown\n", orig_iface); - return -ENODEV; + last_err = -ENODEV; + goto err_free_sock; } }
[View Less]
1
0
0
0
[batctl] master: batctl: Handle nlmsg_alloc errors (27e9937)
by postmaster@open-mesh.org
01 Dec '17
01 Dec '17
Repository : ssh://git@open-mesh.org/batctl On branch : master >--------------------------------------------------------------- commit 27e9937635ffbfe33f7f3297aff911718b8deb56 Author: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Date: Thu Nov 23 15:04:38 2017 +0100 batctl: Handle nlmsg_alloc errors nlmsg_alloc may return NULL on errors. The processing has to be aborted when this happens. Fixes: d8dd1ff1a0fe ("batctl: Use netlink to replace some of
…
[View More]
debugfs") Signed-off-by: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de> >--------------------------------------------------------------- 27e9937635ffbfe33f7f3297aff911718b8deb56 netlink.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/netlink.c b/netlink.c index 7fb1ee1..e3d7892 100644 --- a/netlink.c +++ b/netlink.c @@ -302,6 +302,11 @@ static char *netlink_get_info(int ifindex, uint8_t nl_cmd, const char *header) return NULL; msg = nlmsg_alloc(); + if (!msg) { + nl_socket_free(sock); + return NULL; + } + genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, family, 0, 0, BATADV_CMD_GET_MESH_INFO, 1); @@ -399,6 +404,11 @@ int netlink_print_routing_algos(void) return -EOPNOTSUPP; msg = nlmsg_alloc(); + if (!msg) { + last_err = -ENOMEM; + goto err_free_sock; + } + genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, family, 0, NLM_F_DUMP, BATADV_CMD_GET_ROUTING_ALGOS, 1); @@ -415,6 +425,8 @@ int netlink_print_routing_algos(void) nl_cb_err(cb, NL_CB_CUSTOM, print_error, NULL); nl_recvmsgs(sock, cb); + +err_free_sock: nl_socket_free(sock); if (!last_err) @@ -1131,6 +1143,9 @@ static int netlink_print_common(char *mesh_iface, char *orig_iface, header); msg = nlmsg_alloc(); + if (!msg) + continue; + genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, family, 0, NLM_F_DUMP, nl_cmd, 1);
[View Less]
1
0
0
0
[batctl] master: batctl: Handle nl_socket_alloc errors (bc6cd37)
by postmaster@open-mesh.org
01 Dec '17
01 Dec '17
Repository : ssh://git@open-mesh.org/batctl On branch : master >--------------------------------------------------------------- commit bc6cd37e0d3ce08e3b89e3123ffa87dc55f24c09 Author: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Date: Thu Nov 23 15:04:39 2017 +0100 batctl: Handle nl_socket_alloc errors nl_socket_alloc may return NULL on errors. The processing has to be aborted when this happens. Fixes: d8dd1ff1a0fe ("batctl: Use netlink to replace
…
[View More]
some of debugfs") Signed-off-by: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de> >--------------------------------------------------------------- bc6cd37e0d3ce08e3b89e3123ffa87dc55f24c09 netlink.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/netlink.c b/netlink.c index e3d7892..d7aeb9a 100644 --- a/netlink.c +++ b/netlink.c @@ -295,6 +295,9 @@ static char *netlink_get_info(int ifindex, uint8_t nl_cmd, const char *header) }; sock = nl_socket_alloc(); + if (!sock) + return NULL; + genl_connect(sock); family = genl_ctrl_resolve(sock, BATADV_NL_NAME); @@ -397,6 +400,9 @@ int netlink_print_routing_algos(void) }; sock = nl_socket_alloc(); + if (!sock) + return -ENOMEM; + genl_connect(sock); family = genl_ctrl_resolve(sock, BATADV_NL_NAME); @@ -1104,6 +1110,9 @@ static int netlink_print_common(char *mesh_iface, char *orig_iface, int family; sock = nl_socket_alloc(); + if (!sock) + return -ENOMEM; + genl_connect(sock); family = genl_ctrl_resolve(sock, BATADV_NL_NAME);
[View Less]
1
0
0
0
[batctl] master: batctl: Handle nl_cb_alloc errors (0a14f88)
by postmaster@open-mesh.org
01 Dec '17
01 Dec '17
Repository : ssh://git@open-mesh.org/batctl On branch : master >--------------------------------------------------------------- commit 0a14f8800dac67d706827e9be7745e2319f5412c Author: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Date: Thu Nov 23 15:04:40 2017 +0100 batctl: Handle nl_cb_alloc errors nl_cb_alloc may return NULL on errors. The processing has to be aborted when this happens. Fixes: d8dd1ff1a0fe ("batctl: Use netlink to replace some of
…
[View More]
debugfs") Signed-off-by: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de> >--------------------------------------------------------------- 0a14f8800dac67d706827e9be7745e2319f5412c netlink.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/netlink.c b/netlink.c index d7aeb9a..b95063a 100644 --- a/netlink.c +++ b/netlink.c @@ -320,11 +320,15 @@ static char *netlink_get_info(int ifindex, uint8_t nl_cmd, const char *header) nlmsg_free(msg); cb = nl_cb_alloc(NL_CB_DEFAULT); + if (!cb) + goto err_free_sock; + nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, info_callback, &opts); nl_cb_err(cb, NL_CB_CUSTOM, print_error, NULL); nl_recvmsgs(sock, cb); +err_free_sock: nl_socket_free(sock); return opts.remaining_header; @@ -425,6 +429,11 @@ int netlink_print_routing_algos(void) opts.remaining_header = strdup("Available routing algorithms:\n"); cb = nl_cb_alloc(NL_CB_DEFAULT); + if (!cb) { + last_err = -ENOMEM; + goto err_free_sock; + } + nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, netlink_print_common_cb, &opts); nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, stop_callback, NULL); @@ -1134,9 +1143,14 @@ static int netlink_print_common(char *mesh_iface, char *orig_iface, } } + cb = nl_cb_alloc(NL_CB_DEFAULT); + if (!cb) { + last_err = -ENOMEM; + goto err_free_sock; + } + bat_hosts_init(read_opt); - cb = nl_cb_alloc(NL_CB_DEFAULT); nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, netlink_print_common_cb, &opts); nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, stop_callback, NULL); nl_cb_err(cb, NL_CB_CUSTOM, print_error, NULL); @@ -1181,6 +1195,7 @@ static int netlink_print_common(char *mesh_iface, char *orig_iface, bat_hosts_free(); +err_free_sock: nl_socket_free(sock); return last_err;
[View Less]
1
0
0
0
[batctl] master: batctl: Handle failure during hash_iterator allocation (aa316bf)
by postmaster@open-mesh.org
01 Dec '17
01 Dec '17
Repository : ssh://git@open-mesh.org/batctl On branch : master >--------------------------------------------------------------- commit aa316bf6d1b2cf0ab7189ed8620c17f5018d4d37 Author: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Date: Thu Nov 23 15:04:36 2017 +0100 batctl: Handle failure during hash_iterator allocation The iterator functions should not try to start the iteration when the iterator could not be allocated. Signed-off-by: Sven Eckelmann &
…
[View More]
lt;sven.eckelmann(a)openmesh.com> Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de> >--------------------------------------------------------------- aa316bf6d1b2cf0ab7189ed8620c17f5018d4d37 hash.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hash.c b/hash.c index f4a7af7..0e4d1e3 100644 --- a/hash.c +++ b/hash.c @@ -120,6 +120,9 @@ struct hash_it_t *hash_iterate(struct hashtable_t *hash, if (iter_in == NULL) { iter = debugMalloc(sizeof(struct hash_it_t), 301); + if (!iter) + return NULL; + iter->index = -1; iter->bucket = NULL; iter->prev_bucket = NULL;
[View Less]
1
0
0
0
[batctl] master: batctl: Handle allocation error for path_buff (3b52283)
by postmaster@open-mesh.org
01 Dec '17
01 Dec '17
Repository : ssh://git@open-mesh.org/batctl On branch : master >--------------------------------------------------------------- commit 3b52283a5f60d1c6ec11628d031e72f0a28a720f Author: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Date: Thu Nov 23 15:04:37 2017 +0100 batctl: Handle allocation error for path_buff Fixes: 5a1af99276b0 ("batctl: adapt batctl to new sysfs interface handling") Fixes: 306fcb4480c9 ("batctl: support for multiple mesh clouds") Fixes:
…
[View More]
af115c9acf44 ("batctl: support new gateway sysfs API") Fixes: 2c2cb260ad2e ("batctl: list supported and configured routing algorithms") Signed-off-by: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de> >--------------------------------------------------------------- 3b52283a5f60d1c6ec11628d031e72f0a28a720f sys.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys.c b/sys.c index 65b438c..c49b428 100644 --- a/sys.c +++ b/sys.c @@ -153,6 +153,11 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv) } path_buff = malloc(PATH_BUFF_LEN); + if (!path_buff) { + fprintf(stderr, "Error - could not allocate path buffer: out of memory ?\n"); + return EXIT_FAILURE; + } + snprintf(path_buff, PATH_BUFF_LEN, SYS_BATIF_PATH_FMT, mesh_iface); if (argc != 1) { @@ -255,6 +260,11 @@ int handle_sys_setting(char *mesh_iface, int setting, int argc, char **argv) /* prepare the classic path */ path_buff = malloc(PATH_BUFF_LEN); + if (!path_buff) { + fprintf(stderr, "Error - could not allocate path buffer: out of memory ?\n"); + return EXIT_FAILURE; + } + snprintf(path_buff, PATH_BUFF_LEN, SYS_BATIF_PATH_FMT, mesh_iface); /* if the specified interface is a VLAN then change the path to point @@ -329,6 +339,11 @@ int handle_gw_setting(char *mesh_iface, int argc, char **argv) } path_buff = malloc(PATH_BUFF_LEN); + if (!path_buff) { + fprintf(stderr, "Error - could not allocate path buffer: out of memory ?\n"); + return EXIT_FAILURE; + } + snprintf(path_buff, PATH_BUFF_LEN, SYS_BATIF_PATH_FMT, mesh_iface); if (argc == 1) {
[View Less]
1
0
0
0
[batctl] master: batctl: Print dummy value when localtime failed (09dd2dc)
by postmaster@open-mesh.org
01 Dec '17
01 Dec '17
Repository : ssh://git@open-mesh.org/batctl On branch : master >--------------------------------------------------------------- commit 09dd2dc0b4945c83bd07ad4bce64062239d901fb Author: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Date: Thu Nov 23 15:04:35 2017 +0100 batctl: Print dummy value when localtime failed localtime can return NULL when the local time could not be calculated. Accessing this NULL pointer is not allowed. Fixes: 05f27bfcd302 ("add
…
[View More]
arp packets , change output") Signed-off-by: Sven Eckelmann <sven.eckelmann(a)openmesh.com> Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de> >--------------------------------------------------------------- 09dd2dc0b4945c83bd07ad4bce64062239d901fb tcpdump.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tcpdump.c b/tcpdump.c index 4ede76b..5eb99cf 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -104,7 +104,11 @@ static int print_time(void) gettimeofday(&tv, NULL); tm = localtime(&tv.tv_sec); - printf("%02d:%02d:%02d.%06ld ", tm->tm_hour, tm->tm_min, tm->tm_sec, tv.tv_usec); + if (tm) + printf("%02d:%02d:%02d.%06ld ", tm->tm_hour, tm->tm_min, tm->tm_sec, tv.tv_usec); + else + printf("00:00:00.000000 "); + return 1; }
[View Less]
1
0
0
0
← Newer
1
...
21
22
23
24
25
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Results per page:
10
25
50
100
200