diff options
author | maxim <maxim@FreeBSD.org> | 2004-05-11 19:14:44 +0000 |
---|---|---|
committer | maxim <maxim@FreeBSD.org> | 2004-05-11 19:14:44 +0000 |
commit | a4dd24e3599b545ce2f05b0141318a9f06de4a41 (patch) | |
tree | 4c994bdb0e5b16d5dedda39059abbb35d98232ac /sys | |
parent | 0af4c584461abeb2e203ec375783b649fad44a75 (diff) | |
download | FreeBSD-src-a4dd24e3599b545ce2f05b0141318a9f06de4a41.zip FreeBSD-src-a4dd24e3599b545ce2f05b0141318a9f06de4a41.tar.gz |
o Calculate a number of bytes to copy (cnt) correctly:
+----+-+-+-+-+----+----+- - - - - - - - - - - - -+----+
| | |C| | | | | | |
| IP |N|O|L|P| | IP | | IP |
| #1 |O|D|E|T| | #2 | | #n |
| |P|E|N|R| | | | |
+----+-+-+-+-+----+----+- - - - - - - - - - - - -+----+
^ ^<---- cnt - (IPOPT_MINOFF - 1) ---->|
| |
src | +-- cp[IPOPT_OFF + 1] + sizeof(struct in_addr)
|
dst +-- cp[IPOPT_OFF + 1]
PR: kern/66386
Submitted by: Andrei Iltchenko
MFC after: 3 weeks
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/ip_output.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index f1f0acd..98da087 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1735,7 +1735,7 @@ ip_pcbopts(optname, pcbopt, m) */ bcopy((&cp[IPOPT_OFFSET+1] + sizeof(struct in_addr)), &cp[IPOPT_OFFSET+1], - (unsigned)cnt + sizeof(struct in_addr)); + (unsigned)cnt - (IPOPT_MINOFF - 1)); break; } } |