Replaced direct access to max_xxx variables with get/set_max_xxx.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5025 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
13b219e125
commit
f5ef266db8
@ -151,7 +151,7 @@ static struct mbuf *ip_insertoptions(struct mbuf *m, struct mbuf *opt, int *phle
|
||||
n->m_next = m;
|
||||
m = n;
|
||||
m->m_len = optlen + sizeof(struct ip);
|
||||
m->m_data += max_linkhdr;
|
||||
m->m_data += get_max_linkhdr();
|
||||
memcpy(mtod(m, void *), ip, sizeof(struct ip));
|
||||
} else {
|
||||
m->m_data -= optlen;
|
||||
@ -965,7 +965,7 @@ static int ipv4_output(struct mbuf *m0, struct mbuf *opt, struct route *ro,
|
||||
ipstat.ips_odropped++;
|
||||
goto sendorfree;
|
||||
}
|
||||
m->m_data += max_linkhdr;
|
||||
m->m_data += get_max_linkhdr();
|
||||
mhip = mtod(m, struct ip*);
|
||||
*mhip = *ip;
|
||||
if (hlen > sizeof(struct ip)) {
|
||||
|
@ -73,8 +73,8 @@ void tcp_init(void)
|
||||
tcp_iss = 1;
|
||||
|
||||
tcb.inp_next = tcb.inp_prev = &tcb;
|
||||
if (max_protohdr < sizeof(struct tcpiphdr))
|
||||
max_protohdr = sizeof(struct tcpiphdr);
|
||||
if (get_max_protohdr() < sizeof(struct tcpiphdr))
|
||||
set_max_protohdr(sizeof(struct tcpiphdr));
|
||||
memset(&tcpstat, 0, sizeof(struct tcpstat));
|
||||
|
||||
memset(proto, 0, sizeof(struct protosw *) * IPPROTO_MAX);
|
||||
@ -238,7 +238,7 @@ void tcp_respond(struct tcpcb *tp, struct tcpiphdr *ti, struct mbuf *m,
|
||||
if (!m)
|
||||
return;
|
||||
tlen = 0;
|
||||
m->m_data += max_linkhdr;
|
||||
m->m_data += get_max_linkhdr();
|
||||
*mtod(m, struct tcpiphdr*) = *ti;
|
||||
ti = mtod(m, struct tcpiphdr*);
|
||||
flags = TH_ACK;
|
||||
|
@ -315,9 +315,9 @@ send:
|
||||
error = ENOBUFS;
|
||||
goto out;
|
||||
}
|
||||
m->m_data += max_linkhdr;
|
||||
m->m_data += get_max_linkhdr();
|
||||
m->m_len = hdrlen;
|
||||
if (len <= MHLEN - hdrlen - max_linkhdr) {
|
||||
if (len <= MHLEN - hdrlen - get_max_linkhdr()) {
|
||||
m_copydata(so->so_snd.sb_mb, off, (int)len, mtod(m, caddr_t) + hdrlen);
|
||||
m->m_len += len;
|
||||
} else {
|
||||
@ -343,7 +343,7 @@ send:
|
||||
error = ENOBUFS;
|
||||
goto out;
|
||||
}
|
||||
m->m_data += max_linkhdr;
|
||||
m->m_data += get_max_linkhdr();
|
||||
m->m_len = hdrlen;
|
||||
}
|
||||
m->m_pkthdr.rcvif = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user