FreeBSD Bugzilla – Attachment 178398 Details for
Bug 212283
oversized IP datagrams on raw socket with IP_RAWOUTPUT hang network interface drivers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
raw.diff (text/plain), 1.25 KB, created by
Andrey V. Elsukov
on 2016-12-30 15:13:31 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Andrey V. Elsukov
Created:
2016-12-30 15:13:31 UTC
Size:
1.25 KB
patch
obsolete
>Index: sys/netinet/ip_output.c >=================================================================== >--- sys/netinet/ip_output.c (revision 310784) >+++ sys/netinet/ip_output.c (working copy) >@@ -270,6 +270,9 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct > } else { > /* Header already set, fetch hlen from there */ > hlen = ip->ip_hl << 2; >+ /* Adjust ip_len to be sure that it is correct. */ >+ ip_len = m->m_pkthdr.len; >+ ip->ip_len = htons(ip_len); > } > > /* >@@ -666,8 +669,13 @@ sendit: > goto done; > } > >- /* Balk when DF bit is set or the interface didn't support TSO. */ >- if ((ip_off & IP_DF) || (m->m_pkthdr.csum_flags & CSUM_TSO)) { >+ /* >+ * Balk when DF bit is set or the interface didn't support TSO. >+ * Also prevent sending of oversized datagrams for RAW sockets >+ * with enabled IP_HDRINCL socket option. >+ */ >+ if ((ip_off & IP_DF) || (m->m_pkthdr.csum_flags & CSUM_TSO) || >+ (inp != NULL && (flags & IP_RAWOUTPUT) != 0)) { > error = EMSGSIZE; > IPSTAT_INC(ips_cantfrag); > goto bad; >@@ -747,7 +755,7 @@ ip_fragment(struct ip *ip, struct mbuf **m_frag, i > int nfrags; > uint16_t ip_len, ip_off; > >- ip_len = ntohs(ip->ip_len); >+ ip_len = m0->m_pkthdr.len; > ip_off = ntohs(ip->ip_off); > > if (ip_off & IP_DF) { /* Fragmentation not allowed */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 212283
:
174255
|
174350
|
174351
|
178331
| 178398 |
178409
|
178410
|
178417
|
178855