Skip to contentSkip to conversation

IPv6:Check the outgoing hop limit value

RFC PATCH In review Shan Wei 2 participants 2 messages Jun 10, 2008

Subsystems (2)
lore
Share & tools
lore

Shan Wei

author
#0 lore raw

RFC PATCH 1/3 IPv6:Check the outgoing hop limit value

When specifing the outgoing hop limit as ancillary data for sendmsg(), the kernel doesn't check the integer hop limit value as specified in [RFC-3542] section 6.3.

---
 net/ipv6/datagram.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
net/ipv6/datagram.c +5 -0
index b9c2de8..0f0f94a 100644
@@ -705,6 +705,11 @@ int datagram_send_ctl(struct net *net,
 			}
 
 			*hlimit = *(int *)CMSG_DATA(cmsg);
+			if (*hlimit < -1 || *hlimit > 0xff) {
+				err = -EINVAL;
+				goto exit_f;
+			}
+
 			break;
 
 		case IPV6_TCLASS:
#1 lore raw

In article <[email protected]> (at Tue, 10 Jun 2008 15:50:55 +0800), Shan Wei <[email protected]> says:

Quoted 3 lines

When specifing the outgoing hop limit as ancillary data for sendmsg(), the kernel doesn't check the integer hop limit value as specified in [RFC-3542] section 6.3.

I'm going apply this in my queue. Thanks.

--yoshfuji