Changeset View
Standalone View
sys/netinet6/ip6_output.c
| Show First 20 Lines • Show All 550 Lines • ▼ Show 20 Lines | if (!hdrsplit) { | ||||
| } | } | ||||
| m = exthdrs.ip6e_ip6; | m = exthdrs.ip6e_ip6; | ||||
| ip6 = mtod(m, struct ip6_hdr *); | ip6 = mtod(m, struct ip6_hdr *); | ||||
| hdrsplit = true; | hdrsplit = true; | ||||
| } | } | ||||
| if ((error = ip6_insert_jumboopt(&exthdrs, plen)) != 0) | if ((error = ip6_insert_jumboopt(&exthdrs, plen)) != 0) | ||||
| goto freehdrs; | goto freehdrs; | ||||
| ip6->ip6_plen = 0; | ip6->ip6_plen = 0; | ||||
| optlen += 8; /* JUMBOOPTLEN */ | |||||
markj: I don't really understand this. We already added `optlen` to `m->m_pkthdr.len` above. Why don't… | |||||
Not Done Inline ActionsBecause if optlen is zero, we don't put the actual header in place. The hop-by-hop extension header is put in place in line ip6_output.c#n601, which is protected by optlen > 0 in ip6_output.c#n563. tuexen: Because if `optlen` is zero, we don't put the actual header in place. The hop-by-hop extension… | |||||
Not Done Inline Actions
I understand, I'm asking about the code on line 542. markj: > Because if optlen is zero, we don't put the actual header in place. The hop-by-hop extension… | |||||
Done Inline ActionsBecause optlen does not include the jumbo payload option at the time of the increment of m_pkthdr.len. The 8 bytes are added later to m_pkthdr.len in ip6_insert_jumboopt() in line 1396. This means without this patch, optlen never includes the jumbo payload option, but m_pkthdr.len does, if the jumbo payload option should be included. However, it is only included, if optlen is positive. This results in the situation, where m_pkthdr.len indicates 8 more bytes than they are actually in the mbuf chain, since the hop-by-hop option was never inserted. tuexen: Because `optlen` does not include the jumbo payload option at the time of the increment of… | |||||
| } else | } else | ||||
| ip6->ip6_plen = htons(plen); | ip6->ip6_plen = htons(plen); | ||||
| nexthdrp = &ip6->ip6_nxt; | nexthdrp = &ip6->ip6_nxt; | ||||
| if (optlen) { | if (optlen) { | ||||
| /* | /* | ||||
| * Concatenate headers and fill in next header fields. | * Concatenate headers and fill in next header fields. | ||||
| * Here we have, on "m" | * Here we have, on "m" | ||||
| ▲ Show 20 Lines • Show All 2,774 Lines • Show Last 20 Lines | |||||
I don't really understand this. We already added optlen to m->m_pkthdr.len above. Why don't we need to do that for a lone jumbo header?