Skip to content

Commit 7b308fe

Browse files
zenczykowskiummakynes
authored andcommitted
netfilter: xt_recent: fix (increase) ipv6 literal buffer length
in6_pton() supports 'low-32-bit dot-decimal representation' (this is useful with DNS64/NAT64 networks for example): # echo +aaaa:bbbb:cccc:dddd:eeee:ffff:1.2.3.4 > /proc/self/net/xt_recent/DEFAULT # cat /proc/self/net/xt_recent/DEFAULT src=aaaa:bbbb:cccc:dddd:eeee:ffff:0102:0304 ttl: 0 last_seen: 9733848829 oldest_pkt: 1 9733848829 but the provided buffer is too short: # echo +aaaa:bbbb:cccc:dddd:eeee:ffff:255.255.255.255 > /proc/self/net/xt_recent/DEFAULT -bash: echo: write error: Invalid argument Fixes: 079aa88 ("netfilter: xt_recent: IPv6 support") Signed-off-by: Maciej Żenczykowski <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 17cd01e commit 7b308fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netfilter/xt_recent.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ recent_mt_proc_write(struct file *file, const char __user *input,
561561
{
562562
struct recent_table *t = pde_data(file_inode(file));
563563
struct recent_entry *e;
564-
char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:5afe:c0de")];
564+
char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:255.255.255.255")];
565565
const char *c = buf;
566566
union nf_inet_addr addr = {};
567567
u_int16_t family;

0 commit comments

Comments
 (0)