mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
In ip_stripoptions():
- Remove unused argument and incorrect comment. - Fixup ip_len after stripping.
This commit is contained in:
parent
4463135198
commit
105bd2113b
4 changed files with 6 additions and 9 deletions
|
|
@ -453,14 +453,10 @@ ip_srcroute(struct mbuf *m0)
|
|||
}
|
||||
|
||||
/*
|
||||
* Strip out IP options, at higher level protocol in the kernel. Second
|
||||
* argument is buffer to which options will be moved, and return value is
|
||||
* their length.
|
||||
*
|
||||
* XXX should be deleted; last arg currently ignored.
|
||||
* Strip out IP options, at higher level protocol in the kernel.
|
||||
*/
|
||||
void
|
||||
ip_stripoptions(struct mbuf *m, struct mbuf *mopt)
|
||||
ip_stripoptions(struct mbuf *m)
|
||||
{
|
||||
int i;
|
||||
struct ip *ip = mtod(m, struct ip *);
|
||||
|
|
@ -476,6 +472,7 @@ ip_stripoptions(struct mbuf *m, struct mbuf *mopt)
|
|||
m->m_pkthdr.len -= olen;
|
||||
ip->ip_v = IPVERSION;
|
||||
ip->ip_hl = sizeof(struct ip) >> 2;
|
||||
ip->ip_len -= olen;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ int ip_dooptions(struct mbuf *, int);
|
|||
struct mbuf *ip_insertoptions(struct mbuf *, struct mbuf *, int *);
|
||||
int ip_optcopy(struct ip *, struct ip *);
|
||||
int ip_pcbopts(struct inpcb *, int, struct mbuf *);
|
||||
void ip_stripoptions(struct mbuf *, struct mbuf *);
|
||||
void ip_stripoptions(struct mbuf *);
|
||||
struct mbuf *ip_srcroute(struct mbuf *);
|
||||
|
||||
#endif /* !_NETINET_IP_OPTIONS_H_ */
|
||||
|
|
|
|||
|
|
@ -632,7 +632,7 @@ tcp_input(struct mbuf *m, int off0)
|
|||
* Note: IP leaves IP header in first mbuf.
|
||||
*/
|
||||
if (off0 > sizeof (struct ip)) {
|
||||
ip_stripoptions(m, (struct mbuf *)0);
|
||||
ip_stripoptions(m);
|
||||
off0 = sizeof(struct ip);
|
||||
}
|
||||
if (m->m_len < sizeof (struct tcpiphdr)) {
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ udp_input(struct mbuf *m, int off)
|
|||
* check the checksum with options still present.
|
||||
*/
|
||||
if (iphlen > sizeof (struct ip)) {
|
||||
ip_stripoptions(m, (struct mbuf *)0);
|
||||
ip_stripoptions(m);
|
||||
iphlen = sizeof(struct ip);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue