inet6_rthdr_* functions fixes

Mike Makonnen mtm at FreeBSD.Org
Mon Apr 16 18:39:03 UTC 2007


Hi guys,

Please take a look at the attached patch. They fix some issues I found
while investigating the ping(8) PR (kern/99425). The behaviour of
these functions is documented in rfc3542.

Here are the details of the patch:
1. CMSG_NXTHDR(mhdr, cmsg) is supposed to dereference cmsg and return
   the next header in the chain. If cmsg is NULL it should return
   the first header. Currently if cmsg is NULL it doesn't compile,
   so I fixed it to return the first header if cmesg is NULL.
2. inet6_rth_(space|init|add) should do basic checking on their input
   to verify that the number of headers is between 0 and 127 inclusive.
   The second part of the patch to libc/net/rthdr.c addresses this issue.

Cheers.
-- 
Mike Makonnen          | GPG-KEY: http://people.freebsd.org/~mtm/mtm.asc
mmakonnen @ gmail.com | AC7B 5672 2D11 F4D0 EBF8  5279 5359 2B82 7CD4 1F55
mtm @ FreeBSD.Org     | FreeBSD - http://www.freebsd.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rthdr.diff
Type: text/x-diff
Size: 2175 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20070416/f79589d6/rthdr.bin


More information about the freebsd-net mailing list