History

net: ipv4: Avoid bounds check warning

Fix the following build warning when CONFIG_IPV6 is not set: In function ‘fortify_memcpy_chk’, inlined from ‘tcp_md5_do_add’ at net/ipv4/tcp_ipv4.c:1210:2: ./include/linux/fortify-string.h:328:4: error: call to ‘__write_overflow_field’ declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] 328 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

huhai committed 4 years ago

Commit 3a2cd891 parent 90343f51 file · +2 −2Browse files

Unified · Split

net/ipv4/tcp_ipv4.c+2−2
@@ -1207,8 +1207,8 @@ int tcp_md5_do_add(struct sock *sk, const union tcp_md5_addr *addr, · 1206 unmodified lines
1207 key->l3index = l3index;1207 key->l3index = l3index;
1208 key->flags = flags;1208 key->flags = flags;
1209 memcpy(&key->addr, addr,1209 memcpy(&key->addr, addr,
1210 (family == AF_INET6) ? sizeof(struct in6_addr) :1210 (IS_ENABLED(CONFIG_IPV6) && family == AF_INET6) ? sizeof(struct in6_addr) :
1211 sizeof(struct in_addr));1211 sizeof(struct in_addr));
1212 hlist_add_head_rcu(&key->node, &md5sig->head);1212 hlist_add_head_rcu(&key->node, &md5sig->head);
1213 return 0;1213 return 0;
1214}1214}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t