1
1
openwrt/package/kernel/lantiq/vrx518_tc/patches/204-dcdp-atm_tc-fix-compilation-warning.patch
Rosen Penev 7116f3cd00 lantiq: remove old kernel fixes
No longer needed.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22949
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-25 00:55:12 +02:00

32 lines
1.1 KiB
Diff

--- a/dcdp/atm_tc.c
+++ b/dcdp/atm_tc.c
@@ -686,7 +686,8 @@ static void atm_aca_init(struct atm_priv
ACA_TXOUT_EN | ACA_RXIN_EN | ACA_RXOUT_EN, 1);
}
-static int print_datetime(char *buffer, const struct timespec64 *datetime)
+static int print_datetime(char *buffer, int buffer_size,
+ const struct timespec64 *datetime)
{
struct tm nowtm;
char tmbuf[64];
@@ -705,7 +706,8 @@ static int print_datetime(char *buffer,
nowtm.tm_hour,
nowtm.tm_min,
nowtm.tm_sec);
- snprintf(buffer, sizeof(buffer), "%s.%06d", tmbuf, (int)datetime->tv_nsec / 1000);
+ snprintf(buffer, sizeof(tmbuf)+buffer_size, "%s.%06d",
+ tmbuf, (int)datetime->tv_nsec / 1000);
return 0;
}
@@ -907,7 +909,7 @@ void show_atm_pvc(struct seq_file *seq,
char buf[64];
seq_printf(seq, "\tNet device: %s\n", pvc->dev->name);
- print_datetime(buf, &(pvc->access_time));
+ print_datetime(buf, sizeof(buf), &(pvc->access_time));
seq_printf(seq, "\tLast user cell: %s\n", buf);
seq_printf(seq, "\tPort: %d\n", pvc->port);
seq_printf(seq, "\tSoftware TX Queue: %u\n", pvc->sw_txq_tbl);